Files
edx-platform/requirements/edx/testing.in
Feanil Patel 467495cb22 feanil/pycodestyle to ruff (#38076)
* feat: add ruff and configure it to match current pycodestyle rules

Adds ruff to testing requirements and configures it in pyproject.toml
to enforce the same E/W rules that pycodestyle 2.8.x was enforcing.
Two additional rules (E714, E721) that pycodestyle 2.8.x did not enforce
are explicitly ignored for now and can be cleaned up in a follow-up.

Part of the migration from pycodestyle → ruff.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* feat: add ruff Makefile target

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* feat: add ruff to quality CI workflow alongside pycodestyle

Runs ruff alongside pycodestyle so we can validate parity before
removing pycodestyle in the next commit.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* feat: remove pycodestyle, replaced by ruff

- Remove pycodestyle from requirements
- Remove pycodestyle version constraint (pinned to <2.9.0 due to a
  false positive E275 bug that is no longer relevant)
- Remove [pycodestyle] config from setup.cfg (config now lives in
  pyproject.toml under [tool.ruff])
- Remove pycodestyle Makefile target
- Remove make pycodestyle from quality CI workflow

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* style: Apply suggestions from code review

Remove unnecessary ignores.

Co-authored-by: Braden MacDonald <braden@opencraft.com>

* style: Fix a style isusue and remove ignores.

Most of these ignores are unnecessary as we're passing them now and we
want to check them in the future. E714 only had one fixable violation so
we just fixed it.

* style: Update ruff config and workflows

* Update the call to `ruff` so that it outputs in a github friendly
manner.

* Remove ruff exclusions that are already covered by .gitignore which
  ruff respects.

* chore: Recompile requirements.

Update the requirements to drop pycodestyle and add ruff.

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Braden MacDonald <braden@opencraft.com>
2026-03-04 17:33:06 +00:00

50 lines
3.2 KiB
Plaintext

# This requirements file is only for python packages that need to be installed
# for the edx-platform in testing environments. This includes:
# * Jenkins
# * devstack
# Please do not use this file for packages that are needed in production
#
# DON'T JUST ADD NEW DEPENDENCIES!!!
#
# If you open a pull request that adds a new dependency, you should:
# * verify that the dependency has a license compatible with AGPLv3
# * confirm that it has no system requirements beyond what we already install
# * run "make upgrade" to update the detailed requirements files
# * add an appropriate pattern to scripts/dependencies/testing.py
-c ../constraints.txt
-r base.txt # Core edx-platform production dependencies
-r coverage.txt # Utilities for calculating test coverage
beautifulsoup4 # Library for extracting data from HTML and XML files
code-annotations # Perform code annotation checking, such as for PII annotations
cssselect # Used to extract HTML fragments via CSS selectors in 2 test cases and pyquery
ddt # Run a test case multiple times with different input; used in many, many of our tests
edx-lint # pylint extensions for Open edX repositories
factory-boy # Library for creating test fixtures, used in many tests
# Pinning the freezegun version because 0.3.13 is causing failures which have also been reported on the git repo by public.
freezegun # Allows tests to mock the output of assorted datetime module functions
httpretty # Library for mocking HTTP requests, used in many tests
import-linter # Tool for making assertions about which modules can import which others
isort # For checking and fixing the order of imports
mock # Deprecated alias to standard library `unittest.mock`
ruff # Fast Python linter and formatter
polib # Library for manipulating gettext translation files, used to test paver i18n commands
pyquery # jQuery-like API for retrieving fragments of HTML and XML files in tests
pytest # Testing framework
pytest-attrib # Select tests based on attributes
pytest-cov # pytest plugin for measuring code coverage
pytest-django # Django support for pytest
pytest-json-report # Output json formatted warnings after running pytest
pytest-metadata # To prevent 'make upgrade' failure, dependency of pytest-json-report
pytest-randomly # pytest plugin to randomly order tests
pytest-xdist[psutil] # Parallel execution of tests on multiple CPU cores or hosts
singledispatch # Backport of functools.singledispatch from Python 3.4+, used in tests of XBlock rendering
testfixtures # Provides a LogCapture utility used by several tests
tox # virtualenv management for tests
unidiff # Required by coverage_pytest_plugin
pylint-pytest # A Pylint plugin to suppress pytest-related false positives.
pact-python # Library for contract testing
py # Needed for pytest configurations, was previously been fetched through tox