feat: modernize repo to use uv and pyproject.toml#436
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #436 +/- ##
===========================================
- Coverage 89.84% 78.17% -11.68%
===========================================
Files 38 19 -19
Lines 3103 1356 -1747
Branches 239 167 -72
===========================================
- Hits 2788 1060 -1728
+ Misses 281 271 -10
+ Partials 34 25 -9
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR modernizes the Python packaging, dependency management, linting, CI, and release automation for openedx-webhooks by migrating to pyproject.toml + uv dependency groups/lockfile patterns and introducing semantic-release-driven publishing.
Changes:
- Migrates packaging metadata from
setup.py/setup.cfg+requirements/*.in|.txttopyproject.tomldependency groups anduvworkflows (incl.tox-uv). - Replaces pylint/isort/pycodestyle with
ruffand updates test/lint/docs automation (Makefile, tox, CI). - Adds GitHub Actions release workflow using python-semantic-release and OIDC-based PyPI publishing.
Reviewed changes
Copilot reviewed 60 out of 63 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tox.ini | Adds tox configuration using tox-uv runners and dependency groups. |
| tests/test_utils.py | Formatting/ruff-driven style updates in tests. |
| tests/test_rescan.py | Formatting/ruff-driven style updates in tests. |
| tests/test_pull_request_opened.py | Formatting/ruff-driven style updates in tests. |
| tests/test_pull_request_closed.py | Formatting/ruff-driven style updates in tests. |
| tests/test_pr_comments.py | Import ordering/formatting changes in tests. |
| tests/test_info.py | Formatting/import ordering changes in tests. |
| tests/test_helpers.py | Formatting + minor idiomatic set-comprehension change in tests. |
| tests/test_gh_projects.py | Formatting/quote style normalization in tests. |
| tests/test_faker.py | Formatting/spacing tweaks in tests. |
| tests/test_fake_jira.py | Formatting/spacing tweaks in tests. |
| tests/test_fake_github.py | Formatting/parametrize style tweaks in tests. |
| tests/helpers.py | Type-hint spacing and comment alignment tweaks. |
| tests/faker.py | Formatting + raw f-string prefix tweak. |
| tests/fake_jira.py | Modernizes typing syntax (PEP 604/585) and formatting. |
| tests/fake_github.py | Modernizes typing syntax (PEP 604/585) and formatting. |
| tests/conftest.py | Modernizes typing syntax (PEP 585) and formatting. |
| setup.py | Removes legacy setuptools build script (migrated to pyproject.toml). |
| setup.cfg | Removes legacy tool configuration (migrated to pyproject.toml). |
| requirements/test.txt | Removes pip-compile generated pinned requirements (migrated to uv). |
| requirements/test.in | Removes pip-compile input requirements (migrated to uv groups). |
| requirements/private.readme | Removes pip-tools private requirements guidance (no longer used). |
| requirements/pip.txt | Removes pip-tools bootstrap pins (no longer used). |
| requirements/pip.in | Removes pip-tools bootstrap inputs (no longer used). |
| requirements/pip-tools.txt | Removes pip-tools pins (no longer used). |
| requirements/pip-tools.in | Removes pip-tools inputs (no longer used). |
| requirements/doc.txt | Replaces pip-compile export with uv export output. |
| requirements/doc.in | Removes pip-compile doc inputs (migrated to uv groups). |
| requirements/dev.txt | Removes pip-compile dev pins (migrated to uv groups). |
| requirements/dev.in | Removes pip-compile dev inputs (migrated to uv groups). |
| requirements/constraints.txt | Removes pip constraint mechanism (replaced by uv/edx-lint flow). |
| requirements/base.txt | Removes base pinned requirements (migrated to pyproject.toml). |
| requirements/base.in | Removes base inputs (migrated to pyproject.toml). |
| requirements.txt | Removes legacy requirements entrypoint. |
| pyproject.toml | Adds PEP 621 metadata, dependency groups, and tool configs (ruff/pytest/coverage/mypy/scriv/semantic-release). |
| pylintrc_tweaks | Removes legacy pylint plugin tweak file (pylint removed). |
| pylintrc | Removes generated pylint configuration (pylint removed). |
| openedx_webhooks/utils.py | Typing modernizations + small refactors/formatting and safer graphql_query signature. |
| openedx_webhooks/ui.py | Formatting and f-string update. |
| openedx_webhooks/types.py | Migrates type aliases to builtin generics/PEP 585. |
| openedx_webhooks/tasks/pr_tracking.py | Typing modernizations + formatting; minor refactors. |
| openedx_webhooks/tasks/jira_work.py | Typing modernizations + formatting. |
| openedx_webhooks/tasks/github.py | Typing modernizations + formatting; minor refactors. |
| openedx_webhooks/tasks/init.py | Formatting and route string normalization. |
| openedx_webhooks/settings.py | Typing modernizations (` |
| openedx_webhooks/info.py | Typing modernizations; updates imports/formatting. |
| openedx_webhooks/github_views.py | Formatting/structural cleanup for request handling and dict literals. |
| openedx_webhooks/gh_projects.py | Typing modernizations + formatting; minor refactors. |
| openedx_webhooks/debug.py | Formatting simplification. |
| openedx_webhooks/config.py | Formatting cleanup; tuple literal normalization. |
| openedx_webhooks/cla_check.py | Typing modernizations + formatting. |
| openedx_webhooks/bot_comments.py | Typing modernizations + formatting; string literal normalization. |
| openedx_webhooks/auth.py | Formatting simplification; comment spacing normalization. |
| openedx_webhooks/init.py | Import ordering/formatting updates for app setup. |
| Makefile | Replaces pip-tools targets with uv/tox/ruff oriented developer commands. |
| docs/conf.py | Quote/style normalization consistent with formatter. |
| codecov.yml | Adds Codecov status thresholds/targets. |
| .readthedocs.yaml | Switches RTD install to doc requirements + pip install project. |
| .isort.cfg | Removes legacy isort config (ruff handles import sorting). |
| .github/workflows/release.yml | Adds semantic-release-driven release + artifact publish pipeline. |
| .github/workflows/ci.yml | Updates CI to use uv + tox matrix and uploads coverage from tests env. |
| .coveragerc | Removes legacy coverage config (migrated to pyproject.toml). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
2071e65 to
e72089e
Compare
966b4d2 to
4b54aad
Compare
|
Overall this looks like a clean modernization, but two things worth resolving before merge:
Everything else (tests, remaining app code, tooling/config) checked out as cosmetic/mechanical — nice touch preserving the |
|
Thanks for the careful read!
The silent-skip behavior is intentional. On master, if A unit test covering this branch has been added: it instantiates |
- Migrated package metadata to pyproject.toml (PEP 621/735) — replaces setup.py, setup.cfg - Switched dependency management from pip-compile to uv with PEP 735 dependency groups and uv.lock - Replaced pylint/isort/pycodestyle with ruff; coverage and mypy config moved into pyproject.toml - Updated CI to use astral-sh/setup-uv and uv run tox with dependency groups - Dropped support for Python < 3.12 (requires-python = ">=3.12") Note: release.yml / python-semantic-release not added — master had no PyPI publish workflow. Part of openedx/public-engineering#506 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Since this repo has no PyPI publish workflow and is not integrating python-semantic-release, setuptools-scm adds no value. Replace the dynamic version with a static 0.1.0 (matching master's __version__) and drop the setuptools-scm build dependency. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
d240205 to
7225860
Compare
|
Closing on account of #437 |
Important
PR implemented with the assistance of Claude Code, human-reviewed and improved before pushing to code review.
Summary
Modernize
openedx-webhooksto uv + pyproject.toml (PEP 621/735).Part of openedx/public-engineering#506.
setup.py/setup.cfgwithpyproject.toml(PEP 621 static metadata)uvwith PEP 735 dependency groups; commituv.lockruff(check + format); coverage config moved intopyproject.tomltox.inito usetox-uvwithuv-venv-lock-runnerastral-sh/setup-uv; SHA-pin all actions; addworkflow_calltriggerRemoved
Deleted files:
setup.py,setup.cfg,requirements/,.coveragerc,pylintrc,pylintrc_tweaksRemoved Makefile targets:
check-setup.pysetup.pydeleted — no equivalent target in pyproject.toml workflowcompile-requirementsuv sync; pip-compile workflow removedinstall-dev-requirementsuv sync --group devpip-compilepip-compile-upgradepylintNot included
release.yml/python-semantic-release— master had no PyPI publish workflow.Versioning
[Static]
version = "0.1.0"declared directly inpyproject.toml— master had no PyPI publish workflow, sosetuptools-scmis 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:
tox.iniis newly added (master had none); it drives all CI jobs (lint,mypy,docs,py312-test) viatox-uv.ubuntu-latestrunner replaces the oldmatrix.osaxis, with separate tox envs per job. The existing required status check name"Tests (ubuntu-latest, 3.12)"is preserved viamatrix.job-name.pyproject.toml— some pylint checks that were previously enforced may not have a direct ruff equivalent, so confirm the linting coverage meets the project's expectations.🤖 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-repoonce that lands, to serve as the ruff epic PR.