Skip to content

feat: modernize Python tooling (pyproject.toml + uv + semantic-release) - #373

Merged
feanil merged 12 commits into
openedx:masterfrom
irfanuddinahmad:irfanuddinahmad/uv-migration
Nov 3, 2026
Merged

feanil merged 12 commits into
openedx:masterfrom
irfanuddinahmad:irfanuddinahmad/uv-migration

Conversation

@irfanuddinahmad

Copy link
Copy Markdown
Contributor

Summary

Moves edx-when off pip-tools/setup.py and onto pyproject.toml, uv and python-semantic-release, following openedx/sample-plugin.

Part of openedx/public-engineering#512 (parent openedx/public-engineering#506).

  • Package metadata now lives in pyproject.toml (PEP 621, AGPL-3.0-or-later to match the old classifier). The version comes from git tags via setuptools-scm, and __version__ uses importlib.metadata. setup.py, setup.cfg and .coveragerc are removed.
  • requirements/ is replaced by dependency groups and uv.lock. Django caps live in [tool.uv].constraint-dependencies, written by edx_lint write_uv_constraints. The published Requires-Dist is unchanged from 4.1.0.
  • tox uses tox-uv with uv-venv-lock-runner. make requirements / make upgrade use uv.
  • ci.yml and migrations-checker-postgresql.yml use astral-sh/setup-uv and uv sync --locked / uv run --locked. The migrations check gets its DB drivers through uv run --with mysqlclient --with psycopg2-binary.
  • release.yml (python-semantic-release + PyPI trusted publishing) replaces the token-based pypi-publish.yml.
  • The package moves to src/edx_when.

Before merging

  • PyPI trusted publisher configured for edx-when with repository openedx/edx-when, workflow release.yml.

The latest tag v4.1.0 matches the latest PyPI release (4.1.0), so PSR will pick up from there. master already has feat: commits since then, so the first run after merge will release 4.2.0.

Testing

  • uv run --locked tox -e django42,django52,quality,docs,pii_check passes from a fresh clone (134 tests on both Django versions, same as before the migration). uv lock --check is clean, and the migrations check passes against MySQL 8.0 and Postgres.
  • The built wheel matches PyPI 4.1.0 file for file (32 files), including the migrations and templates/edx_schedule/base.html. The only difference is that LICENSE.txt/AUTHORS now sit under .dist-info/licenses/ (PEP 639). Requires-Dist and entry points are identical. twine check passes.

Reviewer notes

  • pylintrc was regenerated with edx_lint write pylintrc. The lock resolves edx-lint 6.2.0, and its new PII checker crashes pylint unless pii-terms is configured.
  • The django52 tox env used to install Django<=5.2, which resolves to 5.2.0. It now uses the test group (Django>=5.2,<6.0).
  • In ci.yml, the pip install mysqlclient psycopg2-binary lines are dropped. tox never passed DB_* through to the test env, so the tests have always run on SQLite. The db matrix and job names are kept as they were.
  • Django>=1.11 is kept as-is so the published dependency stays the same as 4.1.0.

🤖 Generated with Claude Code

@openedx-webhooks openedx-webhooks added open-source-contribution PR author is not from Axim or 2U core contributor PR author is a Core Contributor (who may or may not have write access to this repo). labels Oct 15, 2026
@openedx-webhooks

Copy link
Copy Markdown

Thanks for the pull request, @irfanuddinahmad!

This repository is currently maintained by @farhaanbukhsh.

Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review.

🔘 Get product approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.
🔘 Provide context

To help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads
🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.

Details
Where can I find more information?

If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:

When can I expect my changes to be merged?

Our goal is to get community contributions seen and reviewed as efficiently as possible.

However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

irfanuddinahmad and others added 2 commits October 22, 2026 12:00
Keep requirements/*.txt deleted; they are replaced by uv.lock.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
CHANGELOG.rst is no longer updated now that release notes go to GitHub
Releases, so stop appending it to the long description and note that at
the top of the file.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@mphilbrick211 mphilbrick211 moved this from Needs Triage to In Eng Review in Contributions Oct 22, 2026
irfanuddinahmad and others added 2 commits October 23, 2026 08:22
Keep requirements/*.txt deleted; they are replaced by uv.lock.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
An RST comment doesn't render on GitHub, so state it as a normal
paragraph under the heading, linking to GitHub Releases.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@@ -0,0 +1,117 @@
name: Semantic Release

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.github/PULL_REQUEST_TEMPLATE.md still has "Version bumped" and "Changelog record added" in the merge checklist, and "Create a tag" and the PyPI check after merge. Those should come out of the template since PSR handles the version, tag and release now.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in eb02ae6.

irfanuddinahmad and others added 3 commits October 30, 2026 07:32
Resolve uv.lock from the versions pinned in requirements/*.txt on master so this
migration doesn't change what gets installed. Upgrades come in with the first
make upgrade after this merges.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Remove the manual release steps from the PR template.
- Replace the virtualenv setup in the docs with the uv .venv flow.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
release.yml runs on every push to the default branch and calls ci.yml through
run_ci, so the push trigger in ci.yml ran every merge's CI twice. This matches
sample-plugin's ci.yml.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@feanil
feanil merged commit 5296642 into openedx:master Nov 3, 2026
16 checks passed
@github-project-automation github-project-automation Bot moved this from In Eng Review to Done in Contributions Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core contributor PR author is a Core Contributor (who may or may not have write access to this repo). open-source-contribution PR author is not from Axim or 2U

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants