Skip to content

chore: migrate to modern Python tooling (uv, pyproject.toml, semantic-release, src layout)#2423

Open
salman2013 wants to merge 6 commits into
openedx:masterfrom
salman2013:modernize-python-tooling
Open

chore: migrate to modern Python tooling (uv, pyproject.toml, semantic-release, src layout)#2423
salman2013 wants to merge 6 commits into
openedx:masterfrom
salman2013:modernize-python-tooling

Conversation

@salman2013

@salman2013 salman2013 commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Phase 1 — Consolidate all package metadata into pyproject.toml (PEP 621): static dependencies, SPDX license, setuptools-scm for dynamic versioning, coverage config, isort config; delete setup.py, setup.cfg, .coveragerc
  • Phase 2 — Replace pip-tools with uv: [dependency-groups] (PEP 735), uv.lock, updated tox.ini to use tox-uv + uv-venv-lock-runner, updated Makefile and CI workflow to use uv sync/uv run tox
  • Phase 3 — Add python-semantic-release for automated versioning and PyPI publishing via OIDC trusted publisher; delete legacy pypi-publish.yml
  • Phase 4 — Migrate to src/ layout; update all filesystem path references in Makefile, webpack configs, karma, scripts, and settings

Test plan

  • CI passes on this PR (django42, django52, js, quality environments)
  • Configure OIDC trusted publisher on PyPI for openedx/edx-ora2 → workflow release.yml before merging

🤖 Generated with Claude Code

salman2013 and others added 3 commits July 17, 2026 15:42
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Jul 17, 2026
@openedx-webhooks

Copy link
Copy Markdown

Thanks for the pull request, @salman2013!

This repository is currently maintained by @openedx/openedx-unmaintained.

Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review.

🔘 Get product approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.
🔘 Provide context

To help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads
🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.

Details
Where can I find more information?

If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:

When can I expect my changes to be merged?

Our goal is to get community contributions seen and reviewed as efficiently as possible.

However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

@openedx-webhooks openedx-webhooks added the core contributor PR author is a Core Contributor (who may or may not have write access to this repo). label Jul 17, 2026
@github-project-automation github-project-automation Bot moved this to Needs Triage in Contributions Jul 17, 2026
@codecov

codecov Bot commented Jul 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.03%. Comparing base (214e0d1) to head (baf194f).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2423      +/-   ##
==========================================
- Coverage   95.45%   95.03%   -0.43%     
==========================================
  Files         198      179      -19     
  Lines       22755    19903    -2852     
  Branches     1548     1439     -109     
==========================================
- Hits        21720    18914    -2806     
+ Misses        780      746      -34     
+ Partials      255      243      -12     
Flag Coverage Δ
unittests 95.03% <100.00%> (-0.43%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

…able installs

When uv installs ora2 as an editable package, it creates src/openassessment/ and
symlinks openassessment/ -> src/openassessment/. Karma's basePath resolves through
this symlink to src/openassessment/xblock/static, so the ../../../ relative paths
for node_modules reach src/node_modules/ instead of the project root, causing
RequireJS and other libraries to not be found and the tests to crash.

Fix by using process.cwd() (the project root when npm test runs) to build absolute
paths for all files outside the openassessment/ directory tree.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@salman2013
salman2013 force-pushed the modernize-python-tooling branch from d6b467b to 5ae0ab5 Compare July 20, 2026 11:45
salman2013 and others added 2 commits July 20, 2026 17:01
pylint-django<2.6.0 used pylint.interfaces.IAstroidChecker which was
removed in pylint 3.x. With pylint 4.0.6 now in the lockfile, remove
the <2.6.0 constraint so pylint-django 2.8.0 is used instead.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The format string args were passed as keyword args (file_key=, error=)
which aren't consumed by the %s placeholders, causing a pylint
logging-too-few-args violation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core contributor PR author is a Core Contributor (who may or may not have write access to this repo). open-source-contribution PR author is not from Axim or 2U

Projects

Status: Needs Triage

Development

Successfully merging this pull request may close these issues.

2 participants