feat: modernize repo to use uv, pyproject.toml, and semantic-release#280
Open
farhan wants to merge 1 commit into
Open
feat: modernize repo to use uv, pyproject.toml, and semantic-release#280farhan wants to merge 1 commit into
farhan wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR modernizes the repository’s Python packaging, dependency management, and automation by migrating to pyproject.toml + uv and updating CI/release workflows accordingly. It also applies broad formatting/typing cleanups consistent with the new Ruff-based toolchain.
Changes:
- Migrates packaging metadata and tool configuration into
pyproject.toml(PEP 621) and replacesrequirements/*.in|*.txtwithuv.lock+ dependency groups. - Updates
tox.ini, Makefile, and GitHub Actions workflows to run viauv(and adds semantic-release driven publishing). - Applies widespread Ruff-formatting and typing updates across application code and tests.
Reviewed changes
Copilot reviewed 95 out of 96 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tox.ini | Switch tox to tox-uv/uv runner and define envs for tests/quality/docs/e2e. |
| pyproject.toml | New central project metadata, dependency groups, and tool configs (ruff/pytest/coverage/semantic-release). |
| Makefile | Replaces pip-tools workflows with uv-based sync/lock/quality/docs/test targets. |
| .github/workflows/ci.yml | CI updated to install uv, sync ci group, and run tox envs. |
| .github/workflows/release.yml | Adds semantic-release workflow chaining CI, creating GitHub releases, and publishing to PyPI via OIDC. |
| .github/workflows/pypi-publish.yml | Removes legacy PyPI publish workflow. |
| CHANGELOG.rst | Replaced changelog contents with semantic-release/GitHub Releases pointer. |
| .coveragerc | Removes legacy coverage config (moved to pyproject.toml). |
| setup.py | Removes legacy setuptools packaging file. |
| setup.cfg | Removes legacy tool config (e.g., isort/wheel). |
| pylintrc | Removes legacy pylint config. |
| pylintrc_tweaks | Removes legacy pylint tweaks. |
| requirements/base.in | Removed (replaced by pyproject.toml deps). |
| requirements/base.txt | Removed (replaced by uv.lock). |
| requirements/test.in | Removed (replaced by dependency groups). |
| requirements/test.txt | Removed (replaced by uv.lock). |
| requirements/quality.in | Removed (replaced by dependency groups). |
| requirements/doc.in | Removed (replaced by dependency groups). |
| requirements/ci.in | Removed (replaced by dependency groups). |
| requirements/dev.in | Removed (replaced by dependency groups). |
| requirements/constraints.txt | Removed (constraints approach replaced by uv constraints handling). |
| requirements/pip.in | Removed (no longer pinning pip tooling via requirements). |
| requirements/pip.txt | Removed. |
| requirements/pip-tools.in | Removed. |
| requirements/pip-tools.txt | Removed. |
| requirements/private.readme | Removed (legacy private requirements workflow). |
| forum/apps.py | AppConfig modified (startup behavior impacted). |
| forum/utils.py | Typing import cleanup and minor formatting. |
| forum/settings/common.py | Minor formatting in settings initialization. |
| forum/views/votes.py | Formatting-only changes. |
| forum/views/users.py | Formatting-only changes. |
| forum/views/pins.py | Formatting-only changes. |
| forum/views/flags.py | Formatting-only changes. |
| forum/views/comments.py | Import order adjustment. |
| forum/serializers/users.py | Formatting-only changes. |
| forum/serializers/thread.py | Type-hint modernization + formatting. |
| forum/serializers/contents.py | Formatting-only changes. |
| forum/search/base.py | Type-hint modernization + formatting. |
| forum/search/init.py | Formatting-only changes. |
| forum/search/es.py | Type-hint modernization + formatting. |
| forum/search/meilisearch.py | Type-hint modernization + formatting. |
| forum/search/typesense.py | Type-hint modernization + formatting; minor logic reshaping for readability. |
| forum/pagination.py | Formatting-only changes. |
| forum/mongo.py | Type-hint modernization + formatting. |
| forum/migration_helpers.py | Import ordering + formatting-only changes. |
| forum/management/commands/rebuild_forum_indices.py | Formatting-only changes. |
| forum/management/commands/forum_migrate_course_from_mongodb_to_mysql.py | Import consolidation + formatting-only changes. |
| forum/management/commands/forum_delete_course_from_mongodb.py | Formatting-only changes. |
| forum/management/commands/delete_unused_forum_indices.py | Formatting-only changes. |
| forum/api/votes.py | Type-hint modernization + formatting-only changes. |
| forum/api/users.py | Type-hint modernization + formatting-only changes (but includes a functional bug in error message). |
| forum/api/threads.py | Type-hint modernization + formatting-only changes. |
| forum/api/subscriptions.py | Type-hint modernization + formatting-only changes. |
| forum/api/search.py | Type-hint modernization + formatting-only changes. |
| forum/api/pins.py | Type-hint modernization + formatting-only changes. |
| forum/api/flags.py | Type-hint modernization + formatting-only changes. |
| forum/api/comments.py | Type-hint modernization + formatting-only changes. |
| forum/handlers.py | Import order and formatting-only changes. |
| forum/admin.py | Import reordering/formatting-only changes. |
| forum/backends/backend.py | Type-hint modernization + formatting-only changes. |
| forum/backends/mysql/init.py | Import ordering/formatting-only changes. |
| forum/migrations/0001_initial.py | Formatting-only changes in generated migration. |
| forum/migrations/0002_alter_readstate_course_id_and_more.py | Import ordering/formatting-only changes in generated migration. |
| forum/migrations/0003_alter_commentthread_title.py | Formatting-only changes. |
| forum/migrations/0004_add_author_username_fields.py | Formatting-only changes. |
| forum/migrations/0005_alter_commentthread_pinned.py | Formatting-only changes. |
| docs/conf.py | Formatting and minor config adjustments. |
| docs/references/v2_python_native_apis_responses.rst | Normalizes example JSON literals (true/false/null) in docs. |
| tests/conftest.py | Import/type-hint modernization and ordering. |
| test_utils/client.py | Formatting-only changes. |
| test_utils/mock_es_backend.py | Formatting-only changes. |
| tests/test_settings.py | Formatting-only changes. |
| tests/test_typesense.py | Import ordering + formatting-only changes. |
| tests/test_meilisearch.py | Import ordering + formatting-only changes. |
| tests/test_backends/test_mysql/test_api.py | Formatting-only changes. |
| tests/test_management/test_commands/test_migration_commands.py | Import ordering + formatting-only changes. |
| tests/test_views/test_votes.py | Formatting-only changes. |
| tests/test_views/test_users.py | Formatting-only changes. |
| tests/test_views/test_threads.py | Type-hint modernization + formatting-only changes. |
| tests/test_views/test_subscriptions.py | Formatting-only changes. |
| tests/test_views/test_search.py | Type-hint modernization + formatting-only changes. |
| tests/test_views/test_pins.py | Formatting-only changes. |
| tests/test_views/test_flags.py | Minor idiomatic set literal + formatting-only changes. |
| tests/test_views/test_comments.py | Formatting-only changes. |
| tests/test_views/test_commentables.py | Import ordering + formatting-only changes. |
| tests/e2e/test_users.py | Type-hint modernization + formatting-only changes. |
| tests/e2e/test_search_meilisearch.py | Import ordering + formatting-only changes. |
| tests/e2e/test_search_es.py | Type-hint modernization + formatting-only changes. |
Comments suppressed due to low confidence (1)
forum/apps.py:36
ForumConfig.ready()no longer importsforum.signals, so the module-levelSignal()objects and their.connect(...)calls may never run during app startup. This can break signal-based behavior unless some other code importsforum.signalsearly enough.
def ready(self) -> None:
"""
Import Signals.
"""
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
9a103b8 to
5693a27
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 101 out of 102 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
forum/apps.py:36
ForumConfig.ready()no longer importsforum.signals. Sinceforum/signals.pyis the only place that importsforum.handlersand connects the custom signals, this change prevents the handlers/signals from being registered at app startup, which can break search-index updates and any code relying on these signals.
def ready(self) -> None:
"""
Import Signals.
"""
c027a19 to
3f2f04a
Compare
- Migrate package metadata from setup.py/setup.cfg to pyproject.toml (PEP 621/735) - Switch dependency management from pip-tools to uv with dependency groups - Replace pylint/pycodestyle/pydocstyle/isort/black with ruff - Move coverage config from .coveragerc into pyproject.toml - Rewrite tox.ini to use uv-venv-lock-runner with dependency_groups - Update Makefile for uv-based workflow - Replace old CI workflow with uv-based matrix using astral-sh/setup-uv - Add python-semantic-release workflow for automated versioning and PyPI publishing - Generate uv.lock lockfile - Delete requirements/, setup.py, setup.cfg, CHANGELOG.rst, .coveragerc, pylintrc* Ref: openedx/public-engineering#506 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
f8c5eba to
809850a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Important
PR implemented with the assistance of Claude Code, human-reviewed and improved before pushing to code review.
Summary
Modernize
forumto uv + pyproject.toml (PEP 621/735) + python-semantic-release.Part of openedx/public-engineering#506.
setup.py/setup.cfgwithpyproject.toml(PEP 621 static metadata)uvwith PEP 735 dependency groups; commituv.lockruff(check + format); mypy config moved intopyproject.toml; coverage config moved intopyproject.tomltox.inito usetox-uvwithuv-venv-lock-runnerastral-sh/setup-uv; SHA-pin all actions; addworkflow_calltriggerpython-semantic-release+release.yml; replace oldpypi-publish.ymlRemoved
Deleted files:
setup.py,setup.cfg,requirements/,.coveragerc,pylintrc,pylintrc_tweaks,CHANGELOG.rst,mypy.iniRemoved Makefile targets:
clean_toxtox-uv; manual tox cache cleaning no longer neededcompile-requirementsuv+uv.lockpiptoolstest-alltox/ CI matrixtest-qualitylinttargettest-lintlinttargettest-codestylelinttargettest-isortlinttargettest-mypymypytargettest-formatformattargetNot included
e2etests excluded from CI matrix: Thee2etox environment requires Docker and is not suitable for the standard GitHub Actions runner. It has been removed from the CI matrix (.github/workflows/ci.yml) but the env is still defined intox.iniand can be run locally viamake test-e2eortox -e e2e.Versioning
[Dynamic]
setuptools-scmwithdynamic = ["version"]— master had a PyPI publish workflow (pypi-publish.yml);python-semantic-releasecontrols the version string at release time via git tags.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:
pyproject.tomldependency groups — verify that all runtime and optional dependencies from the oldrequirements/*.infiles are faithfully carried over, and that no transitive constraint fromrequirements/constraints.txtwas silently dropped.🤖 Generated with Claude Code