feat: modernize Python tooling (pyproject.toml + uv)#1136
feat: modernize Python tooling (pyproject.toml + uv)#1136irfanuddinahmad wants to merge 6 commits into
Conversation
|
Thanks for the pull request, @irfanuddinahmad! This repository is currently maintained by Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review. 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. DetailsWhere can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources: When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
Move isort/pytest settings from setup.cfg into pyproject.toml. enterprise-catalog is a deployed Django service, not a published package, so no [build-system]/packaging metadata is added here. The [flake8] section in setup.cfg is dropped since flake8 isn't invoked anywhere in this repo (Makefile/tox.ini/CI); pycodestyle config moves to tox.ini in the next commit alongside the dependency-groups migration. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Replace requirements/*.in + *.txt with PEP 735 dependency-groups in
pyproject.toml and a single uv.lock. Since this repo has no [project]
packaging metadata, runtime deps live in an explicit `base` group that
test/quality/doc/production/dev all compose via {include-group = "base"}.
A dedicated `ci` group holds tox/tox-uv, composed into `dev`. Update the
existing tox.ini to use the uv-venv-lock-runner, update the Makefile, and
switch the MySQL8 migrations-check workflow to install uv and run
`uv sync`/`uv run`.
The main Django CI workflow (ci.yml) runs tests inside the
`edxops/enterprise-catalog-dev` devstack image via validate.sh -> `make
requirements && make validate`; since that image is built in a separate
repo, it isn't touched here, but it will need `uv` preinstalled before
this workflow will pass again. Also dropped requirements/optional.txt
and requirements/monitoring/, which were unused by any Makefile target
or workflow, and the pip<25.3 constraint, which was a pip-tools/pip
build-compatibility pin with no bearing under uv.
Note: could not fully verify `uv sync`/`uv run tox` locally on this
machine (no libmysqlclient/pkg-config for building mysqlclient from
source) -- `uv lock` resolves cleanly; full sync needs verifying via CI.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
CI runs this script inside the edxops/enterprise-catalog-dev Docker image, which doesn't have uv preinstalled -- "make: uv: No such file or directory". Installing it here unblocks CI without needing to update that image separately, though updating the image directly (so this doesn't need to pip install uv on every run) would still be worth doing separately. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…t dirs
pylint scans the whole enterprise_catalog tree, which includes per-app
tests/ subdirectories that import ddt/pytest -- caught proactively after
finding the same gap in license-manager's quality group (CI failure
there: "Unable to import 'ddt'"). Compose {include-group = "test"}
instead of just "base".
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
quality already gets edx-lint transitively via {include-group = "test"},
which lists it directly.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Every uv sync/uv run invocation in this repo names an explicit --group, but uv's implicit default group (named "dev") was still being synced alongside it, silently pulling the entire dev/test/quality/ci superset into every target. Verified with `uv sync --group ci`. Also adds .venv to .gitignore alongside the existing venv/ entry. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
70602cd to
64f835f
Compare
Summary
Modernizes this repo's Python tooling per the org-wide standardization tracked in openedx/public-engineering#513 (and the parent openedx/public-engineering#506):
pyproject.toml, replacingsetup.cfg. This is a deployed Django service, not a published package, so no[project]/packaging metadata or semantic-release is added.pip-compiletouv:requirements/*.in+*.txtare replaced by PEP 735[dependency-groups]+ a singleuv.lock. Since there's no[project]table, runtime deps live in an explicitbasegroup that other groups compose via{include-group = "base"}.tox.ini/Makefileto usetox-uv'suv-venv-lock-runner, and switchmysql-migrations-check.ymlto install uv and run viauv sync/uv run tox.Heads up: this repo's
ci.ymlruns tests inside a prebuiltedxops/enterprise-catalog-devDocker image (viavalidate.sh→make requirements && make validate), built in a separate repo. That image will needuvinstalled before this branch's CI can pass -- I didn't have access to fix that from here.Part of openedx/public-engineering#513.
Test plan
uv lockresolves cleanly (193 packages)uv sync/uv run toxon my machine (nolibmysqlclient/pkg-configlocally to buildmysqlclientfrom source) -- CI's ubuntu-latest runners have these preinstalled, so this needs verifying there, along with the Docker image update noted above.🤖 Generated with Claude Code