Skip to content

feat: modernize to uv + pyproject.toml (PEP 621/735)#253

Draft
farhan wants to merge 5 commits into
openedx:mainfrom
farhan:farhan/modernize-python-repo
Draft

feat: modernize to uv + pyproject.toml (PEP 621/735)#253
farhan wants to merge 5 commits into
openedx:mainfrom
farhan:farhan/modernize-python-repo

Conversation

@farhan

@farhan farhan commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Important

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

Summary

Modernize xapi-db-load 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
  • Retain pylint/isort/pycodestyle/pydocstyle/mypy as on master (ruff deferred to its own epic per #506); 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
  • Add mypy tox env and CI matrix entry (mypy was already used on master in make quality)

Removed

Deleted files: setup.py, setup.cfg, requirements/, .coveragerc, openedx.yaml (legacy, superseded by catalog-info.yaml)

Removed Makefile targets:

Target Reason
(none) All original targets preserved; upgrade was rewritten from pip-compile to uv

Not included/implemented

  • release.yml / python-semantic-release — master had no PyPI publish workflow.
  • src/ layout — package remains at the top level; repo does not publish to PyPI, so flat layout was retained for simplicity.

Versioning

[Static] version = "3.1.0" declared directly in pyproject.toml — master had no PyPI publish workflow, so setuptools-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:

  • isort config was migrated from setup.cfg [isort] to [tool.isort] in pyproject.toml; mypy config was migrated from setup.cfg [mypy] to [tool.mypy] in pyproject.toml
  • mypy was already used on master in make quality but was not in the CI matrix; it now has its own tox env (mypy) and appears in the CI matrix so CI runs it
  • docs/conf.py updated to use importlib.metadata.version instead of reading __version__ from __init__.py (removed since version ownership moves to pyproject.toml)
  • .readthedocs.yaml updated to use modern build config (ubuntu-lts-latest) and install docs optional dependencies via pip install -e .[docs]
  • [project.optional-dependencies.docs] added for ReadTheDocs compatibility (in addition to the doc dependency group used by tox)
  • Common constraints (Django<6.0, elasticsearch<7.14.0) were populated by edx_lint write_uv_constraints from the edx-lint common constraints file

🤖 Generated with Claude Code

@farhan
farhan marked this pull request as draft July 17, 2026 16:36
@farhan
farhan force-pushed the farhan/modernize-python-repo branch from c32d10d to bfffd59 Compare July 22, 2026 07:46
farhan and others added 2 commits July 22, 2026 12:55
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Required by the toctree in xapi_db_load.rst; docs build fails without them.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@farhan
farhan force-pushed the farhan/modernize-python-repo branch from 74ef3fe to b702656 Compare July 22, 2026 07:59
@farhan
farhan marked this pull request as ready for review July 22, 2026 08:00
farhan and others added 3 commits July 22, 2026 13:33
Newer sphinx_book_theme (Sphinx 9.x) no longer supports the
'logo_only' theme option, which emitted a warning. Since the docs
build runs with -W (warnings treated as errors), this failed the
docs CI check. Removing the option to match the modernized config.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Remove the >=61.0 version pin on setuptools in [build-system].requires to
match the openedx modernization reference repos, which use a bare
"setuptools" specifier. This also resolves the SPDX license-expression
concern, since a current/bare setuptools supports PEP 639 license = "AGPL-3.0-only".

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Remove `fail-fast: false` from the CI matrix strategy (omit the key so
  it defaults to `true`, matching org convention)
- Drop the newly added Codecov upload step; master had no coverage upload,
  and it introduced a hard `CODECOV_TOKEN` dependency with
  `fail_ci_if_error: true`
- Restore `warn_unused_ignores = true` (master value) and remove the two
  now-unused `# type: ignore[arg-type]` comments in ui/log_ui.py

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@farhan farhan self-assigned this Jul 22, 2026
@farhan farhan moved this to 👀 In review in Aximprovements Team Jul 22, 2026
@farhan
farhan marked this pull request as draft July 23, 2026 07:30
@farhan farhan moved this from 👀 In review to 🏗 In progress in Aximprovements Team Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🏗 In progress

Development

Successfully merging this pull request may close these issues.

1 participant