Skip to content

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

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

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

Conversation

@irfanuddinahmad

@irfanuddinahmad irfanuddinahmad commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Moves super-csv from setup.py/pip-tools to pyproject.toml, uv and python-semantic-release.

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

  • Package metadata moved from setup.py/setup.cfg/.coveragerc into pyproject.toml. The version now comes from setuptools-scm, and __version__ and docs/conf.py read it through importlib.metadata.
  • requirements/ replaced by dependency groups and uv.lock. The old tox factors carry over: django52 maps to test, and celery53 and drflatest get their own groups, so CI still runs django52-celery53-drflatest. The repo-specific celery>=5.2.2,<6.0.0 pin moved to [tool.edx_lint].uv_constraints.
  • tox now uses tox-uv (uv-venv-lock-runner). CI installs with astral-sh/setup-uv, runs uv sync --locked --group ci and uv run --locked tox, and gains a workflow_call trigger. The job name and matrix are unchanged.
  • pypi-publish.yml (token-based) replaced by release.yml, copied from sample-plugin. It uses PSR with changelog: "false", creates the GitHub release with gh release create, and publishes to PyPI with OIDC.
  • Package moved to src/super_csv, with the tox, Makefile, docs, .tx/config, test_settings.py, MANIFEST.in and README paths updated to match.

Before merging

  • PyPI trusted publisher configured for super-csv: repository openedx/super-csv, workflow release.yml.
  • The latest tag, v5.0.0, already matches PyPI 5.0.0. tag_format = "v{version}" is set explicitly, the same as python-semantic-release's default.

Testing

  • uv run --locked tox -e django52-celery53-drflatest,quality,docs,pii_check passes locally: 21 tests, the same count as master, and coverage is unchanged at 85%. uv lock --check passes.
  • The wheel matches PyPI 5.0.0 file-for-file (22 files, including migrations and the template), and Requires-Dist is identical. The intended metadata changes are:
    • Author is now Open edX Project.
    • License-Expression: Apache-2.0 replaces the license classifier.
    • Requires-Python: >=3.12 is added.
    • The wheel tag is py3 instead of py2.py3.
  • twine check passes on both dists. The sdist still ships CHANGELOG.rst, README.rst and LICENSE.txt.

Reviewer notes

  • uv.lock is seeded with master's requirements/*.txt pins instead of a fresh resolve, so nothing that gets installed changes, edx-lint included (6.1.0). pylintrc is regenerated with that edx-lint 6.1.0 (edx_lint write pylintrc); master's copy was generated by 5.6.0.
  • The long description is now README only. CHANGELOG.rst gets a note pointing to GitHub Releases and still ships in the sdist.

🤖 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 @angonz.

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.

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 do not need to set the version format explicitly.

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.

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 26, 2026 15:22
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]>
# Conflicts:
#	.github/workflows/ci.yml
#	.github/workflows/pypi-publish.yml
@@ -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 be494c5.

Comment thread pylintrc Outdated
#
# ------------------------------
# Generated by edx-lint version: 5.6.0
# Generated by edx-lint version: 6.2.0

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.

7e3243c took the lock back to edx-lint 6.1.0 but this file is still the 6.2.0 output, so the [PII] section is config for a checker that isn't installed and the description still says the lock upgrades edx-lint to 6.2.0. Which version did you mean to land? If it's 6.1.0 then regenerate this file with it and update the description.

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.

6.1.0, master's pin. Regenerated pylintrc with it in 713e4b7 and fixed the description.

Comment thread README.rst

#. Setup dev environment (since virtual environments are recommended for python development, here is an example of using
virtualenv. Other tools would work as well). By default, edx containers come with virtualenv preinstalled ::
#. Setup dev environment. ``make requirements`` uses `uv <https://docs.astral.sh/uv/>`_ to create a ``.venv``

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.

nit: On a merge-commit repo every commit here is a line in the 5.1.0 release notes, so be494c5 shows up under Bug Fixes as "address review feedback" and 7e3243c as a fix when it's a build change. Re-type them as a docs: and a build: commit with subjects that say what changed, eg. docs: describe the uv .venv setup and drop the manual release steps.

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.

Retyped: be494c5 is now 98e1bdf docs: describe the uv .venv setup and drop the manual release steps, and the lock commit is build: (713e4b7).

irfanuddinahmad and others added 3 commits November 4, 2026 18:01
…dx-lint 6.1.0

Resolve uv.lock from the versions pinned in requirements/*.txt on master so this
migration doesn't change what gets installed, which keeps edx-lint at master's
6.1.0. Regenerate pylintrc with that version so it no longer configures the 6.2.0
PII checker. Upgrades come in with the first make upgrade after this merges.

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

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. The README CI badge now points at release.yml, since
ci.yml no longer runs on master.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@irfanuddinahmad
irfanuddinahmad force-pushed the irfanuddinahmad/uv-migration branch from 8af5d87 to 8da6249 Compare November 4, 2026 13:01
@feanil
feanil merged commit d3f9a64 into openedx:master Nov 5, 2026
8 checks passed
@github-project-automation github-project-automation Bot moved this from In Eng Review to Done in Contributions Nov 5, 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