Repository navigation
feat: modernize Python tooling (pyproject.toml + uv + semantic-release) - #429
Conversation
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>
|
Thanks for the pull request, @irfanuddinahmad! This repository is currently unmaintained. 🔘 Find a technical reviewerTo get help with finding a technical reviewer, reach out to the community contributions project manager for this PR:
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 approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo 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:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. DetailsWhere 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:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
…igrations Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
||
| [tool.semantic_release] | ||
| # Explicitly set the tag format (same as default). | ||
| tag_format = "v{version}" |
There was a problem hiding this comment.
We don't need to mention the tag_format
There was a problem hiding this comment.
I'd keep it. Every merged migration sets it explicitly with this comment, which is the wording feanil asked for.
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>
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
| Change Log | ||
| ---------- | ||
|
|
||
| This changelog is no longer maintained. Release notes are published only on |
There was a problem hiding this comment.
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.
| @@ -0,0 +1,117 @@ | |||
| name: Semantic Release | |||
There was a problem hiding this comment.
.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.
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>
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).
pyproject.toml(PEP 621). The version comes from git tags via setuptools-scm, and__version__reads it throughimportlib.metadata.setup.py,setup.cfgand.coveragercare removed, and their isort and coverage settings move intopyproject.tomlunchanged.requirements/,uv.lockis committed, andmake upgraderegenerates the constraints withedx_lint write_uv_constraints.tox-uvwith theuv-venv-lock-runner. CI installs withastral-sh/setup-uvand runsuv sync --locked --group cianduv 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-basedpublish_pypi.yml.src/layout.Before merging
edx-celeryutils: repositoryopenedx/edx-celeryutils, workflowrelease.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,django52passes 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 andtwine checkpasses.uv lock --checkis clean.celery_utils/management/commands/tests/no longer ship. Requires-Dist is unchanged (Django,celery<6.0,django-model-utils,jsonfield). The sdist still includesCHANGELOG.rst,README.rst,LICENSE.txtandAUTHORS.Reviewer notes
py{312}-celery{53}-django{42,52}, but CI only ever randjango42anddjango52, and those always got the latest celery allowed bycelery<6.0. Thecelery53envs only ran locally, from a hand-maintainedrequirements/celery53.txtthatmake upgradenever 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 thecelery53factor and kept the envs CI runs.include-package-data = false: the oldinclude_package_data=Trueonly mattered becauseMANIFEST.inpulled in every*pyfile, 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.py2.py3topy3becausesetup.cfg's[wheel] universal = 1is gone.docs/conf.pyhadversion/releasehard-coded to0.1.0since 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