Skip to content

feat: modernize repo to use uv and pyproject.toml (PEP 621/735) - #40

Closed
farhan wants to merge 4 commits into
openedx:mainfrom
farhan:farhan/modernize-repo
Closed

feat: modernize repo to use uv and pyproject.toml (PEP 621/735)#40
farhan wants to merge 4 commits into
openedx:mainfrom
farhan:farhan/modernize-repo

Conversation

@farhan

@farhan farhan commented Jul 7, 2026

Copy link
Copy Markdown

Important

PR implemented with the assistance of Claude Code, human-reviewed and improved before pushing to code review.

Summary

Modernize openedx-webhooks-data-schema to uv + pyproject.toml (PEP 621/735).

Part of openedx/public-engineering#506.

  • Replace setup.py/setup.cfg with pyproject.toml (PEP 621 static metadata)
  • Switch from pip-compile to uv with PEP 735 dependency groups; commit uv.lock
  • Replace pylint/isort/pycodestyle with ruff (check + format); coverage config moved into pyproject.toml
  • Update tox.ini to use tox-uv with uv-venv-lock-runner
  • Update CI to use astral-sh/setup-uv; SHA-pin all actions; add workflow_call trigger
  • Drop Python 3.11 support; set requires-python = ">=3.12"

Removed

Deleted files: setup.py, setup.cfg, CHANGELOG.rst, pylintrc, pylintrc_tweaks, requirements/

Removed Makefile targets:

Target Reason
quality Replaced by lint (ruff check) and format (ruff format + ruff check --fix) targets

Not included

release.yml / python-semantic-release — master had no PyPI publish workflow, so automated releasing was not added.

Python 3.11 dropped

Python 3.11 reached end-of-life on 2026-10-31 and Open edX dropped it platform-wide. Removed from the tox envlist, CI matrix, and classifiers.

Versioning

[Static] version = "2.0" declared directly in pyproject.tomlsetuptools-scm is not used and the version is bumped manually on each release tag.

Testing Notes

This PR has not been manually tested against the repo's own features. Testing relied on CI checks and local agent tooling (make requirements, make lint, make test, python -m build). Repo-owner is encouraged to run the repo's feature tests before merging.

Code reviewer notes:

  • The upgrade target is kept but reimplemented: it now calls edx_lint write_uv_constraints to regenerate uv constraints in pyproject.toml, then runs uv lock --upgrade — the old pip-compile workflow is gone.
  • No .coveragerc file existed on main; coverage config is now inline in pyproject.toml under [tool.coverage].
  • CHANGELOG.rst is deleted — semantic-release was not added (see "Not included"), so changelog generation is deferred to a future step if/when the repo opts into PyPI publishing.
  • Pay close attention to the pyproject.toml dependency groups and uv.lock to ensure all previously pinned transitive dependencies are still captured correctly, particularly the edx-lint constraint injection via write_uv_constraints.

🤖 Generated with Claude Code


The non-ruff modernization work has been extracted into a focused PR per the decision in the main story (public-engineering#506):

This PR retains the ruff adoption and can be rebased onto farhan/modernize-python-repo once that lands, to serve as the ruff epic PR.

@codecov

codecov Bot commented Jul 7, 2026

Copy link
Copy Markdown

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR modernizes the repository’s Python packaging, dependency management, linting, and CI/CD by migrating to pyproject.toml/PEP 621+735, adopting uv + tox-uv, switching linting to ruff, and adding automated releases via python-semantic-release.

Changes:

  • Replaced legacy setup.py/requirements *.in/*.txt workflow with pyproject.toml dependency groups and uv.lock, plus tox-uv-based tox environments.
  • Updated developer workflows (Makefile, tox.ini) and CI (.github/workflows/ci.yml) to run via uv and ruff.
  • Added release automation (.github/workflows/release.yml) and basic Sphinx docs scaffolding under docs/.

Reviewed changes

Copilot reviewed 35 out of 36 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tox.ini New tox configuration using tox-uv runners and dependency groups.
tests/test_schema.py Formatting-only updates (parametrize layout, import style).
setup.py Removed legacy setuptools packaging script.
setup.cfg Removed legacy isort/pycodestyle/wheel config.
requirements/test.txt Removed pip-compile generated pins for tests.
requirements/test.in Removed pip-compile input for tests.
requirements/quality.txt Removed pip-compile generated pins for quality tooling.
requirements/quality.in Removed pip-compile input for quality tooling.
requirements/private.readme Removed pip-sync private requirements guidance (pip-tools era).
requirements/pip.txt Removed pip-compile generated pins for pip/setuptools/wheel.
requirements/pip.in Removed pip-compile input for pip/setuptools/wheel.
requirements/pip-tools.txt Removed pip-compile generated pins for pip-tools.
requirements/pip-tools.in Removed pip-compile input for pip-tools.
requirements/doc.txt Removed pip-compile generated pins for docs tooling.
requirements/doc.in Removed pip-compile input for docs tooling.
requirements/dev.txt Removed pip-compile generated pins for dev tooling.
requirements/dev.in Removed pip-compile input for dev tooling.
requirements/constraints.txt Removed legacy constraints indirection.
requirements/common_constraints.txt Removed shared pip constraints file (pip-tools era).
requirements/ci.txt Removed pip-compile generated pins for CI tooling.
requirements/ci.in Removed pip-compile input for CI tooling.
requirements/base.txt Removed pip-compile generated pins for base deps.
requirements/base.in Removed pip-compile input for base deps.
repo_tools_data_schema/repo_tools_data_schema.py Small refactors/formatting and improved assertion raising.
repo_tools_data_schema/init.py Formatting + re-export pattern changes (currently introduces issues; see comments).
pyproject.toml New canonical project metadata, dependency groups, ruff/pytest/coverage config, setuptools-scm, semantic-release config.
pylintrc_tweaks Removed pylint configuration tweaks (moving off pylint).
pylintrc Removed generated pylint configuration (moving off pylint).
MANIFEST.in Removed explicit manifest (setuptools config now in pyproject.toml).
Makefile Reworked dev commands around uv, tox, and ruff.
docs/Makefile Added minimal Sphinx Makefile for docs builds.
docs/index.rst Added initial Sphinx index page.
docs/conf.py Added Sphinx configuration.
.github/workflows/release.yml Added release workflow with semantic-release + PyPI publish.
.github/workflows/ci.yml Added CI workflow using setup-uv and uv run tox.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread repo_tools_data_schema/__init__.py Outdated
Comment thread docs/conf.py
Comment thread .github/workflows/release.yml Outdated
Comment thread docs/index.rst
- Consolidated package metadata into pyproject.toml (PEP 621/735),
  replacing setup.py and setup.cfg
- Switched dependency management from pip-compile to uv with PEP 735
  dependency groups and uv.lock
- Added python-semantic-release for automated versioning and PyPI
  publishing via OIDC
- Replaced pylint/isort/pycodestyle with ruff; coverage config moved
  into pyproject.toml
- Updated CI with ci.yml using astral-sh/setup-uv and uv run tox;
  added release.yml for automated releases
- Deleted legacy files: setup.py, setup.cfg, MANIFEST.in, pylintrc,
  pylintrc_tweaks, requirements/

Closes openedx/public-engineering#506

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@farhan
farhan force-pushed the farhan/modernize-repo branch from 2a8c1df to 90a294e Compare July 10, 2026 11:37
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@farhan
farhan marked this pull request as ready for review July 10, 2026 11:53
Add [tool.edx_lint].uv_constraints = [] and run
edx_lint write_uv_constraints to populate
[tool.uv].constraint-dependencies with the common edx-lint
constraints (Django<6.0, elasticsearch<7.14.0). Regenerate
uv.lock to reflect the applied constraints.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@farhan farhan moved this to 👀 In review in Aximprovements Team Jul 13, 2026
@farhan farhan changed the title feat: modernize repo to use uv, pyproject.toml, and semantic-release feat: modernize repo to use uv and pyproject.toml (PEP 621/735) Jul 13, 2026
@farhan farhan self-assigned this Jul 13, 2026

@irfanuddinahmad irfanuddinahmad left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM

Remove setuptools-scm (PyPI-repo pattern) and replace with a static
version = "2.0" field in [project], matching master's __version__.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@farhan

farhan commented Jul 15, 2026

Copy link
Copy Markdown
Author

Closing on account of #41

@farhan farhan closed this Jul 15, 2026
@github-project-automation github-project-automation Bot moved this from 👀 In review to ✅ Done in Aximprovements Team Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

3 participants