Conversation
3 tasks
farhan
force-pushed
the
farhan/modernize-python-repo-2
branch
from
September 21, 2026 15:30
eb00a70 to
bca468d
Compare
This was referenced Sep 22, 2026
farhan
force-pushed
the
farhan/modernize-python-repo-2
branch
2 times, most recently
from
September 22, 2026 13:24
af5b8aa to
a22bce9
Compare
…ic-release Replaces setup.py/setup.cfg and pip-compile with a PEP 621 pyproject.toml, PEP 735 dependency groups, uv/uv.lock, src/ layout, and python-semantic-release with OIDC-based PyPI publishing. Part of openedx/public-engineering#506. PSR is configured to use conventional commits for version bumping and changelog generation, with tag_format "v{version}" matching existing release tags. Releases publish to PyPI via OIDC trusted publishing (no stored secrets), using a two-step pattern — PSR tags and builds, then gh release create attaches dists — to satisfy the openedx org's immutable-releases constraint. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
farhan
force-pushed
the
farhan/modernize-python-repo-2
branch
from
September 22, 2026 15:04
a22bce9 to
c4c4cbd
Compare
Old setup.py used find_packages(exclude=["*tests"]) but nested test subdirectories (sinks/tests/, extensions/tests/, etc.) slipped through as package data under include-package-data=true. Add exclude-package-data to drop all tests/* paths from the built wheel. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Per Feanil's guidance, Makefiles should not force/assume the uv environment. Developers activate the venv themselves; CI uses `uv run tox` in the workflow step. Strip `uv run` from all Makefile targets except `upgrade`. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
farhan
marked this pull request as ready for review
September 28, 2026 08:07
salman2013
reviewed
Sep 28, 2026
| @@ -18,10 +18,7 @@ build: | |||
|
|
|||
| python: | |||
| install: | |||
There was a problem hiding this comment.
Suggested change
| install: | |
| # `uv sync` against the committed uv.lock, so the docs build against the | |
| # same pinned versions as CI -- and inherits the minimum release age | |
| # recorded in the lock. This used to be `requirements: requirements/doc.txt`, | |
| # which stopped existing when the repo moved to uv.lock. | |
| - method: uv | |
| command: sync | |
| groups: | |
| - doc |
| @@ -1,5 +1,6 @@ | |||
| [tox] | |||
| envlist = py312-django{52} | |||
| envlist = quality, docs, pii_check, py | |||
There was a problem hiding this comment.
Could you share a reason for removing python and django version. py312-django{52}and use py
Author
There was a problem hiding this comment.
as only one Django version and one python version is tested, django is already declared as a dependency in the test group in pyproject.toml and pinned via uv.lock.
| branch = true | ||
| relative_files = true | ||
| data_file = ".coverage" | ||
| source = ["platform_plugin_aspects"] |
There was a problem hiding this comment.
Suggested change
| source = ["platform_plugin_aspects"] | |
| source_pkgs = ["platform_plugin_aspects"] |
source = [...] resolves by path, which breaks with a src/ layout since the package directory doesn't exist at the repo root. source_pkgs resolves by import name regardless of where the package lives on disk. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The pip method with extra_requirements won't find anything to install since dependencies moved from pip extras to PEP 735 dependency groups. uv sync --group doc installs from the committed uv.lock correctly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
source_pkgs resolves by import name and silently drops packages that pytest never imports. source = ["src"] tracks every .py file under src/ by path regardless of imports. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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. Refined and validated before being submitted for code review.
Modernize
platform-plugin-aspectsPart of openedx/public-engineering#506
Summary
src/layoutsetup.py/setup.cfgwithpyproject.toml(PEP 621 static metadata)uvwith PEP 735 dependency groups; commituv.lockpyproject.tomlastral-sh/setup-uv; SHA-pin all actionspython-semantic-release+release.yml(OIDC trusted publishing)commitlint.ymlto enforce conventional commit format on all future PRs to this repo (already existed on master — kept as-is)requires-python = ">=3.12"setRemoved/Updated
Deleted files:
setup.py,setup.cfg,requirements/,.coveragerc,.github/workflows/pypi-publish.ymlRemoved Makefile targets:
upgradeuv run --with edx-lint edx_lint write_uv_constraints pyproject.toml && uv lock --upgradepiptoolsUpdated Makefile targets:
requirementspip-sync -q requirements/dev.txt; nowuv sync --group devdocstox -e docs; nowtox -e docs(bare tox — venv activated by caller)qualitytox -e quality; nowtox -e quality(bare tox — venv activated by caller)pii_checktox -e pii_check; nowtox -e pii_check(bare tox — venv activated by caller)testpytest; nowpytest(unchanged)test-alltox && tox -e docs; nowtox && tox -e docs(bare tox — venv activated by caller)extract_translationsplatform_plugin_aspects/tosrc/platform_plugin_aspects/compile_translationsplatform_plugin_aspects/tosrc/platform_plugin_aspects/formatplatform_plugin_aspectstosrc/platform_plugin_aspectssrc/platform_plugin_aspects/after src/ layout moveVersioning
[Dynamic]
setuptools-scmwithdynamic = ["version"]— master had a PyPI publish workflow;python-semantic-releasecontrols the version string at release time via git tags.Important Notes
pypi-publish.ymlworkflow was deleted because it used token-based authentication (PYPI_UPLOAD_TOKEN) andpython setup.py sdist bdist_wheel, both of which are obsolete. It is replaced byrelease.ymlwhich uses OIDC trusted publishing.toxenvmatrix now usespy(instead ofdjango52) since only one Django version is tested and it is declared as a runtime dependency in[project].dependencies. The olddjango52tox env resolved Django viarequirements/test.txt; the newpyenv installs Django through thetestdependency group and uv.lock.commitlint.ymlalready existed on master and was kept unchanged. Conventional commit format was already enforced on this repo.pipandwheelfrompip.inare not declared as explicit dependencies — they are build bootstrap tools that uv replaces entirely. Thepip<26.2constraint is retained in[tool.uv].constraint-dependencies.v2.0.0has been pushed sopython-semantic-releasecan correctly identify the latest release.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,pytest,python -m build). Repo-owner is encouraged to run the repo's feature tests before merging.🤖 Generated with Claude Code