Skip to content

feat: modernize repo to use uv, pyproject.toml, and semantic-release - #281

Closed
farhan wants to merge 9 commits into
openedx:masterfrom
farhan:farhan/modernize-python-repo
Closed

farhan wants to merge 9 commits into
openedx:masterfrom
farhan:farhan/modernize-python-repo

Conversation

@farhan

@farhan farhan commented Jul 16, 2026 •

Copy link
Copy Markdown
Contributor

Important

PR implemented with the assistance of Claude Code, human-reviewed and improved before pushing to code review.

Split out of #280; ruff retained there for adoption in a future epic (per public-engineering#506).

Summary

Modernize forum to uv + pyproject.toml (PEP 621/735) + src/ layout + python-semantic-release.

Part of openedx/public-engineering#506.

  • 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
  • Move the package into a src/ layout
  • Retain pylint/isort/pycodestyle/pydocstyle as on master (ruff deferred to its own epic per #506); coverage config and mypy config moved into pyproject.toml
  • Update tox.ini to use tox-uv with uv-venv-lock-runner
  • Update CI to use astral-sh/setup-uv; SHA-pin all actions; add workflow_call trigger
  • Add python-semantic-release + release.yml (OIDC trusted publishing)

Removed

Deleted files: setup.py, setup.cfg, requirements/, .coveragerc, mypy.ini, CHANGELOG.rst

Removed Makefile targets:

Target Reason
clean_tox Tox environments managed by tox-uv; manual tox cache cleaning no longer needed
compile-requirements pip-compile workflow replaced by uv + uv.lock
piptools pip-tools no longer used
test-all Superseded by tox / CI matrix
test-quality Replaced by lint target (uv run tox -e quality)
test-lint Consolidated into lint target (uv run tox -e quality)
test-codestyle Consolidated into lint target (uv run tox -e quality)
test-isort Consolidated into lint target (uv run tox -e quality)
test-mypy Replaced by mypy target (uv run tox -e mypy)
test-format Ran black --check; format checking is no longer a separate CI quality gate; the format target now auto-fixes

Versioning

[Dynamic] setuptools-scm with dynamic = ["version"] — master had a PyPI publish workflow (pypi-publish.yml); python-semantic-release controls the version string at release time via git tags. Repo is on 0.x, so allow_zero_version = true and major_on_zero = false are set to prevent a feat: commit from bumping 0.x.y → 1.0.0.

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:

  • Pylint/isort/pycodestyle/pydocstyle are retained exactly as on master — ruff is out of scope this cycle and lives in the companion PR feat: modernize repo to use uv, pyproject.toml, and semantic-release #280 for a future epic.
  • OIDC trusted publisher must be configured on PyPI before merging — first publish fails silently otherwise. This is an out-of-band prerequisite handled by the Axim team (Feanil): PyPI project → Publishing → Add a new publisher, pointing at openedx/forum, workflow release.yml, no environment.
  • commitlint.yml was already present on master; this PR does not change it.
  • Pay close attention to the pyproject.toml dependency groups — verify that all runtime and optional dependencies from the old requirements/*.in files are faithfully carried over, and that no transitive constraint from requirements/constraints.txt was silently dropped.
  • test-format (black --check) was removed as a quality gate; formatting is now only enforced via make format (auto-fix) rather than CI check — reviewers should verify this is acceptable for this repo.

🤖 Generated with Claude Code

Split out of farhan/modernize-repo; ruff retained there for adoption in a
future epic (per public-engineering#506).

- 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 as on master (ruff deferred)
- Update tox.ini to use tox-uv with uv-venv-lock-runner
- Update CI to use astral-sh/setup-uv; SHA-pin all actions; add workflow_call trigger
- Add python-semantic-release + release.yml (OIDC trusted publishing)
- Add commitlint.yml to enforce conventional commit format on all future PRs

Part of openedx/public-engineering#506
farhan and others added 4 commits July 16, 2026 13:38
…warning

- Run isort on all source files to fix import ordering (isort v8 is
  stricter than the pre-migration version; files not yet sorted)
- Remove black --check from tox quality env (black was not in
  requirements/quality.in on master so was never reliably enforced)
- Remove black from quality dependency group accordingly
- Add ref.python to suppress_warnings in docs/conf.py to silence the
  ambiguous cross-reference warning for the `type` attribute (present
  in both Content and ContentSerializer); Sphinx 9.x treats this as
  an error with -W

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Replace PYPI_UPLOAD_TOKEN with id-token: write + pypa/gh-action-pypi-publish
(no password input). OIDC is the org-wide standard per public-engineering#506,
unconditionally applied regardless of what master used.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Repo is on 0.4.3 (0.x). Without allow_zero_version=true and
major_on_zero=false, the first feat: commit after merge would bump
0.x.y → 1.0.0 unexpectedly.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Moves the importable package from forum/ to src/forum/ per the
modernization standard (public-engineering#520). Updates all
tooling references: setuptools find, coverage source_pkgs, tox
quality/mypy envs, Makefile targets, and docs/conf.py apidoc paths.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
black was in master's ci.in but was not carried over to any
dependency group in pyproject.toml, leaving the `format` target
broken (uv run black fails with no such file or directory).

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@farhan
farhan marked this pull request as draft July 16, 2026 13:17
@farhan
farhan marked this pull request as ready for review July 16, 2026 16:27
irfanuddinahmad pushed a commit to openedx/enterprise-integrated-channels that referenced this pull request Jul 17, 2026
Moves channel_integrations/ to src/channel_integrations/, in line with
the reference implementation for this modernization effort
(openedx/sample-plugin) and openedx/forum#281.

- pyproject.toml: add where = ["src"] to packages.find
- tox.ini: prefix src/ onto pylint/pycodestyle targets in the quality env
- Makefile: prefix src/ onto all 5 localization targets (extract,
  compile, detect_changed, pull, dummy); atlas pull's local destination
  path updated, remote Transifex identifier left unchanged
- test_settings.py: LOCALE_PATHS root() call updated
- docs/conf.py: sphinx-apidoc call updated to point at src/channel_integrations
- MANIFEST.in: recursive-include path updated

Verified: uv sync (no lock drift), full django42 test run (893 passed),
quality and pii_check envs pass, uv build --wheel + twine check pass.

The docs tox env fails both before and after this change (a pre-existing
sphinx/autodoc ValueError in object_description, unrelated to src-layout
and unrelated to this repo's file layout) -- confirmed by reproducing the
identical failure on the pre-migration commit via git stash.
irfanuddinahmad pushed a commit to openedx/taxonomy-connector that referenced this pull request Jul 17, 2026
Moves taxonomy/ to src/taxonomy/, in line with the reference
implementation for this modernization effort (openedx/sample-plugin)
and openedx/forum#281.

- pyproject.toml: add where = ["src"] to packages.find
- tox.ini: prefix src/ onto pylint/pycodestyle/pydocstyle/isort targets
  in the quality env
- Makefile: prefix src/taxonomy onto the 3 localization targets that
  cd into the package (compile_translations, detect_changed_source_translations,
  dummy_translations); compile_translations' relative ../manage.py climb
  updated to ../../manage.py to account for the extra nesting level
- test_settings.py: LOCALE_PATHS root() call updated
- docs/conf.py: sphinx-apidoc call updated to point at src/taxonomy
- MANIFEST.in: recursive-include path updated

Verified: uv sync (no lock drift), full django42 test run (315 passed),
quality (pylint/pycodestyle/pydocstyle/isort) and pii-annotations envs
pass, docs env passes end to end -- sphinx-apidoc generates real API
docs from the new path, uv build --wheel + twine check pass.
irfanuddinahmad pushed a commit to openedx/openedx-ledger that referenced this pull request Jul 17, 2026
Moves openedx_ledger/ to src/openedx_ledger/, in line with the reference
implementation for this modernization effort (openedx/sample-plugin)
and openedx/forum#281.

- pyproject.toml: add where = ["src"] to packages.find
- tox.ini: prefix src/ onto the quality env's pylint/pycodestyle/isort
  targets
- Makefile: prefix src/openedx_ledger onto the standalone isort/style/lint
  targets and the 5 localization targets that cd into the package;
  extract_translations/compile_translations' relative ../manage.py climbs
  updated to ../../manage.py to account for the extra nesting level
- test_settings.py: LOCALE_PATHS root() call updated
- docs/conf.py: sphinx-apidoc call updated to point at src/openedx_ledger
- MANIFEST.in: recursive-include path updated
- Dockerfile needs no change: it COPYs the whole repo rather than naming
  the package directory directly

Verified: uv build --wheel + twine check pass (direct proof the
where=["src"] packaging change works). Could not run the full
pytest/quality/docs tox matrix locally -- this machine has no
libmysqlclient/pkg-config to build the mysqlclient C extension (a
[project.dependencies] entry, so it's required for every uv sync
regardless of group), same environment limitation hit previously on
enterprise-access. Relying on CI for full-matrix confirmation.
irfanuddinahmad pushed a commit to openedx/edx-enterprise-data that referenced this pull request Jul 17, 2026
Moves all three top-level packages (enterprise_data, enterprise_data_roles,
enterprise_reporting) to src/, in line with the reference implementation
for this modernization effort (openedx/sample-plugin) and openedx/forum#281.

- pyproject.toml: add where = ["src"] to packages.find
- tox.ini: prefix src/ onto the quality env's isort/pylint/pycodestyle/
  pydocstyle targets, and onto the data env's pytest --ignore path and
  the reporting env's test-collection path (--cov's own module-name arg
  is left alone -- it resolves via the installed module, not a filesystem
  path). DJANGO_SETTINGS_MODULE=enterprise_data.settings.test is an
  import path, unaffected by the physical move.
- Makefile: prefix src/ onto the isort target's package names
- MANIFEST.in: all three recursive-include paths updated
- enterprise_data/settings/test.py: this repo's in-package here()/root()
  path helper climbs from src/enterprise_data/settings/ back to the repo
  root -- fixed the climb from '../..' (2 levels, correct pre-move) to
  '../../..' (3 levels, correct post-move) so root() still means what its
  docstring says. root() has no current call sites (dead code), but fixed
  the definition itself for correctness -- verified by direct invocation
  that it now resolves to the true repo root.

Verified: uv sync (no lock drift), uv build --wheel + twine check pass
(direct proof the where=["src"] packaging change works across all three
packages). Could not run the full tox matrix locally -- this machine's
clang/zlib toolchain can't build pyminizip (a native extension in the
"reporting" extra that both the "test" and "quality" dependency groups
pull in), unrelated to src-layout. Relying on CI for full-matrix
confirmation.
irfanuddinahmad pushed a commit to openedx/edx-enterprise that referenced this pull request Jul 17, 2026
Moves all four top-level packages (enterprise, consent, integrated_channels,
enterprise_learner_portal) to src/, in line with the reference implementation
for this modernization effort (openedx/sample-plugin) and openedx/forum#281.
Most complex repo in this batch: 4 packages, an in-package path helper with
real call sites, and JS tooling (webpack, jasmine) alongside the Python side.

- pyproject.toml: add where = ["src"] to packages.find
- tox.ini: prefix src/ onto the pycodestyle exclude list and onto every
  package name in the isort/isort-check/quality env commands
- Makefile: prefix src/ onto clean.static, dummy_translations,
  pull_translations (local destination paths only -- the Transifex/Atlas
  remote path identifiers are left unchanged), jshint, pylint, pycodestyle,
  isort, and isort-check targets
- docs/conf.py: sphinx-apidoc call updated to point at src/enterprise
- webpack.config.js: build context path updated to src/enterprise/static/enterprise
- spec/javascripts/support/jasmine.yml: src_files glob updated to
  src/enterprise/static/enterprise/js/*.js
- MANIFEST.in: all four recursive-include paths and the enterprise/locale
  symlink exclusion updated
- enterprise/settings/test.py: this repo's in-package here()/root() path
  helper climbs from src/enterprise/settings/ back to the repo root --
  fixed the climb from '../..' (2 levels) to '../../..' (3 levels), and
  updated its 3 real call sites (LOCALE_PATHS, REPO_ROOT, STATIC_ROOT) to
  prepend 'src' so they still resolve inside the package. The symlink
  enterprise/locale -> conf/locale is relative and moved as a unit with
  git mv, so it still resolves correctly post-move -- verified.

Verified: uv sync (no lock drift), full py312-django52 test run (2849
passed), quality (pylint/pycodestyle/isort), isort-check, and pii_check
envs pass, docs env passes end to end -- sphinx-apidoc generates real API
docs from the new path, uv build --wheel + twine check pass. A pylint
useless-suppression info note in integrated_channels/cornerstone/models.py
is pre-existing (confirmed identical on the pre-migration commit via git
stash), unrelated to this change.
Comment thread pyproject.toml Resolved
Comment thread tox.ini Resolved
CI pins the interpreter via setup-uv's python-version; the explicit
basepython = python3.12 is unnecessary.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>

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

Reviewed the modernization changes (uv/pyproject.toml + src-layout + semantic-release migration). OIDC publishing and action pinning look correct; no issues found.

Per review feedback, remove the >=61.0 minimum to stay consistent
with how other modernized openedx repos declare their build-system.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@farhan farhan self-assigned this Jul 21, 2026
@farhan farhan moved this to 🏗 In progress in Aximprovements Team Jul 21, 2026
@farhan farhan moved this from 🏗 In progress to 👀 In review in Aximprovements Team Jul 21, 2026
irfanuddinahmad pushed a commit to openedx/edx-enterprise that referenced this pull request Jul 21, 2026
Moves all four top-level packages (enterprise, consent, integrated_channels,
enterprise_learner_portal) to src/, in line with the reference implementation
for this modernization effort (openedx/sample-plugin) and openedx/forum#281.
Most complex repo in this batch: 4 packages, an in-package path helper with
real call sites, and JS tooling (webpack, jasmine) alongside the Python side.

- pyproject.toml: add where = ["src"] to packages.find
- tox.ini: prefix src/ onto the pycodestyle exclude list and onto every
  package name in the isort/isort-check/quality env commands
- Makefile: prefix src/ onto clean.static, dummy_translations,
  pull_translations (local destination paths only -- the Transifex/Atlas
  remote path identifiers are left unchanged), jshint, pylint, pycodestyle,
  isort, and isort-check targets
- docs/conf.py: sphinx-apidoc call updated to point at src/enterprise
- webpack.config.js: build context path updated to src/enterprise/static/enterprise
- spec/javascripts/support/jasmine.yml: src_files glob updated to
  src/enterprise/static/enterprise/js/*.js
- MANIFEST.in: all four recursive-include paths and the enterprise/locale
  symlink exclusion updated
- enterprise/settings/test.py: this repo's in-package here()/root() path
  helper climbs from src/enterprise/settings/ back to the repo root --
  fixed the climb from '../..' (2 levels) to '../../..' (3 levels), and
  updated its 3 real call sites (LOCALE_PATHS, REPO_ROOT, STATIC_ROOT) to
  prepend 'src' so they still resolve inside the package. The symlink
  enterprise/locale -> conf/locale is relative and moved as a unit with
  git mv, so it still resolves correctly post-move -- verified.

Verified: uv sync (no lock drift), full py312-django52 test run (2849
passed), quality (pylint/pycodestyle/isort), isort-check, and pii_check
envs pass, docs env passes end to end -- sphinx-apidoc generates real API
docs from the new path, uv build --wheel + twine check pass. A pylint
useless-suppression info note in integrated_channels/cornerstone/models.py
is pre-existing (confirmed identical on the pre-migration commit via git
stash), unrelated to this change.
irfanuddinahmad pushed a commit to openedx/edx-enterprise-data that referenced this pull request Jul 21, 2026
Moves all three top-level packages (enterprise_data, enterprise_data_roles,
enterprise_reporting) to src/, in line with the reference implementation
for this modernization effort (openedx/sample-plugin) and openedx/forum#281.

- pyproject.toml: add where = ["src"] to packages.find
- tox.ini: prefix src/ onto the quality env's isort/pylint/pycodestyle/
  pydocstyle targets, and onto the data env's pytest --ignore path and
  the reporting env's test-collection path (--cov's own module-name arg
  is left alone -- it resolves via the installed module, not a filesystem
  path). DJANGO_SETTINGS_MODULE=enterprise_data.settings.test is an
  import path, unaffected by the physical move.
- Makefile: prefix src/ onto the isort target's package names
- MANIFEST.in: all three recursive-include paths updated
- enterprise_data/settings/test.py: this repo's in-package here()/root()
  path helper climbs from src/enterprise_data/settings/ back to the repo
  root -- fixed the climb from '../..' (2 levels, correct pre-move) to
  '../../..' (3 levels, correct post-move) so root() still means what its
  docstring says. root() has no current call sites (dead code), but fixed
  the definition itself for correctness -- verified by direct invocation
  that it now resolves to the true repo root.

Verified: uv sync (no lock drift), uv build --wheel + twine check pass
(direct proof the where=["src"] packaging change works across all three
packages). Could not run the full tox matrix locally -- this machine's
clang/zlib toolchain can't build pyminizip (a native extension in the
"reporting" extra that both the "test" and "quality" dependency groups
pull in), unrelated to src-layout. Relying on CI for full-matrix
confirmation.
Comment thread src/forum/api/__init__.py Outdated
)
from .subscriptions import create_subscription, delete_subscription, get_thread_subscriptions, get_user_subscriptions
from .threads import create_thread, delete_thread, get_course_id_by_thread, get_thread, get_user_threads, update_thread
from .users import (create_user, delete_user_posts, get_user, get_user_active_threads, get_user_course_stats,

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.

A lot of imports are going from one per line to this multi-line format which seems less readable to me. Is this because of isort? is there something wrong with the config causing this? I think we prefer multi-line imports with one import per line over this version. Let's update the config so that we don't do this kind of change if we can.

@farhan farhan Jul 24, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Details are in the issue: #284

Comment thread Makefile Outdated

upgrade: ## update the requirements/*.txt files with the latest packages satisfying requirements/*.in
$(MAKE) compile-requirements COMPILE_OPTS="--upgrade"
lint: ## Run linting checks

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.

Suggested change
lint: ## Run linting checks
quality: ## Run linting and other quality checks

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed in this PR

Comment thread Makefile Resolved
Comment thread Makefile

requirements: clean_tox piptools ## install development environment requirements
pip-sync -q requirements/dev.txt requirements/private.*
format: ## Auto-fix formatting issues

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.

Why was this updated to only format prod files instead of all the files?

Comment thread tox.ini
DJANGO_SETTINGS_MODULE = forum.settings.test
commands =
make test-pii
code_annotations django_find_annotations --config_file .pii_annotations.yml --lint --report --coverage

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.

We sholud be calling make targets from inside tox so that we can run those targets outside of tox easily as well in a re-producable way. We sholudn't force tox for when we're trying to iterate quickly in a local dev environment.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fix in PR

@farhan
farhan requested a review from feanil July 22, 2026 16:48
@farhan
farhan force-pushed the farhan/modernize-python-repo branch 2 times, most recently from 470bff0 to 53a6af0 Compare July 22, 2026 17:31
@farhan
farhan force-pushed the farhan/modernize-python-repo branch from 3f87ff4 to bb4a94a Compare July 22, 2026 17:57
Addresses review feedback on openedx#281:

- Restore the [isort] settings from master's setup.cfg (dropped when
  setup.cfg was removed) as [tool.isort] in pyproject.toml. Without it,
  isort fell back to defaults and collapsed imports into a horizontal
  grid; re-running isort restores the readable one-per-line format.
- Rename the `lint` make target to `quality` for parity with master's
  `test-quality` and to reflect that it runs more than linting.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@FuaadZam FuaadZam moved this from 👀 In review to 🏗 In progress in Aximprovements Team Jul 23, 2026
@farhan

farhan commented Jul 24, 2026

Copy link
Copy Markdown
Contributor Author

Closing on account of #283

@farhan farhan closed this Jul 24, 2026
irfanuddinahmad pushed a commit to openedx/enterprise-integrated-channels that referenced this pull request Sep 7, 2026
Moves channel_integrations/ to src/channel_integrations/, in line with
the reference implementation for this modernization effort
(openedx/sample-plugin) and openedx/forum#281.

- pyproject.toml: add where = ["src"] to packages.find
- tox.ini: prefix src/ onto pylint/pycodestyle targets in the quality env
- Makefile: prefix src/ onto all 5 localization targets (extract,
  compile, detect_changed, pull, dummy); atlas pull's local destination
  path updated, remote Transifex identifier left unchanged
- test_settings.py: LOCALE_PATHS root() call updated
- docs/conf.py: sphinx-apidoc call updated to point at src/channel_integrations
- MANIFEST.in: recursive-include path updated

Verified: uv sync (no lock drift), full django42 test run (893 passed),
quality and pii_check envs pass, uv build --wheel + twine check pass.

The docs tox env fails both before and after this change (a pre-existing
sphinx/autodoc ValueError in object_description, unrelated to src-layout
and unrelated to this repo's file layout) -- confirmed by reproducing the
identical failure on the pre-migration commit via git stash.
feanil pushed a commit to openedx/taxonomy-connector that referenced this pull request Sep 29, 2026
…e) (#316)

* feat: consolidate package metadata into pyproject.toml

Replace setup.py/setup.cfg with PEP 621 [project] metadata and
setuptools-scm for git-tag-based versioning.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* feat: switch dependency management from pip-compile to uv

Replace requirements/*.in + *.txt with PEP 735 dependency-groups in
pyproject.toml and a single uv.lock. Update tox.ini to use tox-uv's
uv-venv-lock-runner, update Makefile targets, and switch CI (including
the mysql8 migrations check) to install uv and run tests via
`uv run tox`.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* feat: add semantic-release for automated PyPI publishing

Replace the manual GitHub-release-triggered publish workflow with
python-semantic-release: pushes to master with conventional commits
now automatically bump the version, tag it, and publish to PyPI.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: correct release tag format and restore pycodestyle ignore list

semantic-release defaults to a "v{version}" tag format, but this repo's
existing release tags are bare version numbers -- without tag_format set,
semantic-release wouldn't recognize any prior release.

Also restores the ignore=E501,W503,W504 pycodestyle setting that was
dropped when setup.cfg was deleted -- without it the quality tox env
fails on pre-existing long lines that were previously suppressed.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: prevent uv sync from implicitly pulling in the dev group

Every uv sync/uv run invocation in this repo names an explicit --group,
but uv's implicit default group (named "dev") was still being synced
alongside it, silently pulling the entire dev/test/quality/ci superset
into every target. Verified with `uv sync --group ci`.

Also adds .venv/ to .gitignore alongside the existing venv/ entry.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: publish to PyPI via OIDC instead of token

Parent issue openedx/public-engineering#506 asks for OIDC trusted-publisher
PyPI auth, not a stored token. Grant id-token: write on publish_to_pypi and
drop the explicit __token__/PYPI_UPLOAD_TOKEN credentials -- pypa/gh-action-pypi-publish
uses OIDC automatically once the permission is present and no credentials are given.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: pin pypa/gh-action-pypi-publish to a commit SHA

@release/v1 is a floating branch ref -- xblocks-core's release just failed
with "docker: manifest unknown" because the Docker image tag it resolved to
at checkout time wasn't published on ghcr.io yet. Pin to the exact commit
backing the current v1.14.0 release instead, consistent with this repo's
own SHA-pinning rule for every other action.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: set major_on_zero=false and allow_zero_version=true for consistency

Reviewer feedback: this should be set across the whole batch, not just
repos currently on 0.x, so no repo in this effort can ever auto-jump to
1.0.0 as an accidental side effect if it's reset to 0.x in the future.
Note this is a no-op for repos already past 1.0 -- major_on_zero only
governs the 0.x -> 1.0.0 transition, not 1.x -> 2.0.0 (there's no PSR
setting that suppresses major bumps once past 1.0; that's normal SemVer
behavior for a breaking-change commit at any version).

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* refactor: adopt src-layout, matching openedx/sample-plugin

Moves taxonomy/ to src/taxonomy/, in line with the reference
implementation for this modernization effort (openedx/sample-plugin)
and openedx/forum#281.

- pyproject.toml: add where = ["src"] to packages.find
- tox.ini: prefix src/ onto pylint/pycodestyle/pydocstyle/isort targets
  in the quality env
- Makefile: prefix src/taxonomy onto the 3 localization targets that
  cd into the package (compile_translations, detect_changed_source_translations,
  dummy_translations); compile_translations' relative ../manage.py climb
  updated to ../../manage.py to account for the extra nesting level
- test_settings.py: LOCALE_PATHS root() call updated
- docs/conf.py: sphinx-apidoc call updated to point at src/taxonomy
- MANIFEST.in: recursive-include path updated

Verified: uv sync (no lock drift), full django42 test run (315 passed),
quality (pylint/pycodestyle/pydocstyle/isort) and pii-annotations envs
pass, docs env passes end to end -- sphinx-apidoc generates real API
docs from the new path, uv build --wheel + twine check pass.

* fix: pattern-gap audit (uv setup, package=true, coverage, changelog)

Same category of fixes farhan flagged on the batch's other reviewed PRs:

- ci.yml + mysql8-migrations.yml: add enable-cache/python-version to
  astral-sh/setup-uv and drop the now-redundant actions/setup-python step
- pyproject.toml: add [tool.uv] package = true
- Drop CHANGELOG.rst from the dynamic readme file list and delete it --
  python-semantic-release + GitHub Releases is the changelog of record.
  Also removes the now-stale MANIFEST.in include and the docs/changelog.rst
  page (and its toctree entry).
- Migrate .coveragerc into [tool.coverage.run] and delete the old file

Verified: uv sync (no lock drift), full django52 test run (315 passed),
quality, pii-annotations, and docs envs all pass end to end -- docs
env's apidoc + wheel build + twine check confirm the readme/coverage
config changes work correctly.

* docs: drop stale Version/Changelog checklist items from PR template

Both referenced files/processes that no longer exist post-migration:
CHANGELOG.rst was deleted (python-semantic-release + GitHub Releases is
the changelog of record now), and __version__ in taxonomy/__init__.py
is no longer manually bumped (versioning is automated by semantic-release
based on conventional commits). Neither is a manual per-PR task anymore.

* fix: pattern-gap audit round 2 (django42/52 dependency groups, uv run wrapping, dynamic readme)

Cross-checked against review comments/fixes from openedx-ledger#242,
edx-enterprise-subsidy-client#222, enterprise-access#1015, and
enterprise-subsidy#441.

- Add test-django42/test-django52 dependency-groups (each layering a
  Django version pin on top of the shared test group) and declare
  [tool.uv].conflicts between them, replacing the old single test group
  + tox deps= overlay. Update tox.ini's [testenv] to select the group by
  factor and add the previously-missing django42 job to the CI matrix --
  only django52 was actually being exercised in CI before this.
- Wrap remaining bare tool invocations in the Makefile (coverage erase,
  pytest --cov-report html, pytest (test target), diff-cover, i18n_tool,
  manage.py compilemessages) with `uv run`. Transifex's tx binary is left
  bare since it's installed via curl, not uv/pip.
- Drop the redundant dynamic readme field; keep only version as dynamic.
- Regenerate uv.lock for the new dependency groups; verified both
  py312-django42 and py312-django52 tox environments resolve and run.

* fix: correct Makefile recipe indentation (tabs, not spaces)

Make requires recipe lines to be indented with a literal tab
character. An earlier edit in this migration accidentally used
spaces for several targets, breaking 'make selfcheck' and CI.

* fix: add codecov project threshold for coverage-scope change

The uv/pyproject.toml modernization (openedx/public-engineering#506)
switched coverage measurement to [tool.coverage.run], which correctly
excludes src/taxonomy/tests/*.py from the package's own coverage
report instead of counting those (trivially self-covered) test files
toward the reported percentage.

That's a one-time drop in the reported baseline (98.91% -> 98.70%,
90 files -> 86 files) caused purely by measurement scope, not a
regression: every production file's hit/miss counts are unchanged.
Add a documented threshold so codecov/project absorbs this one-time
drop while still catching genuine future regressions, matching the
same fix applied in sibling modernization PRs (ccx-keys#190,
opaque-keys#461, openedx-chem#161).

* fix: restore CHANGELOG.rst and re-enable python-semantic-release changelog generation

A previous pass deleted CHANGELOG.rst and disabled changelog generation
(changelog: "false") in release.yml with no ticket justification -- the
changelog is genuinely useful historical documentation and semantic-release
can keep it current automatically. Restore CHANGELOG.rst from the commit
right before it was deleted, add the insertion-marker line PSR's "update"
mode looks for, wire up [tool.semantic_release.changelog] to update the
existing RST file in place, and remove changelog: "false" from release.yml.

tag_format = "{version}" was already correctly set to match this repo's
bare-version tag convention (verified against `git tag --sort=-v:refname`),
so it's left unchanged.

* docs: remove stale manual tag/PyPI-verification steps from PR template

python-semantic-release's release.yml now creates the tag, GitHub
release, and publishes to PyPI automatically on merge -- these were
no longer real manual steps for a contributor to perform.

* fix: use stable pypa publish tag and drop tox from Makefile

- pypa/gh-action-pypi-publish: revert the hash-pinned SHA back to the
  stable @release/v1 tag. A hash-pinned version of this action broke
  PyPI publishing previously, which is why the org standardized on the
  stable tag for this specific action.
- Makefile: inline the actual sphinx/pylint/pycodestyle/pydocstyle/
  isort/code_annotations commands from tox.ini's docs/quality/
  pii-annotations envs instead of shelling out to `uv run tox -e ...`,
  matching the no-tox-in-Makefile convention already used elsewhere
  (e.g. enterprise-catalog). test-all now depends on quality/pii_check/
  test directly. tox.ini itself is untouched; CI's own matrix testing
  still uses tox directly.

* fix: use int-parseable fallback_version instead of 0.0.0.dev0

"0.0.0.dev0" is the exact fallback_version value that crashed 17 tests
in a sibling repo (openedx-events) -- runtime code that parses
__version__ via tuple(map(int, __version__.split("."))) chokes on the
non-numeric "dev0" segment. No current consumer here does that (this
repo's own __version__ usage, if any, only interpolates it as a
string), but there's no reason to keep a fallback value from the exact
banned-pattern class when a plain int-parseable "0.0.0" is equally
valid and strictly safer.

* fix: pure-uv mysql8-migrations job, remove permanent codecov threshold

- mysql8-migrations.yml: replaced uv pip uninstall/install --no-binary
  (x2) with a single native `uv sync --group mysql8 --no-binary-package
  mysqlclient --no-binary-package xmlsec`. mysqlclient/xmlsec weren't
  pulled in by any existing group (confirmed: a plain `uv sync --group dev`
  installs neither), so added a new `mysql8` dependency-group for them --
  this workflow-only need is the same as master's pre-migration behavior,
  where they came in only via this same job's own pip uninstall+reinstall
  step, not via requirements/dev.txt or test.txt. Verified the sync+flag
  combo genuinely triggers source builds for both (confirmed via -v output
  and a real build attempt, blocked locally only by a missing macOS
  pkg-config/mysql-dev system dependency that the CI runner's own
  `apt-get install libxmlsec1-dev` step already covers).

- codecov.yml: removed the permanent `threshold: 1%`, per salman2013's
  question (#316 (comment))
  on whether this was meant to be temporary. It wasn't actually needed:
  this status check isn't required for merging, and `target: auto`
  compares each PR against its own base commit, so the one-time coverage-
  scope discontinuity (98.91% -> 98.70%) only ever affected this PR's own
  diff display -- once merged, 98.70% becomes the new baseline for every
  future comparison, with no lingering gap for a permanent threshold to
  paper over. Kept the explanatory comment, dropped the actual tolerance,
  since a standing 1% regression-masking allowance had no real job to do
  and only downside.

Found while auditing this repo for uv pip usage per the lessons learned on
openedx-platform#38915.

* fix: disable python-semantic-release changelog generation

Set changelog: "false" on the PSR release step and remove the
[tool.semantic_release.changelog] config / insertion marker.

Checked against openedx/XBlock's actual production release.yml (the one
repo in this effort that has cut real automated releases) -- every run
passes changelog: false and invokes `semantic-release -v version
--no-changelog`, and the repo has zero github-actions[bot] commits ever.
The auto-changelog config this migration previously added was only ever
verified via a local dry-run prototype, never against a real release.

feanil flagged the same issue on openedx/DoneXBlock#388: "I thought we
were not going to add changelogs since they can't be updated by
python-semantic-release the way we have it setup."

* fix: create GitHub release with assets attached, not after publish

This repo has immutable releases enabled, which freezes a release's assets the moment it's published. The old flow (main PSR step publishes the release, a separate publish-action step attaches assets afterward) can never work under that constraint -- it would 422 on the first real release. Matches the fix already proven and merged on openedx/sample-plugin#57 and validated end-to-end on openedx/event-tracking#434: build without publishing (vcs_release: false), then create the release with dist/* attached in one gh release create call.

* fix: trim verbose codecov.yml comment to match sibling repos

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: pin release.yml actions to sample-plugin's gold-standard SHAs

openedx/sample-plugin's release.yml is this org's designated reference
for action pins in this migration effort. This repo's release.yml had
drifted from it on every pin:

- actions/checkout: v7.0.0 (9c091bb2) -> v7.0.1 (3d3c42e5), matching
  sample-plugin
- python-semantic-release: v10.5.3 (350c48fc) -> v10.6.2 (9a026e93)
- actions/upload-artifact: v4.6.2 (ea165f8d) -> v7.0.1 (043fb46d)
- actions/download-artifact: v4.3.0 (d3f86a10) -> v8.0.1 (3e5f45b2)
- pypa/gh-action-pypi-publish: unpinned @release/v1 -> SHA-pinned
  v1.14.2 (dc37677b)

The pypa/gh-action-pypi-publish change reverses earlier guidance on
this PR: salman2013 previously asked (review comment #3710602930) for
this action to be reverted off a SHA pin back to @release/v1 due to a
prior publish issue with the hashed version. That guidance has since
been superseded -- the same reviewer, on a sibling repo's PR in this
same migration effort, directed matching sample-plugin exactly, which
now means SHA-pinning this action like every other one in the file.

Every SHA above was independently verified against the GitHub API
(commit lookup + tag ref, resolving through the annotated tag object
where applicable) before use, per this org's history of fabricated/
swapped SHAs in this exact file.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: restore [4.0.0] entry silently dropped from CHANGELOG.rst by merges

salman2013 asked (review comment #3710606973) why old release log
entries were being removed; this was previously addressed by restoring
CHANGELOG.rst's full history in commit e58b416. But three later
merge-from-master commits on this branch (6012451, then 1804d5d)
brought in master's tip without carrying over master's own [4.0.0] /
"chore: upgrade requirements" changelog entry -- despite there being no
textual conflict on this file (the entry existed cleanly on master's
side with no competing change on the branch side), the merge results
ended up without it, so it was silently lost again.

Confirmed via `git diff origin/master -- CHANGELOG.rst` before this
fix: the only difference between this branch and current master was
the missing [4.0.0] entry. Restored it so the file now matches master
exactly, keeping this PR's changelog history complete and consistent
with what will already be on master when this merges.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: use v-prefixed tag_format for release tag consistency

* fix: update author to Open edX Project convention

* fix: restore __version__ dropped during pyproject.toml consolidation

4e45689 removed the hardcoded __version__ = "3.0.0" (correctly, since
version is now dynamic via setuptools-scm) but never replaced it with
the importlib.metadata equivalent, unlike sibling repos in this
migration batch. taxonomy.__version__ has been silently missing since.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: remove dangling codecov.yml comment, not present pre-migration

Points at "see PR description" for an explanation -- fragile since
the PR description is external and mutable. Coverage config itself
stays out of scope for this migration; just dropping the comment, no
change to target/threshold behavior.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: use secrets.GITHUB_TOKEN instead of custom org secret for release job

Matches openedx/sample-plugin's current release.yml; the custom
OPENEDX_SEMANTIC_RELEASE_GITHUB_TOKEN secret isn't needed.

* fix: restore tox delegation for docs/quality/pii_check targets

Makefile targets were fully inlining commands that tox.ini already
defines as standalone envs. pii_check delegates to tox -e
pii-annotations, matching the actual tox env name (not pii_check).

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: drop uv run from Makefile per feanil's review feedback

Makefile now assumes an already-synced/activated local env; uv run
stays in CI workflow steps only. See openedx-unsupported/ccx-keys#190 (review
comment r4097501942).

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: restore full tox matrix on test-all, correct tag_format comment

test-all had drifted to depend only on `test` (a single pytest run),
making it identical to `validate` and no longer actually covering
py312-django42/py312-django52 like its own help text claims. Restore
the bare `tox` call so it runs the full envlist.

Also corrected the tag_format comment, which claimed no v-prefixed
tag existed -- v4.0.0 already does, same commit as the old bare
4.0.0 tag.

Per feanil's review on #316:
discussion_r4097760680, r4097760715.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: remove django42 from CI matrix, restore pre-migration scope

CI stopped exercising django42 in 2026-02 (3b842b7), keeping it only in
tox.ini's envlist for local/manual use; the migration's ci.yml
regenerated the matrix from tox.ini and silently reintroduced it as a
CI job. Per this effort's policy, a migration PR must not expand CI
scope beyond what pre-existed. Coverage step already correctly targets
django52, so no other change is needed.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: include doc group in dev group; bump python-semantic-release to v10.7.0

- dev omitted {include-group = "doc"}, so `uv sync --group dev` never
  provisioned doc8/Sphinx and `make docs` failed on a fresh clone.
  Matches the pattern already used in openedx/edx-enterprise's
  pyproject.toml.
- Bump python-semantic-release action pin from v10.6.2 to v10.7.0,
  matching openedx/sample-plugin's current live pin.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

---------

Co-authored-by: Irfan Ahmad <[email protected]>
Co-authored-by: Claude Sonnet 5 <[email protected]>
feanil pushed a commit to openedx/openedx-ledger that referenced this pull request Sep 30, 2026
…e) (#242)

* feat: consolidate package metadata into pyproject.toml

Replace setup.py/setup.cfg with PEP 621 [project] metadata and
setuptools-scm for git-tag-based versioning.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* feat: switch dependency management from pip-compile to uv

Replace requirements/*.in + *.txt with PEP 735 dependency-groups in
pyproject.toml and a single uv.lock. Update tox.ini to use tox-uv's
uv-venv-runner/uv-venv-lock-runner, update Makefile targets, and
fix .readthedocs.yaml to install docs deps via uv.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* feat: add semantic-release for automated PyPI publishing

Replace the manual GitHub-release-triggered publish workflow with
python-semantic-release: pushes to main with conventional commits
now automatically bump the version, tag it, and publish to PyPI.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: correct release tag format, exclude tests from wheel, drop stale MANIFEST.in entries

semantic-release defaults to a "v{version}" tag format, but this repo's
existing release tags are bare version numbers -- without tag_format set,
semantic-release wouldn't recognize any prior release.

packages.find.exclude only stops setuptools from registering the tests
subpackage; with include-package-data=true it still swept tests/*.py into
the wheel as package_data. Verified: built wheels before/after this fix --
tests/__init__.py and tests/test_views.py were present in the wheel prior
to this commit and are absent after, while test_utils/ (the intentionally
shipped factories module) is unaffected.

Also removes MANIFEST.in references to requirements/base.in and
requirements/constraints.txt, which no longer exist after the uv migration.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: prevent uv sync from implicitly pulling in the dev group

Every uv sync/uv run invocation in this repo names an explicit --group,
but uv's implicit default group (named "dev") was still being synced
alongside it, silently pulling the entire dev/test/quality/ci superset
into every target.

Also adds venv/ and .venv/ to .gitignore (previously absent).

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: publish to PyPI via OIDC instead of token

Parent issue openedx/public-engineering#506 asks for OIDC trusted-publisher
PyPI auth, not a stored token. Grant id-token: write on publish_to_pypi and
drop the explicit __token__/PYPI_UPLOAD_TOKEN credentials -- pypa/gh-action-pypi-publish
uses OIDC automatically once the permission is present and no credentials are given.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: pin pypa/gh-action-pypi-publish to a commit SHA

@release/v1 is a floating branch ref -- xblocks-core's release just failed
with "docker: manifest unknown" because the Docker image tag it resolved to
at checkout time wasn't published on ghcr.io yet. Pin to the exact commit
backing the current v1.14.0 release instead, consistent with this repo's
own SHA-pinning rule for every other action.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: set major_on_zero=false and allow_zero_version=true for consistency

Reviewer feedback: this should be set across the whole batch, not just
repos currently on 0.x, so no repo in this effort can ever auto-jump to
1.0.0 as an accidental side effect if it's reset to 0.x in the future.
Note this is a no-op for repos already past 1.0 -- major_on_zero only
governs the 0.x -> 1.0.0 transition, not 1.x -> 2.0.0 (there's no PSR
setting that suppresses major bumps once past 1.0; that's normal SemVer
behavior for a breaking-change commit at any version).

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* refactor: adopt src-layout, matching openedx/sample-plugin

Moves openedx_ledger/ to src/openedx_ledger/, in line with the reference
implementation for this modernization effort (openedx/sample-plugin)
and openedx/forum#281.

- pyproject.toml: add where = ["src"] to packages.find
- tox.ini: prefix src/ onto the quality env's pylint/pycodestyle/isort
  targets
- Makefile: prefix src/openedx_ledger onto the standalone isort/style/lint
  targets and the 5 localization targets that cd into the package;
  extract_translations/compile_translations' relative ../manage.py climbs
  updated to ../../manage.py to account for the extra nesting level
- test_settings.py: LOCALE_PATHS root() call updated
- docs/conf.py: sphinx-apidoc call updated to point at src/openedx_ledger
- MANIFEST.in: recursive-include path updated
- Dockerfile needs no change: it COPYs the whole repo rather than naming
  the package directory directly

Verified: uv build --wheel + twine check pass (direct proof the
where=["src"] packaging change works). Could not run the full
pytest/quality/docs tox matrix locally -- this machine has no
libmysqlclient/pkg-config to build the mysqlclient C extension (a
[project.dependencies] entry, so it's required for every uv sync
regardless of group), same environment limitation hit previously on
enterprise-access. Relying on CI for full-matrix confirmation.

* fix: use uv-venv-lock-runner for the main and pii_check tox envs

CI failed after the src-layout move: pytest raised ModuleNotFoundError
for openedx_ledger.tests when collecting src/openedx_ledger/tests/test_views.py.

Root cause: these two envs were the only ones in this repo still using
tox-uv's non-lock uv-venv-runner, which builds and installs a real
(non-editable) sdist for testing. That build genuinely excludes
openedx_ledger.tests per packages.find(exclude=["*tests"]) -- correct
for the published PyPI wheel, wrong for a test run. In flat layout this
was masked because the sdist-installed copy in site-packages was shadowed
on sys.path by the physically-identical openedx_ledger/ directory at repo
root; moving the package under src/ removes that accidental shadow (the
exact masking effect the src-layout/flat-layout packaging guide warns
about), so the real gap surfaced. docs/quality already used
uv-venv-lock-runner (uv sync, editable install) and were unaffected.

Verified the fix mechanism in an isolated repro (same packages.find
exclude pattern, in-package tests subpackage, tox + tox-uv): switching
uv-venv-runner -> uv-venv-lock-runner changes the install from a built
sdist to `uv sync`'s editable install, and the ModuleNotFoundError goes
away. Could not run the real repo's tox matrix locally (mysqlclient
build environment limitation) -- pushing to confirm via CI.

* fix: address review feedback (uv setup, coverage, readme, changelog)

Addresses farhan's review on #242:

- ci.yml: add enable-cache/python-version to astral-sh/setup-uv and drop
  the now-redundant actions/setup-python step; SHA-pin codecov-action
  (was floating on @v7, inconsistent with every other repo in this batch)
- pyproject.toml: make readme static (dynamic = ["version"] only --
  dynamic readme is non-standard for this migration pattern), add
  [tool.uv] package = true, migrate .coveragerc into [tool.coverage.*]
  (also fixing its stale source=edx_ledger -> source_pkgs=["openedx_ledger"])
  and delete the old file
- Drop CHANGELOG.rst from the dynamic readme file list (before removing
  the dynamic readme entirely) and delete it -- python-semantic-release +
  GitHub Releases is the changelog of record now. Also removes the now-stale
  MANIFEST.in include and the docs/changelog.rst page (and toctree entry)
  that only existed to embed it into Sphinx docs.
- Makefile: requirements target now also installs tox as a uv tool
  (uv tool install tox --with tox-uv), so tox is available on a fresh
  checkout that only has uv installed

Verified: pyproject.toml parses, uv build --wheel + twine check pass
(direct proof the readme/coverage config changes work). Could not run
the full tox matrix locally -- same mysqlclient build environment
limitation as before (no libmysqlclient/pkg-config on this machine).

* fix: remove unpinned tox install from make requirements

`uv tool install tox --with tox-uv` was added to the `requirements`
target in response to review feedback, but it installs an unpinned,
un-lockfiled tox outside uv.lock. Every other tox invocation in this
repo (test-all/quality/pii_check Makefile targets, ci.yml) uses
`uv run tox` via the ci/dev dependency-groups, which already declare
tox/tox-uv. Remove the added line to keep this consistent.

* fix: give django42/django52 tox envs genuinely independent locked resolutions

[project].dependencies had an unconstrained "Django" entry, so uv.lock
resolved a single Django version (5.2.x) for the whole project. The
django42 tox env then force-overrode just the Django package afterward
via tox's deps=, while every other locked/transitive dependency stayed
resolved against the Django-5.2 graph -- not a real, independent
resolution for the 4.2 case.

Add a django42 dependency-group pinning Django>=4.2,<4.3, pin the
default test group to Django>=5.2,<6.0, and declare the two as
conflicting via [tool.uv].conflicts so uv locks a genuine fork for
each. Update tox.ini's testenv/pii_check envs to select the matching
group per Django factor instead of overriding just the Django package.

`uv lock` confirms this was a real bug: django-filter also forks to
25.1 (django42) vs 25.2 (django52) -- the single prior resolution had
been silently testing 4.2 against a django-filter version potentially
never resolved against Django 4.2's constraints.

Verified locally (mysqlclient excluded due to a sandbox limitation
building it; unrelated to this change): `uv sync --group django42` and
`--group test` each install the correct, independently-resolved Django
version, `manage.py check` and the full pytest suite (34 passed) pass
under both, and quality/pii_check pass under django42.

* fix: regenerate uv.lock to fix ordering left by the main merge

The merge of origin/main into this branch auto-merged uv.lock as plain
text (it wasn't flagged as conflicted), which left the auto-derived
[tool.uv]-conflicts expansion for the django42 group with its "doc"
and "quality" entries swapped relative to what a fresh `uv lock`
produces. uv 0.11.33 (what CI's setup-uv currently installs) treats
this as a stale lockfile and fails `--locked`/`--check`; the slightly
older uv 0.11.30 tolerated it, which is why this wasn't caught before
pushing.

Verified: `uv lock --check` and `uv sync --locked --group <g>` pass
clean uv 0.11.33 for django42/test/quality/dev/ci; pytest (34 passed),
manage.py check, pylint/pycodestyle/isort, and pii_check all pass
under both django42 and django52.

* fix: upgrade locked uv package to match CI's system uv version

The previous push's lockfile fix regenerated uv.lock with system uv
0.11.33, but the "uv" PyPI package itself (a transitive dependency of
tox-uv-bare, used internally by tox-uv's uv-venv-lock-runner inside
each tox env) was still locked at the older 0.11.28. These two uv
releases disagree on the canonical serialized order of the
auto-derived [tool.uv].conflicts entries, so whichever version last
wrote the lock, the other considered it stale under --locked -- CI's
"Install Dependencies" step (system uv, "latest" via setup-uv) and its
"Run Tests" step (tox-uv's pinned "uv" package) were fighting each
other.

`uv lock --upgrade-package uv` bumps the locked uv package to 0.11.33,
matching today's system uv, so both steps agree.

Verified: `uv sync --locked --group <g>` passes clean under uv 0.11.33
(matching CI) for django42/test/quality/doc/dev/ci; pytest (34 passed)
and quality checks pass under both django42 and django52.

* fix: pii_check env has no django42/django52 factor in its name

Unlike [testenv] (whose generated env names py312-django42/py312-django52
genuinely contain those factors), [testenv:pii_check] is a fixed-name
env ("pii_check"), so a factor-conditional dependency_groups (as used
for [testenv]) never matches and left pii_check with zero groups
installed -- confirmed by CI: "Exception running subprocess [Errno 2]
No such file or directory: 'code_annotations'".

pii_check was never actually parametrized by Django version (its old
deps= factor overrides were dead code for the same reason), so restore
its original always-on `test` group, matching quality/docs' pattern of
an unconditional dependency_groups for fixed-name envs.

Verified via `tox config -e <env>` that django42/django52/pii_check/
quality/docs all resolve to the intended group, and that
code_annotations (pii_check) now installs and runs successfully.

* fix: restore CHANGELOG.rst and re-enable semantic-release changelog generation

A previous migration pass deleted CHANGELOG.rst and set changelog: "false" in
release.yml's python-semantic-release step. There is no ticket requirement to
disable changelog generation, and deleting the file discarded real historical
release notes. Restore CHANGELOG.rst from the commit before its deletion, add
the insertion marker PSR's "update" mode looks for, remove the changelog:
"false" override, and configure [tool.semantic_release.changelog] to update
the existing RST file in place.

* chore: remove stale version-bump/changelog checklist items from PR template

python-semantic-release now handles both version bumping and changelog
generation automatically on release, so these manual checklist items are
obsolete.

* docs: remove stale manual tag/PyPI-verification steps from PR template

python-semantic-release's release.yml now creates the tag and publishes
to PyPI automatically on merge -- these were no longer real manual steps.

* fix: use int-parseable fallback_version instead of 0.0.0.dev0

"0.0.0.dev0" is the exact fallback_version value that crashed 17 tests
in a sibling repo (openedx-events) -- runtime code that parses
__version__ via tuple(map(int, __version__.split("."))) chokes on the
non-numeric "dev0" segment. No current consumer here does that (this
repo's own __version__ usage, if any, only interpolates it as a
string), but there's no reason to keep a fallback value from the exact
banned-pattern class when a plain int-parseable "0.0.0" is equally
valid and strictly safer.

* fix: disable python-semantic-release changelog generation

Set changelog: "false" on the PSR release step and remove the
[tool.semantic_release.changelog] config / insertion marker.

Checked against openedx/XBlock's actual production release.yml (the one
repo in this effort that has cut real automated releases) -- every run
passes changelog: false and invokes `semantic-release -v version
--no-changelog`, and the repo has zero github-actions[bot] commits ever.
The auto-changelog config this migration previously added was only ever
verified via a local dry-run prototype, never against a real release.

feanil flagged the same issue on openedx/DoneXBlock#388: "I thought we
were not going to add changelogs since they can't be updated by
python-semantic-release the way we have it setup."

* docs: update README dev workflow to use uv instead of raw pip install -e

pip install -e + pip freeze + source venv/bin/activate predates the uv
migration -- make requirements (uv sync) now installs this repo into its
own .venv already, and there's no venv/ directory to activate.

* fix: use stable pypa publish tag, drop tox from Makefile targets

- pypa/gh-action-pypi-publish: revert the hash-pinned SHA back to the
  stable @release/v1 tag, matching the rest of this effort's PRs. A
  hash-pinned version broke PyPI publishing previously for this org.
- Makefile docs/quality/pii_check targets: inline the actual tox.ini
  commands via uv run/uv sync instead of shelling out to `uv run tox -e
  <env>`, matching the no-tox-in-Makefile convention already used
  elsewhere (edx-enterprise, enterprise-access). tox.ini itself is
  untouched; test-all still uses bare `uv run tox` for the actual
  Python/Django matrix run, which is what tox is for.

* fix: upgrade edx-lint to 6.2.0 to match merged pylintrc

The just-merged pylintrc (from main) was regenerated by edx-lint 6.2.0
and adds the new pii-invalid-no-pii-annotation check's [PII] pii-terms
option. Our lock was still on edx-lint 6.1.0, whose pylint plugin
doesn't recognize that option, breaking `make quality` with
E0015: Unrecognized option found: pii-terms.

* fix: delete CHANGELOG.rst

Automation is disabled (changelog: false) and the file was already told to farhan as removed; a later commit re-enabled/disabled automation without re-deleting it. Deleting for real this time, matching the batch convention.

* fix: create GitHub release with assets attached, not after publish

This repo has immutable releases enabled, which freezes a release's assets the moment it's published. The old flow (main PSR step publishes the release, a separate publish-action step attaches assets afterward) can never work under that constraint -- it would 422 on the first real release. Matches the fix already proven and merged on openedx/sample-plugin#57 and validated end-to-end on openedx/event-tracking#434: build without publishing (vcs_release: false), then create the release with dist/* attached in one gh release create call.

* fix: pin release.yml actions to gold-standard SHAs from openedx/sample-plugin

actions/checkout, python-semantic-release, actions/upload-artifact and
actions/download-artifact were pinned to outdated commit SHAs, and
pypa/gh-action-pypi-publish was pinned to the floating `release/v1` tag
rather than a commit SHA at all (a supply-chain risk, since that tag can be
moved). Bring all five in line with the versions already verified against
openedx/sample-plugin's release.yml (v7.0.1, v10.6.2, v7.0.1, v8.0.1, and
v1.14.2 respectively), each cross-checked via `gh api .../commits/<sha>`
and the corresponding tag ref. This repo's custom draft-release step (to
work around immutable-releases freezing assets) and its branch-conditional
guard were already correct and are left as-is.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: restore CHANGELOG.rst

Reverses 1a91f62 per explicit user decision -- keeping the historical
changelog intact as a plain static file (no insertion marker, no
semantic-release wiring; automation stays disabled via changelog:
"false" in release.yml, unchanged).

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: use v-prefixed tag_format for release tag consistency

* fix: update author to Open edX Project convention

* fix: restore __version__ dropped during pyproject.toml consolidation

9a6b160 removed the hardcoded __version__ = "1.8.0" (correctly, since
version is now dynamic via setuptools-scm) but never replaced it with
the importlib.metadata equivalent, unlike every sibling repo in this
migration batch. openedx_ledger.__version__ has been silently missing
since. Restored using the same pattern used elsewhere.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: address farhan's review comments on PR #242

- Consolidate tox.ini's docs env to call `make docs` instead of
  duplicating the doc8/sphinx-build commands in both places.
- Verifying that consolidation surfaced make docs itself was broken:
  a stray trailing-whitespace doc8 failure and two docstrings with
  malformed RST (missing blank lines, informal "params:" list not
  valid RST) that only ever got exercised once `docs` became a real
  tox env. Fixed all three; make docs and tox -e docs both pass now.
- Drop the browser-open step from the Makefile's docs target so it
  doesn't try to launch a browser when invoked from CI via tox.
- Add deprecation notice to CHANGELOG.rst now that release.yml
  publishes real GitHub Releases.
- Switch release.yml's python-semantic-release step to secrets.GITHUB_TOKEN,
  matching openedx/sample-plugin's current release.yml, removing the
  dependency on an org-level secret that isn't in the pre-merge checklist.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: drop uv run from Makefile per feanil's review feedback

Makefile now assumes an already-synced/activated local env; uv run
stays in CI workflow steps only. See openedx-unsupported/ccx-keys#190 (review
comment r4097501942).

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: address feanil's review on Makefile/README/Dockerfile/pyproject.toml

- Makefile: remove `uv sync --group doc`/`uv sync --group quality` from
  the docs/quality targets. These re-provisioned .venv down to a smaller
  group mid-run, pruning tools (pylint, tox) that later targets in the
  same session (make test-all) needed. The Makefile should use whatever
  env the caller already has active, not manage it.
- README.rst: add the missing `source .venv/bin/activate` step after
  `make requirements` in the documented dev workflow -- `uv sync`
  creates .venv but doesn't activate it, so `make validate` right after
  failed at `make clean`'s `coverage erase` with "not found".
- Dockerfile: switch from `pip install -r requirements/dev.txt` (a
  directory this migration deletes) to `uv sync --locked
  --no-install-project --group dev` against the committed
  pyproject.toml/uv.lock, with UV_PROJECT_ENVIRONMENT pointing at the
  existing custom venv path. --no-install-project matches the original
  behavior, which never pip-installed the local package either (tests
  run from the source tree). Verified the actual uv sync mechanism
  directly (UV_PROJECT_ENVIRONMENT + --no-install-project correctly
  populates an arbitrary pre-existing venv with only third-party deps).
  Full container build couldn't be verified end-to-end: this repo's
  Dockerfile has a separate, pre-existing bug unrelated to this PR --
  python3.12/python3.12-venv aren't available in stock Ubuntu focal apt
  repos on any architecture without a deadsnakes-PPA-style addition,
  confirmed blocking the apt-get layer before this change's layer even
  runs. Left unfixed as out of scope for this migration.
- pyproject.toml: drop the `[tool.coverage.html]`/`[tool.coverage.xml]`
  path overrides (build/coverage/html, build/coverage/coverage.xml) so
  coverage output goes back to the default htmlcov/coverage.xml paths
  the Makefile's coverage/diff_cover targets actually read from;
  verified with a local coverage run. Also corrected the tag_format
  comment, which claimed no v-prefixed tag existed -- v2.0.0 already
  does, same commit as the old bare 2.0.0 tag.

Per feanil's review on this PR: discussion_r4105646132, r4105646142,
r4105646152, r4105646158, r4105646167, r4105646180, r4105646189.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: delegate tox quality env to make quality, re-lock

tox.ini's [testenv:quality] duplicated the exact same 5 commands as
the Makefile's quality target -- a second copy to keep in sync by
hand. [testenv:docs] already delegates as `commands = make docs`;
match that pattern for quality too.

Also regenerated uv.lock: `uv sync --locked` was failing with
"needs to be updated" again, caused by an upstream index change
(build==1.5.1 was yanked from PyPI after the lockfile was last
generated), not anything in this PR's own diff.

Per feanil's review on #242:
discussion_r4122549288, r4122577078.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: tighten tag_format comment wording

Per feanil's exact suggested phrasing on #242
(discussion_r4122562412).

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: use glob-CONTAINS exclude pattern for tests packages

packages.find.exclude was "*tests" (suffix-only), which misses nested
namespace test packages like foo.bar.tests.fixtures since setuptools
matches exclude patterns against the full dotted package name. Changed
to "*tests*" per org-wide packaging convention for this migration batch.

Verified: wheel builds clean, still 38 files (same as before), all 34
tests pass.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: include doc group in dev, bump python-semantic-release pin to v10.7.0

- Fold {include-group = "doc"} into the dev dependency-group so `make
  requirements` (uv sync --group dev) provisions doc8/Sphinx; without
  it, `make docs` fails on a fresh clone with "doc8 not found". Matches
  the pattern already used in edx-enterprise's pyproject.toml.
- Bump python-semantic-release/python-semantic-release pin from
  9a026e9303981c866c3425723009becb2437c757 (v10.6.2) to
  b700dbeb1f431a0fcc30a79f3f0869407fe07278 (v10.7.0), matching
  sample-plugin's current live pin.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: explicit uv.lock conflicts ordering, delegate pii_check to make, fix Dockerfile for real

- pyproject.toml: enumerate every group that includes `test` (test, quality,
  doc, dev) against django42 explicitly in [tool.uv].conflicts, instead of
  letting uv derive the pairing implicitly. The derived order varied between
  uv versions (passing on 0.10.0/0.11.0, failing on 0.11.32/0.12.0/0.12.19),
  making `uv lock --check`/`uv sync --locked` version-dependent. Verified
  passing against uv 0.10.0, 0.11.28, and 0.12.19 with the regenerated lock.

- tox.ini: [testenv:pii_check] now delegates to `make pii_check` instead of
  duplicating its command inline, matching [testenv:quality]/[testenv:docs].

- Dockerfile: switch FROM ubuntu:focal to ubuntu:noble (24.04), since focal
  never had python3.12/python3.12-venv packages at all. Drop the system-wide
  `pip install --upgrade pip setuptools` (debian's python3-pip on noble can't
  be upgraded in place and PEP 668 blocks it anyway; nothing depends on the
  system Python since everything runs in the venv). Fix the --no-install-project
  mismatch: the local package now lives under src/ and was never actually
  getting installed, so the full source tree is now COPY'd in and a second
  `uv sync --locked --group dev` (without --no-install-project) installs the
  local project from its real src/ layout. This is a two-stage sync: the
  first, --no-install-project sync stays cached as long as
  pyproject.toml/uv.lock don't change; the second (fast) one reruns on every
  source change, since it has to. Added .dockerignore so local build/test
  artifacts (.tox/, __pycache__/, etc.) that may exist in the working tree
  don't get copied into the image root-owned, which would otherwise break
  `make clean` for the unprivileged app user.

Verified: `docker build` succeeds from a clean `--no-cache` build, the
resulting image imports openedx_ledger correctly, and `make test`/
`make pii_check` pass via `docker-compose`'s bind-mount usage pattern
(34 tests passed, 94% coverage).

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: add --locked to ci.yml's uv sync/uv run tox steps

This was requested on discussion_r4137487159 and mistakenly reported
as already done -- it wasn't actually pushed. Adding it now for real:
CI will now fail loudly if uv.lock doesn't match pyproject.toml,
instead of silently relocking in the runner.

Per feanil's review on #242: discussion_r4137487159.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

---------

Co-authored-by: Irfan Ahmad <[email protected]>
Co-authored-by: Claude Sonnet 5 <[email protected]>
irfanuddinahmad added a commit to openedx/enterprise-integrated-channels that referenced this pull request Oct 12, 2026
…e) (#180)

* feat: consolidate package metadata into pyproject.toml

Replace setup.py/setup.cfg with PEP 621 [project] metadata and
setuptools-scm for git-tag-based versioning.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* feat: switch dependency management from pip-compile to uv

Replace requirements/*.in + *.txt with PEP 735 dependency-groups in
pyproject.toml and a single uv.lock. Update tox.ini to use tox-uv's
uv-venv-lock-runner, update Makefile targets, and switch CI to install
uv and run tests via `uv run tox`. Point .readthedocs.yaml at uv too,
since it referenced the now-deleted requirements/doc.txt.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* feat: add semantic-release for automated PyPI publishing

Replace the manual GitHub-release-triggered publish workflow with
python-semantic-release: pushes to main with conventional commits
now automatically bump the version, tag it, and publish to PyPI.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: correct release tag format and drop stale MANIFEST.in entries

semantic-release defaults to a "v{version}" tag format, but this repo's
existing release tags are bare version numbers -- without tag_format set,
semantic-release wouldn't recognize any prior release. Also removes
MANIFEST.in references to requirements/base.in and requirements/constraints.txt,
which no longer exist after the uv migration.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: prevent uv sync from implicitly pulling in the dev group

Every uv sync/uv run invocation in this repo names an explicit --group,
but uv's implicit default group (named "dev") was still being synced
alongside it, silently pulling the entire dev/test/quality/ci superset
into every target. Verified with `uv sync --group ci`.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: publish to PyPI via OIDC instead of token

Parent issue openedx/public-engineering#506 asks for OIDC trusted-publisher
PyPI auth, not a stored token. Grant id-token: write on publish_to_pypi and
drop the explicit __token__/PYPI_UPLOAD_TOKEN credentials -- pypa/gh-action-pypi-publish
uses OIDC automatically once the permission is present and no credentials are given.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: prevent premature 1.0 bump and pin pypa/gh-action-pypi-publish

- major_on_zero defaults to True in python-semantic-release, which would
  auto-bump this still-0.x repo straight to 1.0.0 on the first breaking-change
  commit. 1.0.0 is supposed to be a deliberate "first stable release" signal,
  not an accidental side effect -- keep 0.x bumps within 0.x until that's an
  intentional decision (allow_zero_version stays true so 0.x remains valid).
- @release/v1 is a floating branch ref -- xblocks-core's release just failed
  with "docker: manifest unknown" because the Docker image tag it resolved to
  at checkout time wasn't published on ghcr.io yet. Pin to the exact commit
  backing the current v1.14.0 release instead.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* refactor: adopt src-layout, matching openedx/sample-plugin

Moves channel_integrations/ to src/channel_integrations/, in line with
the reference implementation for this modernization effort
(openedx/sample-plugin) and openedx/forum#281.

- pyproject.toml: add where = ["src"] to packages.find
- tox.ini: prefix src/ onto pylint/pycodestyle targets in the quality env
- Makefile: prefix src/ onto all 5 localization targets (extract,
  compile, detect_changed, pull, dummy); atlas pull's local destination
  path updated, remote Transifex identifier left unchanged
- test_settings.py: LOCALE_PATHS root() call updated
- docs/conf.py: sphinx-apidoc call updated to point at src/channel_integrations
- MANIFEST.in: recursive-include path updated

Verified: uv sync (no lock drift), full django42 test run (893 passed),
quality and pii_check envs pass, uv build --wheel + twine check pass.

The docs tox env fails both before and after this change (a pre-existing
sphinx/autodoc ValueError in object_description, unrelated to src-layout
and unrelated to this repo's file layout) -- confirmed by reproducing the
identical failure on the pre-migration commit via git stash.

* fix: pattern-gap audit (uv setup, package=true, coverage, changelog)

Same category of fixes farhan flagged on the batch's other reviewed PRs:

- ci.yml: add enable-cache/python-version to astral-sh/setup-uv and drop
  the now-redundant actions/setup-python step
- pyproject.toml: add [tool.uv] package = true
- Drop CHANGELOG.rst from the dynamic readme file list and delete it --
  python-semantic-release + GitHub Releases is the changelog of record.
  Also removes the now-stale MANIFEST.in include and the docs/changelog.rst
  page (and its toctree entry).
- Migrate .coveragerc into [tool.coverage.run] and delete the old file

Verified: uv sync (no lock drift), full django42 test run (893 passed),
quality env passes. docs env still fails on the same pre-existing
sphinx/autodoc ValueError already documented in this repo's src-layout
commit (confirmed via git stash at that time it predates and is
unrelated to any of our changes) -- docs isn't part of the CI matrix.

* fix: pattern-gap audit round 2 (uv run wrapping, dynamic readme, tox envlist, readthedocs os)

Cross-checked against review comments/fixes from openedx-ledger#242,
edx-enterprise-subsidy-client#222, enterprise-access#1015, and
enterprise-subsidy#441.

- Wrap remaining bare tool invocations in the Makefile (coverage erase,
  pytest --cov-report html, PYTHONPATH pytest, diff-cover, i18n_tool,
  manage.py compilemessages) with `uv run`. Transifex's tx binary is left
  bare since it's installed via curl, not uv/pip.
- Drop the redundant dynamic readme field; keep only version as dynamic.
- Match the py{311}-django{42,52} brace convention in the tox envlist.
- Bump Read the Docs build image to ubuntu-26.04.

* fix: correct Makefile recipe indentation (tabs, not spaces)

Make requires recipe lines to be indented with a literal tab
character. An earlier edit in this migration accidentally used
spaces for several targets and dropped the ifeq(OPENEDX_ATLAS_PULL)
conditional line, breaking 'make selfcheck' and CI.

* fix: restore CHANGELOG.rst and re-enable changelog generation

A previous migration pass deleted CHANGELOG.rst and disabled
python-semantic-release's changelog generation (changelog: "false" in
release.yml). Neither was required by the tooling-modernization ticket,
and deleting the file discarded real historical release notes.

- Restore CHANGELOG.rst from the commit before it was deleted
- Add the .. changelog-insertion-marker as the first line so PSR's
  "update" mode inserts new release notes above existing history
- Remove changelog: "false" from release.yml's PSR step
- Add [tool.semantic_release.changelog] config to pyproject.toml,
  pointing PSR at the restored CHANGELOG.rst in RST format
- tag_format was already correctly set to "{version}" matching this
  repo's bare version tags (e.g. 0.1.65), no change needed there

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* docs: remove stale version-bump/changelog checklist items from PR template

python-semantic-release now handles versioning and changelog generation
automatically, so asking PR authors to manually bump the version or add
a changelog record is obsolete and was left over from before that
automation was wired up.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: use stable pypa publish tag and drop tox from Makefile

- pypa/gh-action-pypi-publish: revert the hash-pinned SHA back to the
  stable @release/v1 tag. A hash-pinned version of this action broke
  PyPI publishing previously, which is why the org standardized on the
  stable tag for this specific action.
- Makefile: inline the actual doc8/sphinx/pylint/pycodestyle/
  code_annotations commands from tox.ini's docs/quality/pii_check envs
  instead of shelling out to `uv run tox -e ...`, matching the
  no-tox-in-Makefile convention already used elsewhere (e.g.
  enterprise-catalog). test-all now depends on quality/pii_check/test/
  docs directly. tox.ini itself is untouched; CI's own matrix testing
  still uses tox directly.

* fix: use int-parseable fallback_version instead of 0.0.0.dev0

"0.0.0.dev0" is the exact fallback_version value that crashed 17 tests
in a sibling repo (openedx-events) -- runtime code that parses
__version__ via tuple(map(int, __version__.split("."))) chokes on the
non-numeric "dev0" segment. No current consumer here does that (this
repo's own __version__ usage, if any, only interpolates it as a
string), but there's no reason to keep a fallback value from the exact
banned-pattern class when a plain int-parseable "0.0.0" is equally
valid and strictly safer.

* fix: disable python-semantic-release changelog generation

Set changelog: "false" on the PSR release step and remove the
[tool.semantic_release.changelog] config / insertion marker.

Checked against openedx/XBlock's actual production release.yml (the one
repo in this effort that has cut real automated releases) -- every run
passes changelog: false and invokes `semantic-release -v version
--no-changelog`, and the repo has zero github-actions[bot] commits ever.
The auto-changelog config this migration previously added was only ever
verified via a local dry-run prototype, never against a real release.

feanil flagged the same issue on openedx/DoneXBlock#388: "I thought we
were not going to add changelogs since they can't be updated by
python-semantic-release the way we have it setup."

* fix: create GitHub release with assets attached, not after publish

This repo has immutable releases enabled, which freezes a release's assets the moment it's published. The old flow (main PSR step publishes the release, a separate publish-action step attaches assets afterward) can never work under that constraint -- it would 422 on the first real release. Matches the fix already proven and merged on openedx/sample-plugin#57 and validated end-to-end on openedx/event-tracking#434: build without publishing (vcs_release: false), then create the release with dist/* attached in one gh release create call.

* fix: conform release.yml action pins to sample-plugin gold standard

release.yml's actions/checkout, python-semantic-release, upload-artifact,
and download-artifact pins were all stale relative to
openedx/sample-plugin's release.yml, this org's designated reference for
this file. Also re-pins pypa/gh-action-pypi-publish to a SHA
(dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2), reversing an earlier
revert to @release/v1 that was made on this PR at salman2013's request
after a prior SHA-pin caused issues. That guidance has since been
superseded: salman2013 has since directed (on a sibling repo's PR) to
match sample-plugin exactly, which now itself SHA-pins
gh-action-pypi-publish at v1.14.2.

Every pin below was independently verified against the GitHub API before
use (commit resolves, and matches its claimed tag, dereferencing through
the tag object for annotated tags):
- actions/checkout -> 3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- python-semantic-release/python-semantic-release ->
  9a026e9303981c866c3425723009becb2437c757 # v10.6.2
- actions/upload-artifact -> 043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
- actions/download-artifact -> 3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
- pypa/gh-action-pypi-publish -> dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: reconcile CHANGELOG.rst with main after rebase

The CHANGELOG.rst restoration commit recreated the file from a fixed
snapshot frozen at 0.1.62. Rebasing onto current main (now at 0.1.69)
exposed that the restoration doesn't track main's ongoing history --
it's a one-time static blob, not a merge. Replaced with main's actual
current content, restoring the 7 missing entries (0.1.63-0.1.69)
between Unreleased and 0.1.62, including PR #197's entry that
collided with this rebase.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: use v-prefixed tag_format for release tag consistency

* fix: use secrets.GITHUB_TOKEN instead of custom org secret for release job

Matches openedx/sample-plugin's current release.yml; the custom
OPENEDX_SEMANTIC_RELEASE_GITHUB_TOKEN secret isn't needed.

* fix: restore tox delegation for docs/quality/pii_check targets

Makefile targets were fully inlining commands that tox.ini already
defines as standalone envs (docs, quality, pii_check), restoring the
pre-migration one-liner tox -e <env> delegation.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: drop uv run from Makefile per feanil's review feedback

Makefile now assumes an already-synced/activated local env; uv run
stays in CI workflow steps only. See openedx-unsupported/ccx-keys#190 (review
comment r4097501942).

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: bump python-semantic-release pin to v10.7.0, add doc group to dev, add signxml dep

- Bump python-semantic-release action pin from v10.6.2 to v10.7.0
  (b700dbeb1f431a0fcc30a79f3f0869407fe07278), matching openedx/sample-plugin's
  current live pin.
- Fold {include-group = "doc"} into the dev dependency-group so `make
  requirements` (uv sync --group dev) provisions doc8/Sphinx, matching the
  pattern already correct in openedx/edx-enterprise's pyproject.toml.
- Add signxml (pulled in transitively via the SAML assertion generator added
  on main in #201/#206) to [project.dependencies], since this migration
  replaced requirements/base.in with pyproject.toml as the source of truth
  for runtime dependencies and base.in's new direct dependency needs an
  equivalent entry there. Re-lock uv.lock accordingly.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

---------

Co-authored-by: Irfan Ahmad <[email protected]>
Co-authored-by: Claude Sonnet 5 <[email protected]>
feanil added a commit to openedx/edx-enterprise that referenced this pull request Nov 3, 2026
…e) (#2654)

* feat: consolidate package metadata into pyproject.toml

Replace setup.py/setup.cfg with PEP 621 [project] metadata and
setuptools-scm for git-tag-based versioning. The `braze` extras_require
becomes a real [project.optional-dependencies] extra. enterprise/__init__.py's
__version__ (used at runtime by cache_utils.versioned_cache_key) now derives
from importlib.metadata instead of a hand-maintained string.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* feat: switch dependency management from pip-compile to uv

Replace requirements/*.in + *.txt with PEP 735 dependency-groups in
pyproject.toml and a single uv.lock. Update tox.ini to use tox-uv's
uv-venv-lock-runner, update the Makefile and Dockerfile, and switch
ci.yml/mysql8-migrations.yml/postgresql-migrations.yml to install uv
and run via `uv run tox` / `uv sync`.

The openedx-platform pin-matching mechanism (requirements/edx-platform-constraints.txt
+ check_pins.py, refreshed via curl in `make upgrade`) is replaced by
requirements/sync_platform_constraints.py, which merges edx-platform's
compiled pins directly into [tool.uv].constraint-dependencies (run after
`edx_lint write_uv_constraints`, which owns/overwrites that same list, and
before `uv lock --upgrade`). pyyaml is excluded from that merge: the
js_test group's jasmine dependency hard-pins pyyaml far below what
edx-platform pins, so js_test is declared a conflicting resolution fork
via [tool.uv].conflicts rather than forced into one unresolvable graph.

Verified locally: `uv lock` resolves cleanly (253 packages), and
`uv sync --group test --no-default-groups` succeeds without needing any
native build (no mysqlclient dependency in this repo). Running the actual
test suite hits a local-machine-only lxml/xmlsec libxml2 version mismatch
unrelated to this migration (the Dockerfile's apt-installed toolchain
avoids this; CI should verify cleanly).

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* feat: add semantic-release for automated PyPI publishing

Replace the manual GitHub-release-triggered publish workflow with
python-semantic-release: pushes to master with conventional commits now
automatically bump the version, tag it, and publish to PyPI. The old
publish.yml also ran `make pull_translations` before building -- that
Transifex pull is dropped here since automating it would need new
release-pipeline secrets; translations continue to be refreshed via the
existing separate mechanisms (pull_translations/push_translations Makefile
targets), just no longer implicitly re-run on every release.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: pin pylint/astroid and fix lxml extras parsing in platform constraint sync

CI surfaced two real bugs from the initial migration:

1. The `pylint<4` constraint under-specified a floor, so uv's fresh
   resolution (unconstrained by the old pip-compile lock's specific pins)
   picked ancient pylint==2.3.0 + modern astroid==4.1.2 -- an incompatible
   pair (astroid.TryExcept was removed years ago). Tightened to
   `pylint>=3,<4` + a new `astroid>=3,<4` constraint, matching what the old
   lock actually resolved (pylint==3.3.9, astroid==3.3.11).

2. sync_platform_constraints.py's regex didn't handle extras syntax
   (`lxml[html-clean]==5.3.2`), so it silently skipped openedx-platform's
   lxml pin. uv then resolved lxml to 6.1.1, which bundles a newer libxml2
   than xmlsec==1.3.14 was built against, causing
   "xmlsec.InternalError: lxml & xmlsec libxml2 library version mismatch"
   at runtime (anything importing python3-saml/social_core's SAML backend).
   Fixed the regex to allow an optional `[...]` extras group before `==`.

Verified locally: pylint passes clean (exit 0), and the full test suite
passes (2835 passed, 12 skipped).

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: docs testenv build+twine chain (locale symlink, twine pin, setuptools)

Three more issues surfaced once the astroid/lxml fixes let the "docs"
toxenv actually run python -m build + twine check for the first time
(the old setup.py-based system never exercised this exact check):

1. enterprise/locale is a tracked symlink to enterprise/conf/locale
   (needed for Django's i18n app-discovery at runtime). Wheel building
   choked on it ("can't copy 'enterprise/locale': doesn't exist or not
   a regular file") since MANIFEST.in's recursive-include picked it up
   as a file, not a directory to descend into. `exclude enterprise/locale`
   drops the symlink from the file list while the real files under
   enterprise/conf/locale/ (which the symlink points to) still get
   packaged via the same recursive-include pattern.

2. The dev group hard-pinned twine==1.11.0 (carried over verbatim from
   the original dev.in, never previously exercised for `twine check`
   since the old publish.yml uploaded via a GitHub Action, not the
   repo's own twine). twine 1.11.0 predates the `check` subcommand
   entirely. Removed the redundant pin -- dev already gets twine
   unpinned via its existing {include-group = "doc"}.

3. setuptools>=82 dropped pkg_resources, which twine still imports --
   same issue openedx-platform already hit and documented. Added
   "setuptools<82" alongside the other repo-specific constraints.

Verified locally end-to-end: python -m build --wheel succeeds and
twine check dist/* reports PASSED.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: restore pycodestyle config lost when setup.cfg was removed

CI failed with pycodestyle reporting hundreds of E501 line-too-long
violations at the default 79-char limit. The [pycodestyle] section
originally lived in setup.cfg (not tox.ini, unlike most of the other
repos in this migration), and I dropped it entirely when deleting
setup.cfg instead of carrying it into tox.ini. Restored verbatim:
ignore=E501,W503,W504 (this repo doesn't enforce a line-length limit)
and the settings/migrations/static excludes. Also added the missing
known_edx = [] to [tool.isort] to silence an isort warning about an
empty "EDX" section.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: drop stale MANIFEST.in requirements entries and dead exclusion check

Removes MANIFEST.in references to requirements/*.txt/*.in and
requirements/constraints.txt, which no longer exist after the uv migration.

Also removes a no-op filter in sync_platform_constraints.py: pip-compile
puts a package's "# via edx-enterprise" annotation on the line *after*
its pin, so the same-line endswith() check never actually matched
anything (verified against the live platform base.txt). The 8 affected
packages were already being merged in regardless; this just removes the
dead code and its now-inaccurate comment rather than changing behavior.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: prevent uv sync from implicitly pulling in the dev group

Every uv sync/uv run invocation in this repo names an explicit --group,
but uv's implicit default group (named "dev") was still being synced
alongside it, silently pulling the entire dev/test/quality/ci superset
into every target. Verified with `uv sync --group ci`.

Also adds .venv/ to .gitignore alongside the existing venv/ entry.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: mark openedx-platform-synced pins with provenance comments

constraint-dependencies mixes edx_lint-managed constraints with
openedx-platform pins as plain strings, with no way to tell them apart
once merged. Fence the platform block with begin/end comment markers
so a reviewer scanning the array can see which entries are
auto-synced and shouldn't be hand-edited.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: publish to PyPI via OIDC instead of token

Parent issue openedx/public-engineering#506 asks for OIDC trusted-publisher
PyPI auth, not a stored token. Grant id-token: write on publish_to_pypi and
drop the explicit __token__/PYPI_UPLOAD_TOKEN credentials -- pypa/gh-action-pypi-publish
uses OIDC automatically once the permission is present and no credentials are given.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: pin pypa/gh-action-pypi-publish to a commit SHA

@release/v1 is a floating branch ref -- xblocks-core's release just failed
with "docker: manifest unknown" because the Docker image tag it resolved to
at checkout time wasn't published on ghcr.io yet. Pin to the exact commit
backing the current v1.14.0 release instead, consistent with this repo's
own SHA-pinning rule for every other action.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: set major_on_zero=false and allow_zero_version=true for consistency

Reviewer feedback: this should be set across the whole batch, not just
repos currently on 0.x, so no repo in this effort can ever auto-jump to
1.0.0 as an accidental side effect if it's reset to 0.x in the future.
Note this is a no-op for repos already past 1.0 -- major_on_zero only
governs the 0.x -> 1.0.0 transition, not 1.x -> 2.0.0 (there's no PSR
setting that suppresses major bumps once past 1.0; that's normal SemVer
behavior for a breaking-change commit at any version).

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* refactor: adopt src-layout, matching openedx/sample-plugin

Moves all four top-level packages (enterprise, consent, integrated_channels,
enterprise_learner_portal) to src/, in line with the reference implementation
for this modernization effort (openedx/sample-plugin) and openedx/forum#281.
Most complex repo in this batch: 4 packages, an in-package path helper with
real call sites, and JS tooling (webpack, jasmine) alongside the Python side.

- pyproject.toml: add where = ["src"] to packages.find
- tox.ini: prefix src/ onto the pycodestyle exclude list and onto every
  package name in the isort/isort-check/quality env commands
- Makefile: prefix src/ onto clean.static, dummy_translations,
  pull_translations (local destination paths only -- the Transifex/Atlas
  remote path identifiers are left unchanged), jshint, pylint, pycodestyle,
  isort, and isort-check targets
- docs/conf.py: sphinx-apidoc call updated to point at src/enterprise
- webpack.config.js: build context path updated to src/enterprise/static/enterprise
- spec/javascripts/support/jasmine.yml: src_files glob updated to
  src/enterprise/static/enterprise/js/*.js
- MANIFEST.in: all four recursive-include paths and the enterprise/locale
  symlink exclusion updated
- enterprise/settings/test.py: this repo's in-package here()/root() path
  helper climbs from src/enterprise/settings/ back to the repo root --
  fixed the climb from '../..' (2 levels) to '../../..' (3 levels), and
  updated its 3 real call sites (LOCALE_PATHS, REPO_ROOT, STATIC_ROOT) to
  prepend 'src' so they still resolve inside the package. The symlink
  enterprise/locale -> conf/locale is relative and moved as a unit with
  git mv, so it still resolves correctly post-move -- verified.

Verified: uv sync (no lock drift), full py312-django52 test run (2849
passed), quality (pylint/pycodestyle/isort), isort-check, and pii_check
envs pass, docs env passes end to end -- sphinx-apidoc generates real API
docs from the new path, uv build --wheel + twine check pass. A pylint
useless-suppression info note in integrated_channels/cornerstone/models.py
is pre-existing (confirmed identical on the pre-migration commit via git
stash), unrelated to this change.

* fix: pattern-gap audit (uv setup, package=true, coverage, changelog)

Same category of fixes farhan flagged on the batch's other reviewed PRs,
applied here proactively since this repo has the identical modernization
shape:

- ci.yml: add enable-cache/python-version to astral-sh/setup-uv and drop
  the now-redundant actions/setup-python step
- pyproject.toml: add [tool.uv] package = true
- Drop CHANGELOG.rst from the dynamic readme file list and delete it --
  python-semantic-release + GitHub Releases is the changelog of record.
  Also removes the stale MANIFEST.in include and the docs/changelog.rst
  page (its own dedicated toctree block in docs/index.rst).
- Migrate .coveragerc into [tool.coverage.*] and delete the old file --
  also fixed a real gap in the process: the original only listed
  source=enterprise and enterprise/settings,enterprise/conf in omit,
  silently missing coverage scoping for the other 3 packages
  (enterprise_learner_portal, consent, integrated_channels) even though
  addopts already covers all 4 with --cov. Generalized the omit patterns
  to */settings/*, */conf/* etc. so they apply consistently across all
  four packages, matching what's actually being measured.

Verified: uv sync (no lock drift), full py312-django52 test run (2849
passed), quality and docs envs pass end to end -- docs env's build +
twine check confirms the readme/coverage config changes work, and
apidoc still finds the package correctly.

* docs: drop stale Version/Changelog checklist items from PR template

Both referenced files/processes that no longer exist post-migration:
CHANGELOG.rst was deleted (python-semantic-release + GitHub Releases is
the changelog of record now), and __version__ in enterprise/__init__.py
is no longer manually bumped (it's resolved via importlib.metadata at
runtime, with versioning itself automated by semantic-release based on
conventional commits). Neither is a manual per-PR task anymore.

* fix: pattern-gap audit round 2 (uv run wrapping, dynamic readme, readthedocs os)

Cross-checked against review comments/fixes from openedx-ledger#242,
edx-enterprise-subsidy-client#222, enterprise-access#1015, and
enterprise-subsidy#441.

- Wrap remaining bare tool invocations in the Makefile (py.test, jasmine,
  diff-cover, pylint, pycodestyle, code_annotations, isort) with `uv run`
  so they resolve against the uv-managed venv instead of falling back to
  whatever happens to be on PATH.
- Drop the redundant dynamic readme field now that pyproject.toml can set
  it statically; keep only version as dynamic (populated by setuptools-scm).
- Bump Read the Docs build image to ubuntu-26.04.

* fix: restore CHANGELOG.rst and enable auto-updating changelog via semantic-release

A previous pass deleted CHANGELOG.rst and set changelog: "false" in
release.yml's python-semantic-release step, reasoning that GitHub Releases
would be the changelog of record. There's no ticket requirement to disable
changelog generation, and deleting the file threw away real historical
release notes for no technical reason.

- Restore CHANGELOG.rst from the commit right before its deletion
  (0d6299b, parent of ed4f0c6) and add the
  ".. changelog-insertion-marker" line at the top, above all historical
  entries.
- Remove changelog: "false" from release.yml's python-semantic-release
  step -- omitting it is equivalent to enabling changelog generation.
- Configure [tool.semantic_release.changelog] with mode = "update" so PSR
  inserts new release sections directly above the marker on each release,
  leaving all existing history below it untouched.
- Set tag_format = "{version}" to match this repo's actual tag convention
  (bare "X.Y.Z", e.g. 8.7.2/8.7.1/8.7.0 -- confirmed via
  `git tag --sort=-v:refname`), since PSR's default "v{version}" would
  silently fail to recognize any existing tag as a prior release.

Verified locally with `semantic-release changelog` against a local branch
pointed at this commit: it correctly generates a new "Unreleased" section
above the marker, grouped by commit type, without touching any existing
history below it.

* docs: remove stale manual tag/PyPI-verification steps from PR template

python-semantic-release's release.yml now creates the tag, GitHub
release, and publishes to PyPI automatically on merge to master --
these were no longer real manual steps for a contributor to perform.

* fix: use stable pypa publish tag and drop tox from Makefile

- pypa/gh-action-pypi-publish: revert the hash-pinned SHA back to the
  stable @release/v1 tag. A hash-pinned version of this action broke
  PyPI publishing previously, which is why the org standardized on the
  stable tag for this specific action.
- Makefile docs target: inline the actual doc8/sphinx commands from
  tox.ini's docs env instead of shelling out to `uv run tox -e docs`,
  matching the no-tox-in-Makefile convention already used elsewhere
  (e.g. enterprise-catalog). tox.ini itself is untouched; CI's own
  matrix testing still uses tox directly.

* fix: use int-parseable fallback_version instead of 0.0.0.dev0

"0.0.0.dev0" is the exact fallback_version value that crashed 17 tests
in a sibling repo (openedx-events) -- runtime code that parses
__version__ via tuple(map(int, __version__.split("."))) chokes on the
non-numeric "dev0" segment. No current consumer here does that (this
repo's own __version__ usage, if any, only interpolates it as a
string), but there's no reason to keep a fallback value from the exact
banned-pattern class when a plain int-parseable "0.0.0" is equally
valid and strictly safer.

* fix: bump openedx-filters constraint to 3.9.0 for logistration filters

The just-merged "add pipeline steps for logistration filters" feature
(src/enterprise/filters/logistration.py) imports
openedx_filters.authentication.types, which only exists starting in
openedx-filters 3.9.0. The platform-synced constraint here was still
at 3.7.0, causing tests/filters/test_logistration.py to fail with
ModuleNotFoundError during collection.

Confirmed 3.9.0 is the right version: openedx-platform's own
requirements/test.txt (on its master, pre-migration) already pins
openedx-filters==3.9.0 for this same reason. Verified locally:
all 24 tests in tests/filters/test_logistration.py now pass.

* fix: restore dropped docs deps, use pure uv for mysql8/postgresql migration jobs

- pyproject.toml: `sphinxcontrib-mermaid` and `myst-parser` were both in the
  old pip-compile doc.in (added together, "Markdown (MyST) support for
  Sphinx docs" / "Renders mermaid diagrams in docs") but got dropped during
  the PEP 735 dependency-groups conversion. docs/conf.py still requires
  both extensions, so the docs build has been failing since. Verified fix
  by actually running `sphinx-build` locally: fails with "No module named
  'sphinxcontrib.mermaid'" before this change, builds clean after.

- mysql8-migrations.yml: replaced `uv pip uninstall X; uv pip install
  --no-binary X X` (twice) with a single native `uv sync --no-binary-package
  mysqlclient --no-binary-package xmlsec` -- uv sync's own flag for this,
  no need to drop into the pip-compat shim. Verified the flag genuinely
  triggers a source build (not a silently-reused wheel) for both packages.

- postgresql-migrations.yml: replaced `uv pip install psycopg2-binary` with
  a new `postgresql` dependency-group (psycopg2-binary was already pinned
  in [tool.uv].constraint-dependencies but not part of any installable
  group) and `uv sync --group dev --group postgresql`. Verified the group
  syncs and psycopg2 imports correctly.

Found while auditing this repo for uv pip usage per the lessons learned on
openedx-platform#38915.

* fix: disable python-semantic-release changelog generation

Set changelog: "false" on the PSR release step and remove the
[tool.semantic_release.changelog] config / insertion marker.

Checked against openedx/XBlock's actual production release.yml (the one
repo in this effort that has cut real automated releases) -- every run
passes changelog: false and invokes `semantic-release -v version
--no-changelog`, and the repo has zero github-actions[bot] commits ever.
The auto-changelog config this migration previously added was only ever
verified via a local dry-run prototype, never against a real release.

feanil flagged the same issue on openedx/DoneXBlock#388: "I thought we
were not going to add changelogs since they can't be updated by
python-semantic-release the way we have it setup."

* fix: upgrade edx-lint to 6.2.0 to match merged pylintrc

Master's pylintrc gained a [PII] pii-terms block (edx-lint 6.2.0+ feature) via the merge; our lockfile was still resolving edx-lint 6.1.0, which doesn't recognize that option and made pylint hard-fail with unrecognized-option. Same fix already applied on openedx-ledger.

* fix: create GitHub release with assets attached, not after publish

This repo has immutable releases enabled, which freezes a release's assets the moment it's published. The old flow (main PSR step publishes the release, a separate publish-action step attaches assets afterward) can never work under that constraint -- it would 422 on the first real release. Matches the fix already proven and merged on openedx/sample-plugin#57 and validated end-to-end on openedx/event-tracking#434: build without publishing (vcs_release: false), then create the release with dist/* attached in one gh release create call.

* fix: align release.yml action pins with sample-plugin gold standard

All five pinned actions in release.yml (checkout, python-semantic-release,
upload-artifact, download-artifact, pypa/gh-action-pypi-publish) had drifted
behind openedx/sample-plugin's verified reference pins:
- actions/checkout: v7.0.0 -> v7.0.1
- python-semantic-release/python-semantic-release: v10.5.3 -> v10.6.2
- actions/upload-artifact: v4.6.2 -> v7.0.1
- actions/download-artifact: v4.3.0 -> v8.0.1
- pypa/gh-action-pypi-publish: @release/v1 (floating tag) -> SHA-pinned v1.14.2

The pypa/gh-action-pypi-publish change specifically reverses an earlier,
explicit ask from salman2013 on this PR (review comment
r3701784182 / reply r3746916720) to move off the SHA pin back to the
floating @release/v1 tag because the SHA pin had previously caused a
publish failure. That guidance has since been superseded org-wide: the
newer direction (given on a sibling PR in this same modernization effort)
is to match openedx/sample-plugin's release.yml exactly, which uses the
SHA pin. All five SHAs were independently verified against both the
commit history and the release tag before pinning.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: align importlib.metadata.version aliasing with sample-plugin

__init__.py and docs/conf.py aliased the same import to two different
names (plain `version` vs `get_distribution_version`/`get_installed_version`,
both leftover from the pkg_resources.get_distribution() era). Renamed
both to `get_version`, matching sample-plugin's convention exactly (it
uses `version as get_version` in both files). No behavioral change.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: update author to Open edX Project convention

* fix: real package description, correct tag_format for semantic-release

- description was still the literal "Your project description goes
  here" placeholder, carried forward unchanged from setup.py.
- tag_format was set to bare "{version}" based on an investigation
  that missed the most recent tag: v8.8.0 (2026-08-07, the actual
  latest) uses the "v" prefix, contradicting the "no v prefix" claim
  the bare format was based on. Switched to "v{version}" (PSR's
  default) so the first automated release correctly recognizes v8.8.0
  as the prior release.

Per salman2013's review comments on PR #2654.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: restore native RTD formats/fail_on_warning via uv install method

The prior config drove the whole build via a custom `commands:` block
under the (incorrect) assumption that Read the Docs doesn't support uv
natively -- that gave up RTD's own PDF/EPUB format generation and
fail_on_warning handling, per salman2013's review.

RTD does support uv natively via `python.install.method: uv`, which
lets RTD run its own build (formats, fail_on_warning, LaTeX toolchain
provisioning) after installing deps through uv instead of pip. Same
pattern already used elsewhere in this migration batch: opaque-keys
(same batch, keeps formats: [pdf, epub]) and openedx-platform#38915
(merged; its own PR description states this was verified against a
real Read the Docs build, not just locally).

Verified locally: `uv sync --group doc` (what RTD's install step runs)
and `sphinx-build -W -b html` (RTD's fail_on_warning equivalent) both
succeed cleanly.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: use uv run python for the BROWSER auto-open helper

Bare \`python\` isn't guaranteed to be on PATH once a repo is uv-managed
(a dev machine may only have python3, or none at all outside the uv
venv) -- salman2013 asked to verify \`make docs\` works; the Sphinx
build itself always succeeded, but the final auto-open-browser step
failed with "command not found" here. \`uv run python\` guarantees the
interpreter exists regardless of the host PATH, matching this
migration's existing "prefix tool invocations with uv run" convention.

Verified: \`make docs\` now completes end-to-end (exit 0), Sphinx build
succeeded as before.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: use secrets.GITHUB_TOKEN instead of custom org secret for release job

Matches openedx/sample-plugin's current release.yml; the custom
OPENEDX_SEMANTIC_RELEASE_GITHUB_TOKEN secret isn't needed.

* fix: restore tox delegation for docs/isort/isort-check/pii_check/jasmine

Makefile targets were fully inlining commands that tox.ini already
defines as standalone envs. pylint and pycodestyle are left inlined
since they have no matching standalone tox env (only bundled inside
the quality env), and the top-level quality target is left as-is
since it was already a thin alias over other make targets, not
inlined commands.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: drop uv run from Makefile per feanil's review feedback

Makefile now assumes an already-synced/activated local env; uv run
stays in CI workflow steps only. See openedx-unsupported/ccx-keys#190 (review
comment r4097501942).

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* chore: bump python-semantic-release action to v10.7.0

Match the pin used by openedx/sample-plugin.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: match release.yml to sample-plugin's current file

Drops secrets: inherit on the run_ci call and picks up the current
upload/download-artifact pins.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix: seed uv.lock from master's pinned requirements

Resolve uv.lock from the versions pinned in requirements/*.txt on master so this
migration doesn't change what gets installed. Upgrades come in with the first
make upgrade after this merges.

The platform block in constraint-dependencies now comes from master's
requirements/edx-platform-constraints.txt instead of today's openedx-platform,
and jinja2/markupsafe are skipped like pyyaml so js_test keeps master's
jasmine 3.99.0. Also rerun edx_lint write_uv_constraints.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix: address review feedback

- Add --locked to the uv sync/uv run calls in ci.yml and the migration workflows.
- Use sample-plugin's concurrency group in ci.yml so a release's run_ci isn't cancelled by the push run.
- Drop the new [tool.coverage.html]/[tool.coverage.xml] paths; make coverage and make diff_cover read the defaults.
- Point the locale symlink, .tx/config, .gitignore, .jshintignore and the integrated_channels README links at src/.
- Replace the virtualenv setup in the getting started and development docs with the uv .venv flow.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* build: run CI on the default branch only through release.yml

release.yml runs on every push to the default branch and calls ci.yml through
run_ci, so the push trigger in ci.yml ran every merge's CI twice. This matches
sample-plugin's ci.yml.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Irfan Ahmad <[email protected]>
Co-authored-by: Claude Sonnet 5 <[email protected]>
Co-authored-by: Feanil Patel <[email protected]>
feanil pushed a commit to openedx/edx-enterprise-data that referenced this pull request Nov 5, 2026
…e) (#693)

* feat: consolidate package metadata into pyproject.toml

Replace setup.py with PEP 621 [project] metadata and setuptools-scm for
git-tag-based versioning. The `reporting` extras_require becomes a real
[project.optional-dependencies] extra.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* feat: switch dependency management from pip-compile to uv

Replace requirements/*.in + *.txt with PEP 735 dependency-groups in
pyproject.toml and a single uv.lock. The reporting extra's compile chain
(test-master.txt/test-reporting.txt) becomes explicit test/test-reporting
groups that self-reference the edx-enterprise-data[reporting] extra rather
than duplicating its package list. Update tox.ini to use tox-uv's
uv-venv-lock-runner, update the Makefile, and switch CI to install uv and
run tests via `uv run tox`.

Verified locally: `uv lock` resolves cleanly, and `uv sync --group
test-base --no-default-groups` + the full enterprise_data/enterprise_data_roles
test suite (298 tests) pass end-to-end. The `reporting` extra's native deps
(pyminizip) fail to build on this machine (no system zlib toolchain
compatible with modern clang) -- pre-existing characteristic of that extra,
not a migration regression; needs CI (Linux) to verify fully.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* feat: add semantic-release for automated PyPI publishing

Add [tool.semantic_release] build config to match the release.yml
workflow (added in the previous commit): pushes to master with
conventional commits now automatically bump the version, tag it, and
publish to PyPI.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: correct release tag format and drop stale MANIFEST.in entries

semantic-release defaults to a "v{version}" tag format, but this repo's
existing release tags are bare version numbers -- without tag_format set,
semantic-release wouldn't recognize any prior release. Also removes
MANIFEST.in references to requirements/*.in and requirements/constraints.txt,
which no longer exist after the uv migration.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: prevent uv sync from implicitly pulling in the dev group

Every uv sync/uv run invocation in this repo names an explicit --group,
but uv's implicit default group (named "dev") was still being synced
alongside it, silently pulling the entire dev/reporting superset into
every target. Verified with `uv sync --group ci`.

Also adds .venv/ to .gitignore alongside the existing venv/ entry.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: publish to PyPI via OIDC instead of token

Parent issue openedx/public-engineering#506 asks for OIDC trusted-publisher
PyPI auth, not a stored token. Grant id-token: write on publish_to_pypi and
drop the explicit __token__/PYPI_UPLOAD_TOKEN credentials -- pypa/gh-action-pypi-publish
uses OIDC automatically once the permission is present and no credentials are given.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: pin pypa/gh-action-pypi-publish to a commit SHA

@release/v1 is a floating branch ref -- xblocks-core's release just failed
with "docker: manifest unknown" because the Docker image tag it resolved to
at checkout time wasn't published on ghcr.io yet. Pin to the exact commit
backing the current v1.14.0 release instead, consistent with this repo's
own SHA-pinning rule for every other action.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: set major_on_zero=false and allow_zero_version=true for consistency

Reviewer feedback: this should be set across the whole batch, not just
repos currently on 0.x, so no repo in this effort can ever auto-jump to
1.0.0 as an accidental side effect if it's reset to 0.x in the future.
Note this is a no-op for repos already past 1.0 -- major_on_zero only
governs the 0.x -> 1.0.0 transition, not 1.x -> 2.0.0 (there's no PSR
setting that suppresses major bumps once past 1.0; that's normal SemVer
behavior for a breaking-change commit at any version).

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* refactor: adopt src-layout, matching openedx/sample-plugin

Moves all three top-level packages (enterprise_data, enterprise_data_roles,
enterprise_reporting) to src/, in line with the reference implementation
for this modernization effort (openedx/sample-plugin) and openedx/forum#281.

- pyproject.toml: add where = ["src"] to packages.find
- tox.ini: prefix src/ onto the quality env's isort/pylint/pycodestyle/
  pydocstyle targets, and onto the data env's pytest --ignore path and
  the reporting env's test-collection path (--cov's own module-name arg
  is left alone -- it resolves via the installed module, not a filesystem
  path). DJANGO_SETTINGS_MODULE=enterprise_data.settings.test is an
  import path, unaffected by the physical move.
- Makefile: prefix src/ onto the isort target's package names
- MANIFEST.in: all three recursive-include paths updated
- enterprise_data/settings/test.py: this repo's in-package here()/root()
  path helper climbs from src/enterprise_data/settings/ back to the repo
  root -- fixed the climb from '../..' (2 levels, correct pre-move) to
  '../../..' (3 levels, correct post-move) so root() still means what its
  docstring says. root() has no current call sites (dead code), but fixed
  the definition itself for correctness -- verified by direct invocation
  that it now resolves to the true repo root.

Verified: uv sync (no lock drift), uv build --wheel + twine check pass
(direct proof the where=["src"] packaging change works across all three
packages). Could not run the full tox matrix locally -- this machine's
clang/zlib toolchain can't build pyminizip (a native extension in the
"reporting" extra that both the "test" and "quality" dependency groups
pull in), unrelated to src-layout. Relying on CI for full-matrix
confirmation.

* fix: update hardcoded fixture path in test_enterprise_client.py for src-layout

CI failed on the reporting-django42 job with FileNotFoundError:
enterprise_reporting/fixtures/enterprise_customer_reporting.json --
this test computes its fixture path as os.path.join(os.getcwd(),
'enterprise_reporting/fixtures') rather than deriving it from
__file__ or an installed resource, so it didn't get caught by the
config-file sweep (yml/ini/cfg/Makefile/MANIFEST.in) done for the
previous commit. Updated to src/enterprise_reporting/fixtures,
matching the new physical location. Swept this repo and all five
previously-migrated repos in this batch for the same
os.getcwd()/REPO_DIR-style hardcoded path pattern in .py files --
this was the only occurrence.

* fix: pattern-gap audit (uv setup, package=true, changelog, MANIFEST.in)

Same category of fixes farhan flagged on the batch's other reviewed PRs:

- ci.yml + mysql8-migrations.yml: add enable-cache/python-version to
  astral-sh/setup-uv and drop the now-redundant actions/setup-python
  step (mysql8-migrations.yml already had enable-cache, just needed
  python-version)
- pyproject.toml: add [tool.uv] package = true
- Delete CHANGELOG.rst -- python-semantic-release + GitHub Releases is
  the changelog of record. It wasn't even referenced anywhere (not in
  the dynamic readme list, no docs/changelog.rst page), just an
  orphaned stale file, but MANIFEST.in still had `include CHANGELOG.rst`
- MANIFEST.in: also fixed `include README.rst` -> `include README.md` --
  this repo's actual readme is README.md (matches pyproject.toml's
  dynamic readme file list); README.rst doesn't exist in this repo at all

Verified: uv sync (no lock drift), uv build --wheel + twine check pass
(direct proof the MANIFEST.in fix works -- README.md is now correctly
found and bundled). Could not run the full tox matrix locally -- same
pyminizip build environment limitation already documented for this repo.

* docs: drop stale Version/Changelog checklist items from PR template

Both referenced files/processes that no longer exist post-migration:
CHANGELOG.rst was deleted (python-semantic-release + GitHub Releases is
the changelog of record now), and manual version bumping is superseded
by semantic-release's automated versioning from conventional commits.
Neither is a manual per-PR task anymore.

* fix: pattern-gap audit round 2 (coverage config, twine removal, codecov/tox envlist fix)

Cross-checked against review comments/fixes from openedx-ledger#242,
edx-enterprise-subsidy-client#222, enterprise-access#1015, and
enterprise-subsidy#441.

- Add the [tool.coverage.run]/[report]/[html] sections that were entirely
  missing from pyproject.toml.
- Wrap remaining bare tool invocations in the Makefile (coverage erase,
  isort --recursive) with `uv run`.
- Drop twine from the dev group; releases publish via
  pypa/gh-action-pypi-publish, not twine.
- Drop the redundant dynamic readme field; keep only version as dynamic.
- Add the missing python-version factor to the tox envlist
  (py312-{data,reporting}-django{42}) and update the CI matrix/codecov
  condition to match -- the previous condition compared against toxenv
  values that never actually occurred, so coverage was never uploaded.
- Regenerate uv.lock for the twine removal.

* fix: add codecov.yml to absorb one-time coverage measurement-scope drop

The pyproject.toml migration standardized [tool.coverage.run] to omit
*/tests/*, */migrations/*, */__pycache__/* and */settings/* and to
enable branch coverage (branch = true), neither of which the old
tox.ini/pytest addopts config did. That's a one-time methodology
change, not a real regression: reported project coverage dropped from
88.70% (107 files, tests/migrations counted, line-only) to 81.56% (79
files, production code only, branch coverage on), tripping
codecov/project's default 0% threshold.

Add a documented project-level threshold (9%, comfortably above the
7.14% one-time drop) so this and future PRs pass under the new
baseline while still catching genuine regressions. Same fix already
applied in sibling repos undergoing this modernization effort
(ccx-keys#190, opaque-keys#461, openedx-chem#161).

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: restore CHANGELOG.rst and enable automated changelog updates

An earlier pass deleted CHANGELOG.rst and set changelog: "false" in
release.yml, on the assumption GitHub Releases would be the changelog
of record. There's no ticket requirement for that, and deleting the
file threw away real historical release notes.

- Restore CHANGELOG.rst from the commit before its deletion
  (e433dd6^, i.e. a6cfe64)
- Add the ".. changelog-insertion-marker" line at the top of the file
- Remove changelog: "false" from release.yml's python-semantic-release
  step
- Configure [tool.semantic_release.changelog] in pyproject.toml with
  mode = "update" so PSR inserts new release sections above the marker
  on each release, leaving existing history untouched
- tag_format was already correctly set to "{version}" (bare tags, e.g.
  10.22.11), matching this repo's actual tag convention -- no change
  needed there

Verified locally: checked out a local "master" branch at HEAD and ran
`uv run --with python-semantic-release semantic-release changelog` as
a dry run. New content (an Unreleased section plus a backfilled
10.22.11 section for the untagged commits since 10.22.10) inserted
correctly above the marker; parsed as valid RST via docutils; every
line below the marker was byte-for-byte identical to the restored
file. The dry-run preview content and test branch were discarded
before this commit.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: use stable pypa publish tag and drop tox from Makefile

- pypa/gh-action-pypi-publish: revert the hash-pinned SHA back to the
  stable @release/v1 tag. A hash-pinned version of this action broke
  PyPI publishing previously, which is why the org standardized on the
  stable tag for this specific action.
- Makefile: add a `quality` target inlining the actual isort/pylint/
  pycodestyle/pydocstyle commands from tox.ini's quality env, and have
  test-all/validate call it directly instead of shelling out to
  `uv run tox`/`uv run tox -e quality`. test-all now also runs the
  data/reporting pytest invocations directly. tox.ini itself is
  untouched; CI's own matrix testing still uses tox directly.

* fix: use int-parseable fallback_version instead of 0.0.0.dev0

"0.0.0.dev0" is the exact fallback_version value that crashed 17 tests
in a sibling repo (openedx-events) -- runtime code that parses
__version__ via tuple(map(int, __version__.split("."))) chokes on the
non-numeric "dev0" segment. No current consumer here does that (this
repo's own __version__ usage, if any, only interpolates it as a
string), but there's no reason to keep a fallback value from the exact
banned-pattern class when a plain int-parseable "0.0.0" is equally
valid and strictly safer.

* fix: pure-uv mysql8-migrations job, remove permanent codecov threshold

- mysql8-migrations.yml: replaced uv pip uninstall/install --no-binary with
  a single native `uv sync --group mysql8 --no-binary-package mysqlclient`.
  mysqlclient wasn't pulled in by any existing group (a plain `uv sync
  --group dev` doesn't install it), so added a dedicated `mysql8` group --
  same as master's pre-migration behavior, where it came in only via this
  same job's own pip uninstall+reinstall step. Verified the flag genuinely
  triggers a source build (confirmed with --no-cache to bypass a stale
  cached wheel from an earlier local test), blocked locally only by the
  same missing pkg-config/mysql-dev system dependency the CI runner's own
  apt-get step already covers.

- codecov.yml: removed the permanent `threshold: 9%`, same reasoning as
  taxonomy-connector#316 (per salman2013's question there): this status
  check isn't required for merging, and `target: auto` compares each PR
  against its own base commit, so the one-time coverage-methodology
  discontinuity (88.70% -> 81.56%) only ever affected this PR's own diff --
  once merged, 81.56% becomes the new baseline for every future comparison.
  A permanent 9% regression-masking allowance had no real job to do.

Found while auditing this repo for uv pip usage per the lessons learned on
openedx-platform#38915.

* fix: disable python-semantic-release changelog generation

Set changelog: "false" on the PSR release step and remove the
[tool.semantic_release.changelog] config / insertion marker.

Checked against openedx/XBlock's actual production release.yml (the one
repo in this effort that has cut real automated releases) -- every run
passes changelog: false and invokes `semantic-release -v version
--no-changelog`, and the repo has zero github-actions[bot] commits ever.
The auto-changelog config this migration previously added was only ever
verified via a local dry-run prototype, never against a real release.

feanil flagged the same issue on openedx/DoneXBlock#388: "I thought we
were not going to add changelogs since they can't be updated by
python-semantic-release the way we have it setup."

* style: trim codecov.yml explanatory comment

Reviewers on this effort (farhan, feanil) have repeatedly asked to delete
multi-line AI-written justification comments from committed files. Moved
the detail to this commit message instead:

This tooling migration changed coverage measurement two ways at once:
(1) omits */tests/*, */migrations/*, */__pycache__/*, */settings/* from
[tool.coverage.run] (previously counted toward the total), and (2) turns
on branch = true (previously line-only). Combined, that drops the
reported total from 88.70% (107 files, incl. tests/migrations, line-only)
to 81.56% (79 files, production only, branch coverage) -- a one-time
discontinuity in this PR's base-vs-head comparison, not a real
regression. Patch target is left at auto (not a fixed 90% like sibling
repos): patch coverage (85.93%) already passes under the default policy.

* fix: create GitHub release with assets attached, not after publish

This repo has immutable releases enabled, which freezes a release's assets the moment it's published. The old flow (main PSR step publishes the release, a separate publish-action step attaches assets afterward) can never work under that constraint -- it would 422 on the first real release. Matches the fix already proven and merged on openedx/sample-plugin#57 and validated end-to-end on openedx/event-tracking#434: build without publishing (vcs_release: false), then create the release with dist/* attached in one gh release create call.

* fix: pin release.yml actions to sample-plugin's verified SHAs

release.yml was pinning actions/checkout, python-semantic-release, and
actions/upload-artifact/download-artifact to stale SHA@version pairs
(v7.0.0/v10.5.3/v4.6.2/v4.3.0), and pypa/gh-action-pypi-publish was left
on the floating `@release/v1` tag rather than a pinned commit.

openedx/sample-plugin's release.yml is this org's designated
gold-standard reference for these pins. Brought all five in line with
its current values, each independently re-verified against the
upstream repos' commit and tag APIs before use:

  - actions/checkout -> 3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
  - python-semantic-release/python-semantic-release ->
    9a026e9303981c866c3425723009becb2437c757 # v10.6.2
  - actions/upload-artifact -> 043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
  - actions/download-artifact -> 3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
  - pypa/gh-action-pypi-publish -> dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2

Note on the last one: salman2013 previously asked (on this same PR,
review comment 3710275326) to revert the SHA pin on
gh-action-pypi-publish back to `@release/v1` due to prior issues with
hash-pinning it. That guidance has since been superseded by the same
reviewer directing (on a sibling repo's PR) to match sample-plugin
exactly, which does pin this action to a SHA. Re-pinning here to stay
consistent with the current org-wide guidance.

if-no-files-found: error on the dist upload, the release job's
checkout step omitting fetch-depth: 0, and the `github.ref_name ==
'master' && needs.release.outputs.released == 'true'` guard on
publish_to_pypi (master is this repo's actual default branch) already
matched sample-plugin and needed no changes.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: use v-prefixed tag_format for release tag consistency

* fix: update author to Open edX Project convention

* fix: restore __version__ dropped during pyproject.toml consolidation

Removed the hardcoded __version__ = "10.22.14" (correctly, since
version is now dynamic via setuptools-scm) but never replaced it with
the importlib.metadata equivalent, unlike sibling repos in this
migration batch. enterprise_data.__version__ has been silently missing
since.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: remove dangling codecov.yml comments, not present pre-migration

Both comments pointed at "see PR description" for an explanation that
was never actually added there. Coverage config itself is out of
scope for this migration, so just dropping the stale comments -- no
change to target/threshold behavior.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: use secrets.GITHUB_TOKEN instead of custom org secret for release job

Matches openedx/sample-plugin's current release.yml; the custom
OPENEDX_SEMANTIC_RELEASE_GITHUB_TOKEN secret isn't needed.

* fix: restore tox delegation for quality target

Makefile quality target was fully inlining isort/pylint/pycodestyle/
pydocstyle commands that tox.ini's testenv:quality already runs.
validate and test-all already call quality via $(MAKE), so they now
delegate to tox transitively, matching pre-migration behavior.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: drop uv run from Makefile per feanil's review feedback

Makefile now assumes an already-synced/activated local env; uv run
stays in CI workflow steps only. See openedx-unsupported/ccx-keys#190 (review
comment r4097501942).

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* fix: inherit secrets in release.yml's run_ci call

Without secrets: inherit, the reusable ci.yml workflow's "Run
Coverage" step reads an empty secrets.CODECOV_TOKEN on every
release-triggered run (soft failure only, since that step has
continue-on-error: true, but still a real wiring gap). Sibling repo
edx-enterprise's release.yml already does this correctly -- this
brings edx-enterprise-data in line with it.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* revert: drop unnecessary py312- prefix from tox envnames

There's no actual naming clash requiring the py312- prefix on the
data-django42/reporting-django42 tox envs (nothing else in tox.ini
references it, and no factor-conditional depends on it). The
corresponding ci.yml matrix toxenv values were already reverted as
part of resolving the merge conflict with master in the prior commit.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* build(deps): bump python-semantic-release action pin to v10.7.0

Matches the SHA pin currently used by openedx/sample-plugin, the
reference implementation for this modernization effort.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* docs: update PR template for the uv workflow

The requirements/*.txt, base.in and test-master.in files were removed by
the migration. Point the checklist at pyproject.toml and uv.lock instead.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix: align packaging and release config with the migration rules

- Publish py2neo as a plain requirement; the overhangio URL moves to
  [tool.uv.sources] so it stays out of Requires-Dist (PyPI rejects
  direct-URL dependencies).
- Restore the Django<5 and mysql-connector-python<9.6 caps that 10.22.14
  published.
- license: AGPL-3.0-only, matching setup.py's "AGPL 3.0".
- release.yml: match sample-plugin's current file (no secrets: inherit,
  current artifact action pins).
- Use the standard tag_format comment.
- Drop codecov.yml, which master never had.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix: seed uv.lock from master's pinned requirements

Resolve uv.lock from the versions pinned in requirements/*.txt on master so this
migration doesn't change what gets installed. Upgrades come in with the first
make upgrade after this merges.
Also give test-reporting its own resolution: master's data tests ran pytest 9.1.1
with test.txt, while test-reporting.txt pins pytest 8.0.2, ddt 1.1.2, mock 2.0.0 and
pytest-cov 4.1.0. dev no longer includes test-reporting, matching master's dev.txt.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix: address review feedback

- Add --locked to the uv sync/uv run calls in ci.yml and mysql8-migrations.yml.
- Make test-all call tox again, as master did.
- Remove the manual tag/Travis/PyPI release steps from the PR template.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* build: run CI on the default branch only through release.yml

release.yml runs on every push to the default branch and calls ci.yml through
run_ci, so the push trigger in ci.yml ran every merge's CI twice. This matches
sample-plugin's ci.yml.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* build: reseed uv.lock from master's upgraded requirements (#720)

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* build: let a failed tox env fail the run so it holds the release

release.yml gates the release on this workflow, and continue-on-error kept
the run green when an env failed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Irfan Ahmad <[email protected]>
Co-authored-by: Claude Sonnet 5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants