feat: modernize to uv + pyproject.toml (PEP 621/735) + python-semantic-release#247
Draft
farhan wants to merge 2 commits into
Draft
feat: modernize to uv + pyproject.toml (PEP 621/735) + python-semantic-release#247farhan wants to merge 2 commits into
farhan wants to merge 2 commits into
Conversation
- 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 - src/ layout already present; update pyproject.toml to reference it - Retain flake8 as on master (ruff deferred to its own epic); coverage config moved into pyproject.toml - Add .flake8 config (migrated from setup.cfg [flake8] section) - Update tox.ini to use tox-uv with uv-venv-lock-runner; drop py311 - Update CI to use astral-sh/setup-uv; SHA-pin all actions; add workflow_call trigger - Add release.yml with python-semantic-release and OIDC trusted publishing - Delete publish_pypi.yml (replaced by release.yml) - Add setuptools<71 constraint (required by enmerkar==0.7.1 which uses pkg_resources) Part of openedx/public-engineering#506 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… Codecov Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
farhan
marked this pull request as draft
July 18, 2026 09:18
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Important
PR implemented with the assistance of Claude Code, human-reviewed and improved before pushing to code review.
Summary
Modernize
enmerkar-underscoreto uv + pyproject.toml (PEP 621/735) + python-semantic-release.Part of openedx/public-engineering#506.
setup.py/setup.cfgwithpyproject.toml(PEP 621 static metadata)uvwith PEP 735 dependency groups; commituv.locksrc/layout; updated pyproject.toml to reference it withwhere = ["src"]setup.cfgto.flake8; coverage config moved intopyproject.tomltox.inito usetox-uvwithuv-venv-lock-runner; drop Python 3.11astral-sh/setup-uv; SHA-pin all actions; addworkflow_calltriggerpython-semantic-release+release.yml(OIDC trusted publishing)commitlint.ymlto enforce conventional commit format on all future PRs to this repo (already existed on master — no change needed)requires-python = ">=3.12"Removed
Deleted files:
setup.py,setup.cfg,requirements/,.flake8(config moved to.flake8fromsetup.cfg [flake8]),publish_pypi.yml(replaced byrelease.yml)Removed Makefile targets:
lintqualitytarget (delegates totox -e quality)coveragedjango-babel-underscore(wrong package name) andsetup.py test; coverage now runs as part oftox -e py312-django*releasepython setup.py sdist upload— replaced by python-semantic-release inrelease.ymldistpython setup.py sdist bdist_wheel—python -m buildused inrelease.ymlinsteadPython 3.11 dropped
Python 3.11 reached end-of-life on October 31, 2024 and Open edX Sumac dropped it platform-wide. Removed from the tox envlist, CI matrix, and classifiers.
Versioning
[Dynamic]
setuptools-scmwithdynamic = ["version"]— master had a PyPI publish workflow (publish_pypi.yml);python-semantic-releasecontrols the version string at release time via git tags. The repo is on2.x, so no zero-version guard is needed.Notes
setuptools<71constraint added: Theenmerkar==0.7.1dependency usespkg_resources(from setuptools), which was removed from the default namespace in setuptools >= 71. Asetuptools<71constraint is added to[tool.edx_lint].uv_constraintsand[tool.uv].constraint-dependenciesto ensure the package continues to function. This is a pre-existing upstream issue in theenmerkarpackage.pytest-pep8andpytest-flakesremoved: These pytest plugins were inrequirements/test.inbut are incompatible with modern pytest (they use an outdatedpytest_collect_filehook signature). They are dropped in favor of runningflake8directly in thequalitytox env. The linting coverage is preserved.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.Code reviewer notes:
openedx/enmerkar-underscore, workflowrelease.yml).commitlint.ymlwas already present on master, so conventional commit format is already enforced — no behavioral change for contributors.setuptools<71constraint is a runtime workaround forenmerkar==0.7.1's use of the deprecatedpkg_resourcesAPI; ideallyenmerkarshould be updated upstream to useimportlib.metadatainstead.HISTORY.rstis kept (it is notCHANGELOG.rst) — semantic-release will manage future release notes.🤖 Generated with Claude Code