Skip to content

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

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

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

Conversation

@irfanuddinahmad

@irfanuddinahmad irfanuddinahmad commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Moves edx-celeryutils from setup.py and pip-tools to pyproject.toml, uv and python-semantic-release.

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

  • Package metadata now lives in pyproject.toml (PEP 621). The version comes from git tags via setuptools-scm, and __version__ reads it through importlib.metadata. setup.py, setup.cfg and .coveragerc are removed, and their isort and coverage settings move into pyproject.toml unchanged.
  • Dependencies are managed with uv: dependency groups replace requirements/, uv.lock is committed, and make upgrade regenerates the constraints with edx_lint write_uv_constraints.
  • tox uses tox-uv with the uv-venv-lock-runner. CI installs with astral-sh/setup-uv and runs uv sync --locked --group ci and uv run --locked tox. The job names (tests (ubuntu-latest, 3.12, <toxenv>)) are the same as before.
  • release.yml (copied from openedx/sample-plugin) publishes to PyPI through trusted publishing. It replaces the token-based publish_pypi.yml.
  • The package moves to a src/ layout.
  • The PyPI long description is now README only. CHANGELOG.rst is no longer updated (release notes go to GitHub Releases) and gets a note saying so; it still ships in the sdist.

Before merging

  • Configure a PyPI trusted publisher for edx-celeryutils: repository openedx/edx-celeryutils, workflow release.yml.

The latest tag, v2.0.0, matches the latest PyPI release (2.0.0). tag_format = "v{version}" is set explicitly, the same as python-semantic-release's default.

Testing

  • uv run --locked tox -e quality,docs,django42,django52 passes locally: 16 tests on Django 4.2.30 and 5.2.18 (same count as master's CI), quality is clean, the docs build succeeds and twine check passes. uv lock --check is clean.
  • The built wheel matches the PyPI 2.0.0 wheel file for file, except that the three files in celery_utils/management/commands/tests/ no longer ship. Requires-Dist is unchanged (Django, celery<6.0, django-model-utils, jsonfield). The sdist still includes CHANGELOG.rst, README.rst, LICENSE.txt and AUTHORS.

Reviewer notes

  • The tox envlist was py{312}-celery{53}-django{42,52}, but CI only ever ran django42 and django52, and those always got the latest celery allowed by celery<6.0. The celery53 envs only ran locally, from a hand-maintained requirements/celery53.txt that make upgrade never refreshed. A second celery pin can't be expressed as a uv dependency group alongside the Django matrix without a much larger conflict matrix, so I dropped the celery53 factor and kept the envs CI runs.
  • include-package-data = false: the old include_package_data=True only mattered because MANIFEST.in pulled in every *py file, which is how the management-command tests ended up in the wheel. The package has no non-Python data files, so the wheel is otherwise identical.
  • The wheel tag changes from py2.py3 to py3 because setup.cfg's [wheel] universal = 1 is gone.
  • docs/conf.py had version/release hard-coded to 0.1.0 since the docs were created, while the package is at 2.0.0. It now reads the version from package metadata, like __version__ and the other repos' conf.py, so the docs show 2.0.0 and follow the tags from here on.

🤖 Generated with Claude Code

irfanuddinahmad and others added 5 commits October 15, 2026 15:43
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@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 unmaintained.

🔘 Find a technical reviewer To get help with finding a technical reviewer, reach out to the community contributions project manager for this PR:
  1. On the right-hand side of the PR, find the Contributions project, click the caret in the top right corner to expand it, and check the "Primary PM" field for the name of your project manager.
  2. Find their GitHub handle here.

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 15, 2026 17:26
…igrations

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@salman2013
salman2013 self-requested a review October 20, 2026 15:13
Comment thread pyproject.toml

[tool.semantic_release]
# Explicitly set the tag format (same as default).
tag_format = "v{version}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

We don't need to mention the tag_format

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.

I'd keep it. Every merged migration sets it explicitly with this comment, which is the wording feanil asked for.

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 <noreply@anthropic.com>
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 <noreply@anthropic.com>
@mphilbrick211 mphilbrick211 moved this from Needs Triage to In Eng Review in Contributions Oct 22, 2026
irfanuddinahmad and others added 3 commits October 23, 2026 08:22
Keep requirements/*.txt deleted; they are replaced by uv.lock.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 <noreply@anthropic.com>
# Conflicts:
#	.github/workflows/ci.yml
#	.github/workflows/publish_pypi.yml
Comment thread CHANGELOG.rst
Change Log
----------

This changelog is no longer maintained. Release notes are published only on

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.

The "Publishing a Release" section in README.rst still says to tag by hand, that Travis does the release, and not to create a GitHub Release, which contradicts this note. The README is now the whole PyPI description so that text will show up there too. Update the section to say that merges to master are released automatically by python-semantic-release based on the conventional commit types, with release notes on the GitHub Releases page.

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 01c577c.

@@ -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 01c577c.

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 <noreply@anthropic.com>
- Replace the manual tag/Travis release section in README.rst with the automatic release.
- Replace the virtualenv setup in the docs with the uv .venv flow.
- Remove the manual release steps from the PR template.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 <noreply@anthropic.com>
@feanil
feanil merged commit 89341a2 into openedx:master Nov 6, 2026
8 checks passed
@github-project-automation github-project-automation Bot moved this from In Eng Review to Done in Contributions Nov 6, 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