Skip to content

build: modernize forum repo to use uv, pyproject.toml, and semantic-release#283

Open
farhan wants to merge 2 commits into
openedx:masterfrom
farhan:farhan/modernize-python-repos
Open

build: modernize forum repo to use uv, pyproject.toml, and semantic-release#283
farhan wants to merge 2 commits into
openedx:masterfrom
farhan:farhan/modernize-python-repos

Conversation

@farhan

@farhan farhan commented Jul 23, 2026

Copy link
Copy Markdown

Important

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

Modernize forum
Part of openedx/public-engineering#506

Summary

  • Repo publishes to PyPI as openedx-forum
  • Move the package into a src/ layout
  • 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 as on master
  • Coverage config moved into pyproject.toml
  • Update CI to use astral-sh/setup-uv; SHA-pin all actions
  • Add python-semantic-release + release.yml (OIDC trusted publishing)

Removed/Updated

Deleted files: setup.py, setup.cfg, requirements/, .coveragerc, CHANGELOG.rst, mypy.ini, pypi-publish.yml

Removed Makefile targets:

Target Reason
compile-requirements Replaced by uv lock
piptools pip-compile toolchain removed; uv handles environment setup

Updated Makefile targets:

Target Change
requirements Now runs uv sync --group dev + uv tool install tox --with tox-uv
upgrade Now runs edx_lint write_uv_constraints + uv lock --upgrade

Versioning

setuptools-scm with dynamic = ["version"] — master had a PyPI publish workflow; python-semantic-release controls the version string at release time via git tags.

Important Notes

  • pypi-publish.yml was deleted because release.yml replaces it with OIDC trusted publishing via python-semantic-release; the old workflow used a PYPI_UPLOAD_TOKEN secret which is superseded by the OIDC approach.
  • PyPI trusted publisher (OIDC) must be configured on PyPI before merging — without it the publish_to_pypi job will fail on the first release.

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

@farhan farhan left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Review comments on the modernization PR — see individual inline threads for details.

@farhan farhan left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Addressing inline comments — see individual threads for analysis and fixes.

@farhan
farhan force-pushed the farhan/modernize-python-repos branch from 5c5ba18 to 78f6e6f Compare July 24, 2026 06:08
@farhan farhan changed the title feat: modernize forum repo to use uv, pyproject.toml, and semantic-release build: modernize forum repo to use uv, pyproject.toml, and semantic-release Jul 24, 2026
@farhan
farhan force-pushed the farhan/modernize-python-repos branch from 34a2398 to 159830c Compare July 24, 2026 06:44
- Replace setup.cfg/setup.py with pyproject.toml (PEP 621/735)
- Migrate to uv for dependency management, replacing pip-tools requirements files
- Migrate to src/ layout
- Add python-semantic-release for automated versioning and changelog
- Update CI/CD workflows for uv and semantic-release
- Update Makefile, docs, and tox config for new project structure

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@farhan
farhan force-pushed the farhan/modernize-python-repos branch from 701d1b4 to 7b56143 Compare July 24, 2026 07:40
@farhan
farhan marked this pull request as ready for review July 24, 2026 07:56
- Use uv in semantic_release build_command instead of bare pip
- Remove black from quality group (not in quality.in); belongs in ci only
- Add {include-group = "quality"} to ci group (mirroring ci.in -r quality.txt)
- Regenerate uv.lock

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@farhan farhan self-assigned this Jul 24, 2026
@farhan farhan moved this to 👀 In review in Aximprovements Team Jul 24, 2026

@irfanuddinahmad irfanuddinahmad left a comment

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.

CI passes and the migration is otherwise careful (src-layout, entry points, coverage config, and the release workflow all line up correctly, and I confirmed the docs/package/e2e jobs are genuinely green on the PR). But there's a real, undisclosed regression in the quality gate:

Makefile: test-quality used to run test-lint test-codestyle test-mypy test-format. This PR drops test-format from that list:

-test-quality: test-lint test-codestyle test-mypy test-format ## run static coverage tests
+test-quality: test-lint test-codestyle test-mypy ## run static coverage tests

test-quality is exactly what CI's quality tox env calls (make test-quality selfcheck), so black --check is no longer part of the CI quality gate — a formatting regression could now merge silently. This isn't mentioned anywhere in the PR description. Was this intentional, or a slip during the Makefile restructuring? If intentional, please call it out explicitly; if not, please restore it.

Minor, non-blocking notes:

  • The PR body doesn't mention that docs was added to the CI matrix or that Codecov integration is new — both are fine (I verified CODECOV_TOKEN already works org-wide, e.g. on the merged XBlock PR), but worth stating in the description since they're scope beyond "modernize tooling."

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