Skip to content

build: modernize edx-django-utils repo to uv + pyproject.toml - #557

Open
farhan wants to merge 3 commits into
openedx:masterfrom
farhan:farhan/modernize-python-repo
Open

farhan wants to merge 3 commits into
openedx:masterfrom
farhan:farhan/modernize-python-repo

Conversation

@farhan

@farhan farhan commented Oct 28, 2026 •

Copy link
Copy Markdown

Important

PR implemented with the assistance of Claude Code. Refined and validated before being submitted for code review.

Modernize edx-django-utils
Part of openedx/public-engineering#506

Summary

  • Publishes to PyPI as edx-django-utils.
  • Move the package into a src/ layout.
  • Replace setup.py/setup.cfg with pyproject.toml (PEP 621 static metadata).
  • Switch from pip-compile to uv with PEP 735 dependency groups; commit uv.lock.
  • Retain pylint/isort/pycodestyle/pydocstyle as on master.
  • Coverage config moved from .coveragerc into pyproject.toml.
  • Update CI to use astral-sh/setup-uv; SHA-pin all actions.
  • Add python-semantic-release + release.yml (OIDC trusted publishing), replacing the tag-triggered pypi-publish.yml.

Removed/Updated

Deleted files: setup.py, setup.cfg, requirements/, .coveragerc, .github/workflows/pypi-publish.yml

Updated Makefile targets:

Target Change
requirements uv sync --locked --group dev instead of pip-sync
upgrade edx_lint write_uv_constraints + uv lock --upgrade instead of pip-compile
quality Runs pylint/pycodestyle/pydocstyle/isort directly with DJANGO_SETTINGS_MODULE=test_settings exported (tox now calls make quality); setup.py dropped from the file lists
isort Runs isort directly (tox now calls make isort)
docs Runs doc8/Sphinx/build/twine directly (tox now calls make docs); python setup.py bdist_wheel → python -m build --wheel; the dev group now includes doc so this works from make requirements
test python -Wd -m pytest $(PYTEST_ARGS) so tox keeps master's -Wd and {posargs} behavior

Versioning

setuptools-scm with dynamic = ["version"] — master had a PyPI publish workflow; python-semantic-release controls the version string at release time via git tags.

Important Notes

  • [tool.edx_lint].uv_constraints adds setuptools<82: the existing doc8<1.0.0 pin imports pkg_resources, which setuptools 82 removed.
  • ci.yml no longer has a push: trigger; release.yml calls it via workflow_call on pushes to master. The tests job name and matrix are unchanged.

Testing Notes

This PR has not been manually tested against the repo's own features. Testing relied on CI checks and local agent tooling (make requirements, make quality, make test, make docs, python -m build). Repo-owner is encouraged to run the repo's feature tests before merging.


🤖 Generated with Claude Code

farhan and others added 2 commits October 28, 2026 20:02
Move to the org-standard packaging and release tooling (public-engineering#506):
static PEP 621 metadata, a locked uv environment with PEP 735 dependency
groups, a src/ layout, and python-semantic-release with OIDC publishing so
releases are driven by conventional commits instead of manual tags.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
These targets used to delegate to tox, which set DJANGO_SETTINGS_MODULE and
installed the doc tools. Now that they run the tools directly, export the
settings for pylint-django and include the doc group in dev so
`uv run make quality` and `uv run make docs` work from the dev environment.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GitHub master blob URLs and Transifex paths still pointed at the old
top-level edx_django_utils/ directory and would break after merge. The
requirements/private.* ignore entries are dropped since requirements/
no longer exists.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@farhan
farhan marked this pull request as ready for review October 30, 2026 06:26
@irfanuddinahmad

Copy link
Copy Markdown
Contributor

uv.lock was resolved fresh, so this upgrades most of master's pins (Django 4.2.25→5.2.18 in base/quality, newrelic 11→14, pylint 3→4). Per feanil on enterprise-access#1015, please seed the lock from master's requirements/*.txt and leave upgrades to the first make upgrade. docs/getting_started.rst and docs/testing.rst still describe a virtualenv setup.

Since ci.yml no longer runs on pushes to master (CI now runs inside release.yml), the README "Python CI" badge will stay stuck on its last pre-migration result; XBlock's still shows June's. Pointing it at actions/workflows/release.yml/badge.svg?branch=master, or dropping it, fixes that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants