Repository navigation
chore: modernize Python repo to uv + pyproject.toml - #329
Conversation
3f650dc to
3d80bf7
Compare
…0 and Test#445 Test#180 now verifies release.yml's push branch matches the repo's actual default branch (via gh repo view) and flags the mismatch with a concrete fix instruction. Repos like django-wiki use edx_release, not master, so the standard template would silently never release. Test#445 gains a note that a dead push trigger (wrong branch name) masks the double-run bug — both tests must be fixed together when the default branch is not master. References: - openedx/platform-plugin-aspects#257 (original double-run fix) - openedx/django-wiki#329 (first non-master default branch case) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Caution
This repo's default branch is Why this is a breaking change: The existing As currently written, Fix: Update the three occurrences in
@feanil -- Can you please look/share your thoughts into this issue or tag the relevant maintainer |
caac099 to
3b83232
Compare
|
That makes sense to me. |
7e73e7e to
6f61e83
Compare
e10372c to
1096812
Compare
| requires-python = ">=3.12" | ||
| license = "GPL-3.0-only" | ||
| license-files = ["src/wiki/COPYING", "src/django_notify/COPYING"] | ||
| authors = [ |
There was a problem hiding this comment.
@feanil FYI: this PR changes the package author from Benjamin Bach <benjamin@overtag.dk> (edx_release setup.py) to the org-standard Open edX Project <oscm@openedx.org>.
irfanuddinahmad
left a comment
There was a problem hiding this comment.
Before merging, a PyPI owner needs to add a trusted publisher for this repo with workflow release.yml. Earlier releases used an API token, so the first OIDC publish will fail without it.
| @@ -0,0 +1,84 @@ | |||
| name: Release | |||
There was a problem hiding this comment.
Please replace release.yml with sample-plugin's current release.yml, dropping only the monorepo lines (directory:, the tutor build step, the extra publish jobs, packages-dir:). The pins and logic already match, but the workflow name, step names, run: | style and comments differ; keeping it identical makes future syncs a plain diff.
…0 and Test#445 Test#180 now verifies release.yml's push branch matches the repo's actual default branch (via gh repo view) and flags the mismatch with a concrete fix instruction. Repos like django-wiki use edx_release, not master, so the standard template would silently never release. Test#445 gains a note that a dead push trigger (wrong branch name) masks the double-run bug — both tests must be fixed together when the default branch is not master. References: - openedx/platform-plugin-aspects#257 (original double-run fix) - openedx/django-wiki#329 (first non-master default branch case) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
| TOXENV: ${{ matrix.toxenv }} | ||
| run: tox | ||
| - name: Run tox | ||
| run: uv run tox -e ${{ matrix.toxenv }} |
There was a problem hiding this comment.
Please use uv run --locked tox -e ${{ matrix.toxenv }}. Without --locked, uv run silently re-locks when uv.lock is stale instead of failing. It also matches i18n-tools, codejail-includes and platform-plugin-aspects.
There was a problem hiding this comment.
We are already using --locked here
No need to use it with uv run
| ] | ||
|
|
||
| [tool.setuptools] | ||
| include-package-data = true |
There was a problem hiding this comment.
With include-package-data = true, setuptools-scm also sweeps wiki/COPYING, django_notify/COPYING, django_notify/README.md, wiki/plugins/images/static/wiki/colorbox/README.md and wiki/plugins/notifications/TODO.md into the wheel, which 3.1.2 didn't ship. Setting it to false keeps the wheel identical to 3.1.2, since package-data already covers the assets.
…0 and Test#445 Test#180 now verifies release.yml's push branch matches the repo's actual default branch (via gh repo view) and flags the mismatch with a concrete fix instruction. Repos like django-wiki use edx_release, not master, so the standard template would silently never release. Test#445 gains a note that a dead push trigger (wrong branch name) masks the double-run bug — both tests must be fixed together when the default branch is not master. References: - openedx/platform-plugin-aspects#257 (original double-run fix) - openedx/django-wiki#329 (first non-master default branch case) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
9fd3a36 to
381301b
Compare
381301b to
31d9c0e
Compare
|
@irfanuddinahmad The PR is available for the next pass. |
Move packaging to pyproject.toml with a src/ layout, uv for dependency management, and python-semantic-release for automated releases, per the Open edX Python modernization effort. Releases run from edx_release, the repo's default branch, since master has had no commits since 2014; edx_release gets its own PSR release group so merges actually publish. Non-package files are excluded from the sdist and the original package keywords are kept, preserving parity with the setup.py-built distribution. CHANGELOG.md is marked deprecated now that release notes live on GitHub Releases. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
31d9c0e to
95846bc
Compare
Important
Written with the assistance of Claude Code, human-reviewed before posting.
Modernize
django-wikiPart of openedx/public-engineering#506
Summary
openedx-django-wiki.wikianddjango_notifypackages into asrc/layout; thetestproject/wikiandtestproject/django_notifysymlinks now point to../src/*.setup.pywithpyproject.toml(PEP 621 static metadata) and setrequires-python = ">=3.12"(pyproject.toml:8);edx_releasehad nopython_requiresand already tested only on 3.12.uvwith PEP 735 dependency groups (pyproject.toml:48-75) and commituv.lock.docstox env (tox.ini:15-21) and CI job (.github/workflows/ci.yml:16).astral-sh/setup-uvand SHA-pin all actions.python-semantic-releaseand.github/workflows/release.yml(OIDC trusted publishing), releasing fromedx_release.CHANGELOG.mdas deprecated (CHANGELOG.md:1); release notes now live on GitHub Releases.Removed/Updated
Deleted files:
setup.py,requirements/,openedx.yaml(legacy OEP-2 metadata),.github/workflows/pypi-publish.yml(superseded byrelease.yml)Updated Makefile targets:
upgradeedx_lint write_uv_constraints pyproject.toml+uv lock --upgrade(Makefile:3-5)testpytest --cov wiki --cov django_notifyfromtestproject/(Makefile:7-8); called by thedjango42/django52tox envsdocsmake -C docs html(Makefile:10-11); called by thedocstox envVersioning
setuptools-scmwithdynamic = ["version"](pyproject.toml:33) andfallback_version = "0.0.0.dev0"(pyproject.toml:109).edx_releasehad a PyPI publish workflow;python-semantic-releasenow controls the version string at release time via git tags. The latest tagv3.1.2matches the latest PyPI release, so it is the release baseline.src/wiki/__init__.pyexposes__version__viaimportlib.metadata.Important Notes
edx_release, notmaster..github/workflows/release.ymltargetsedx_releasein all 3 places (push trigger at line 5,if:guards at lines 14 and 70), andpyproject.toml:103-104adds[tool.semantic_release.branches.edx_release], because PSR only releases frommain/masterby default. Without this, the release job would pass and publish nothing. Feanil agreed with this approach in chore: modernize Python repo to uv + pyproject.toml #329 (comment)..github/workflows/ci.ymldrops thepush: branches: [master]trigger.release.ymlcallsci.ymlviaworkflow_call, so a push trigger would run CI twice on every merge (see platform-plugin-aspects#257)..github/workflows/ci.ymlkeeps the workflow namePython CIfor parity.--lockedis used only onuv sync(line 31), not onuv run. There is nofetch-depth: 0, nosecrets: inheritand no Codecov step.Tests (ubuntu-latest, 3.12, djangoXY)todocs,django42anddjango52. The only required status check onedx_releaseisopenedx/cla, so no required checks are affected.pyproject.tomlmetadata matchessetup.pyexceptauthors, which uses the org-standardOpen edX Project <oscm@openedx.org>(as in openedx/sample-plugin and build: modernize Python packaging to uv + pyproject.toml (PEP 621) openedx-atlas#78) instead of Benjamin Bach. It keeps the same classifiers includingOperating System :: OS Independent, and noNatural Language/Python :: 3classifiers. TheLicense :: OSI Approved :: GNU General Public License v3 (GPLv3)classifier is dropped in favour of the PEP 639license = "GPL-3.0-only"expression (pyproject.toml:9).src/wiki/conf/settings.py(README.md:79), and the Development setup step now usesuv sync --group devinstead ofpip install -r requirements.txt(README.md:130).MANIFEST.inexcludestestproject/and repo-only files (pylintrc,catalog-info.yaml,model_chart_wiki.pdf,CHANGELOG.md,TODO.md,uv.lock) from the sdist.edx_releaseand from this branch. Withinclude-package-data = false(pyproject.toml), the PR wheel has the same files as the 3.1.2 wheel on PyPI.Requires-Distis unchanged.Out of Scope
qualityenvedx_releasenever ran pylint in tox, the Makefile or CI, so noqualityenv is added (parity).pylintrcis kept.qualityas a real gateTesting Notes
Note: PR creator has tested the PR via CI and building the packages manually. No manual testing has been done to test the repo features. It will be great if the repo owner could test it.
🤖 Generated with Claude Code