Skip to content

build: Modernize xapi-db-load: migrate to uv, pyproject.toml, PEP 735 dependency groups#258

Open
farhan wants to merge 1 commit into
openedx:mainfrom
farhan:farhan/modernize-python-repos
Open

build: Modernize xapi-db-load: migrate to uv, pyproject.toml, PEP 735 dependency groups#258
farhan wants to merge 1 commit into
openedx:mainfrom
farhan:farhan/modernize-python-repos

Conversation

@farhan

@farhan farhan commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Important

PR implemented with the assistance of Claude Code. Refined and validated before being submitted for code review.

Modernize `xapi-db-load`
Part of openedx/public-engineering#506

Summary

  • 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.
  • Coverage config moved into `pyproject.toml`
  • Update CI to use `astral-sh/setup-uv`; SHA-pin all actions

Removed/Updated

Deleted files: `setup.py`, `setup.cfg`, `requirements/`, `.coveragerc`, `codecov.yml`

Updated Makefile targets:

Target Change
`upgrade` Replaced pip-compile workflow with `uv run edx_lint write_uv_constraints` + `uv lock --upgrade`
`requirements` Replaced pip-sync with `uv sync --group dev` + `uv tool install tox --with tox-uv`
`quality` Removed `*.py` glob from linter commands (`setup.py` was the only root-level `.py` file; glob would expand to nothing after deletion); replaced `python setup.py bdist_wheel` with `uv run python -m build`

Versioning

`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.

Important Notes

  • This repo does not publish to PyPI, so `src/` layout was not adopted.
  • This repo has no PyPI publish workflow on master, so `python-semantic-release` and `release.yml` were not added.
  • `codecov.yml` was deleted because it contained a hardcoded 74 % patch-coverage target that is not enforced by any current CI gate; Codecov config can be re-added with deliberate thresholds if desired.

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.


🤖 Generated with Claude Code

@codecov

codecov Bot commented Jul 23, 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 ☂️

@farhan
farhan force-pushed the farhan/modernize-python-repos branch from 1cd60ea to fe06549 Compare July 23, 2026 17:11
@farhan farhan self-assigned this Jul 23, 2026
@farhan farhan moved this to 👀 In review in Aximprovements Team Jul 23, 2026
@farhan
farhan marked this pull request as ready for review July 23, 2026 17:21
@farhan farhan moved this to 👀 In review in Aximprovements Team Jul 24, 2026
- 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
- Update tox.ini to use tox-uv>=1 and uv-venv-lock-runner
- Update CI to use astral-sh/setup-uv; SHA-pin all actions
- Migrate .coveragerc config into pyproject.toml
- Update Makefile: upgrade → uv lock --upgrade; requirements → uv sync
- Remove requirements/ directory and stale config files
- Retain pylint/isort/pycodestyle/pydocstyle/mypy as quality linters
- Add static version = "3.1.0", replace hardcoded __version__ with importlib.metadata
- Remove setuptools-scm, dynamic version, and redundant base dependency group
- Fix sdist: include xapi_db_load/tests, prune example_configs/logs/private_configs
- Remove deprecated license classifier superseded by PEP 639
- Remove codecov.yml with invented patch coverage threshold
- Add doc8 to doc dependency group, remove twine duplicate

Part of openedx/public-engineering#506

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@farhan
farhan force-pushed the farhan/modernize-python-repos branch from fe06549 to 48832c3 Compare July 24, 2026 11:39
@farhan farhan changed the title feat: Modernize xapi-db-load: migrate to uv, pyproject.toml, PEP 735 dependency groups build: Modernize xapi-db-load: migrate to uv, pyproject.toml, PEP 735 dependency groups Jul 24, 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.

Solid migration overall — dependency list matches 1:1 with the old requirements/base.in, version handling is consistent, and I also want to flag a nice incidental fix: MANIFEST.in's recursive-include xapi-db-load ... (hyphen — never matched the real xapi_db_load package dir) is corrected to the underscore form. Worth a line in the PR description since it's a real behavior change, not just tooling.

One gap worth closing before merge:

tox.ini's envlist gains docs and quality (envlist = py312, docs, quality), and both env definitions are correctly wired to dependency_groups. But .github/workflows/ci.yml's matrix still only runs toxenv: [py]. So make quality (pylint/pycodestyle/pydocstyle/mypy/isort) and the docs build still never run in CI — same gap as before this PR, but now that the scaffolding exists, it'd be low-cost to close it. forum#283 (same author, same day) does add quality/docs to its CI matrix — worth matching that here for consistency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 👀 In review

Development

Successfully merging this pull request may close these issues.

2 participants