feat: modernize repo to use uv, pyproject.toml, and semantic-release#692
feat: modernize repo to use uv, pyproject.toml, and semantic-release#692farhan wants to merge 10 commits into
Conversation
- Consolidated package metadata into pyproject.toml (PEP 621/735), replacing setup.py and MANIFEST.in - Switched dependency management from pip-compile to uv with PEP 735 dependency groups and uv.lock - Added python-semantic-release for automated versioning and PyPI publishing via OIDC (release.yml replaces pypi-publish.yml) - Replaced pylint/isort/pycodestyle with ruff; coverage config moved into pyproject.toml; removed pylintrc and pylintrc_tweaks - Updated CI and mysql8-migrations workflows to use astral-sh/setup-uv and uv run tox; added commitlint.yml Closes openedx/public-engineering#506 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Run ruff check --fix and ruff format across all Python source files to resolve 454 lint violations (UP, F401, B904, W, C4, etc.) and reformat 165 files to match the configured style - Add paramiko, pgpy, and py2neo to the test-base dependency group so enterprise_reporting tests can import them during pytest collection - Update uv.lock to include py2neo and its transitive deps Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
enterprise_reporting modules import pyminizip (utils.py) and vertica_python (clients/vertica.py) at the module level, causing pytest collection to fail for all enterprise_reporting tests. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
CODECOV_TOKEN secret is not available for fork PRs, causing the upload step to fail with fail_ci_if_error=true. Setting it to false allows the CI job to pass when coverage upload is unavailable. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #692 +/- ##
===========================================
- Coverage 88.70% 78.52% -10.19%
===========================================
Files 107 75 -32
Lines 3621 3180 -441
Branches 0 285 +285
===========================================
- Hits 3212 2497 -715
- Misses 409 596 +187
- Partials 0 87 +87
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:
|
- Delete CHANGELOG.rst (replaced by GitHub Releases via semantic-release) - Remove hardcoded __version__ from enterprise_data/__init__.py (version now derived from git tags via setuptools-scm) - SHA-pin pypa/gh-action-pypi-publish in release.yml (was floating @release/v1, now pinned to v1.12.4) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… auth - Fix uv_constraints from bool (true) to TOML array, populate constraint-dependencies via edx_lint write_uv_constraints - Remove fail_under = 70 from [tool.coverage.report] — master had no .coveragerc and no fail_under threshold; it was invented in migration - Fix release.yml publish_to_pypi to use token auth (PYPI_UPLOAD_TOKEN) matching master's pypi-publish.yml mechanism (not OIDC) - Add minimal codecov.yml as required by modernization standard - Update uv.lock with new constraint-dependencies Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Re-implement update — new commit
|
…nt widening - Restore `import enterprise_data.signals` in `apps.py`'s `ready()` so that post_save/post_delete cache-clearing handlers for EnterpriseLearner and EnterpriseLearnerEnrollment are registered at app startup. - Add comment in pyproject.toml documenting that Django<5 was intentionally widened to <6 to support Django 5.2 (the old constraint served edx-analytics-data-api compatibility and is no longer applicable). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
util/ has no __init__.py but was being picked up as an implicit namespace package by setuptools, causing util/assume-role.sh to appear in the wheel. Adding util* to the find.exclude list prevents this non-Python directory from being distributed. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
util/ has no __init__.py but was being picked up as an implicit namespace package by setuptools, causing util/assume-role.sh to appear in the wheel. Setting namespaces=false restricts discovery to regular packages (those with __init__.py). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
closing on account of #693 |
Important
PR implemented with the assistance of Claude Code, human-reviewed and improved before pushing to code review.
Summary
Modernize
edx-enterprise-datato uv + pyproject.toml (PEP 621/735) + python-semantic-release.Part of openedx/public-engineering#506.
setup.pywithpyproject.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_calltriggerpython-semantic-release+release.ymlRemoved
Deleted files:
setup.py,CHANGELOG.rst,pylintrc,pylintrc_tweaks,requirements/Removed Makefile targets:
coveragepytest-covin tox; HTML report generation droppedisortruff format(handles import sorting)piptools-requirementstest-alltox(run directly viauv run tox)validatetest+ quality; tox envlist covers bothVersioning
[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, replacing the old manual workflow.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 carefully to ensure no test or dev dependency leaked into the[project.dependencies](production) group, especially given the large number of requirements files that were consolidated.🤖 Generated with Claude Code