Skip to content

feat: modernize packaging with uv, pyproject.toml and semantic-release - #288

Open
farhan wants to merge 1 commit into
openedx:masterfrom
farhan:farhan/modernize-python-repos
Open

feat: modernize packaging with uv, pyproject.toml and semantic-release#288
farhan wants to merge 1 commit into
openedx:masterfrom
farhan:farhan/modernize-python-repos

Conversation

@farhan

@farhan farhan commented Sep 2, 2026

Copy link
Copy Markdown

Important

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

Modernize i18n-tools
Part of openedx/public-engineering#506

Summary

  • edx-i18n-tools publishes to PyPI: https://pypi.org/project/edx-i18n-tools/
  • Move the package into a src/ layout (src/i18n/)
  • 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 (edx-lint) and pycodestyle as on master
  • Coverage config moved into pyproject.toml
  • Update CI to use astral-sh/setup-uv, uv sync --group ci, and uv run tox; all actions SHA-pinned
  • Add python-semantic-release + release.yml (OIDC trusted publishing), replacing the legacy pypi-publish.yml

Removed/Updated

Deleted files: setup.py, setup.cfg, .coveragerc, requirements/

Removed workflows: pypi-publish.yml (replaced by release.yml with OIDC publishing), upgrade-python-requirements.yml (depended on the deleted requirements/ + pip-compile toolchain; dependency upgrades are now handled by make upgrade via uv lock --upgrade)

Removed Makefile targets:

Target Reason
piptools Installed pip-tools; the pip-compile toolchain is replaced by uv
common_constraints.txt Fetched/patched the pip-compile common-constraints file; constraints now live in [tool.edx_lint].uv_constraints

Updated Makefile targets:

Target Change
upgrade Now runs edx_lint write_uv_constraints + uv lock --upgrade instead of pip-compile
requirements Now runs uv sync --group dev instead of pip-sync
test-python Runs uv run pytest directly
quality-python Runs uv run pycodestyle/uv run pylint directly against src/i18n (was tox -e quality)

Versioning

setuptools-scm with dynamic = ["version"] — the repo publishes to PyPI and python-semantic-release controls the version string at release time via git tags. Current version 2.0.0 is 1.x+, so no zero-version guard is set.

Important Notes

  • Conventional commit format is now enforced on all future PRs to this repo via commitlint.yml (already present on master).
  • No docs tox environment was added: the repo has no docs infrastructure (no docs/ directory, no Sphinx config, no make docs target) on master, so there is nothing to build.
  • The pycodestyle ignore = E501,E731 config lived in the deleted setup.cfg; it was migrated to a [pycodestyle] section in tox.ini (pycodestyle does not read pyproject.toml).
  • CI toxenv names (quality, django42, django52) and the block-form matrix lists are kept in exact parity with master; the Codecov upload still runs on django42.

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, python -m build). Repo-owner is encouraged to run the repo's feature tests before merging.


🤖 Generated with Claude Code

Migrate from setup.py/pip-compile to PEP 621 static metadata in
pyproject.toml, uv with PEP 735 dependency groups, a src/ layout, and
python-semantic-release for OIDC-based PyPI publishing. This aligns the
repo with the current Open edX packaging standard and removes the
requirements/ compile toolchain.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@codecov

codecov Bot commented Sep 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.78%. Comparing base (483d671) to head (ca5aaad).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #288   +/-   ##
=======================================
  Coverage   99.78%   99.78%           
=======================================
  Files          11       11           
  Lines         461      461           
  Branches       17       17           
=======================================
  Hits          460      460           
  Partials        1        1           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@farhan
farhan marked this pull request as ready for review September 4, 2026 17:10
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.

1 participant