Skip to content

feat: modernize to uv + pyproject.toml (PEP 621/735) + python-semantic-release - #248

Open
farhan wants to merge 5 commits into
openedx:masterfrom
farhan:farhan/modernize-python-repos
Open

feat: modernize to uv + pyproject.toml (PEP 621/735) + python-semantic-release#248
farhan wants to merge 5 commits into
openedx:masterfrom
farhan:farhan/modernize-python-repos

Conversation

@farhan

@farhan farhan commented Jul 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 `enmerkar-underscore`
Part of openedx/public-engineering#518

Summary

  • Repo publishes to PyPI: https://pypi.org/project/enmerkar-underscore/
  • 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 flake8 as on master (no ruff introduced)
  • Update CI to use `astral-sh/setup-uv`; SHA-pin all actions
  • Add `python-semantic-release` + `release.yml` (OIDC trusted publishing)
  • Drop Python 3.11 support; set `requires-python = ">=3.12"`

Removed/Updated

Deleted files: `setup.py`, `setup.cfg`, `requirements/`, `publish_pypi.yml`

Removed Makefile targets: None

Updated Makefile targets:

Target Change
`upgrade` Replaced pip-compile invocations with `edx_lint write_uv_constraints` + `uv lock --upgrade`
`requirements` New target: `uv sync --group dev` + `uv tool install tox --with tox-uv`
`lint` Fixed stale path `django-babel-underscore` → `src tests` (pre-existing breakage; `django-babel-underscore` was the original source directory name)

Python 3.11 dropped

Python 3.11 reached end-of-life on 2025-11-30 and Open edX Sumac dropped it platform-wide. Removed from the tox envlist, CI matrix, and classifiers.

Versioning

[Dynamic] `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

  • OIDC trusted publisher must be configured on PyPI before merging. The new `release.yml` uses PyPI's OIDC trusted publishing (no token). Configure at https://pypi.org/manage/project/enmerkar-underscore/settings/publishing/ with workflow name `release.yml`.
  • `publish_pypi.yml` was deleted — it used `requirements/pip.txt` (deleted) and `setup.py` (deleted) which no longer exist. `release.yml` is the replacement.
  • `enmerkar==0.7.1` uses `pkg_resources` (removed from setuptools>=71). Pinned `setuptools<71` in `[tool.edx_lint].uv_constraints` until `enmerkar` is upgraded to use `importlib.metadata`.
  • `pytest-pep8` and `pytest-flakes` (from original `test.in`) are incompatible with pytest 8+ on Python 3.12. Added `-p no:pep8 -p no:flakes` to the tox test command. These packages are retained in the dependency group to match the original `test.in`.
  • The `docs/conf.py` has `import django-babel-underscore` (invalid Python syntax, pre-existing). The docs tox env and `doc` dependency group were omitted as the docs build was non-functional on master.
  • `commitlint.yml` already existed on master — conventional commit format is already enforced.

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


🤖 Generated with Claude Code

…c-release

Part of openedx/public-engineering#518

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
farhan and others added 2 commits July 29, 2026 12:34
- Move __version__ definition after imports in __init__.py
- Update Makefile test target to use pytest with correct flags
- Delegate tox test command to make test

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@farhan
farhan marked this pull request as ready for review July 29, 2026 07:41
farhan and others added 2 commits July 29, 2026 14:59
workflow_call is out of scope. fail-fast: true is the GitHub Actions
default and adds no value when stated explicitly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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