Skip to content

Modernize Python repo: pyproject.toml + uv + semantic-release#251

Draft
salman2013 wants to merge 3 commits into
mainfrom
salman/modernize-branch
Draft

Modernize Python repo: pyproject.toml + uv + semantic-release#251
salman2013 wants to merge 3 commits into
mainfrom
salman/modernize-branch

Conversation

@salman2013
Copy link
Copy Markdown
Contributor

@salman2013 salman2013 commented May 18, 2026

Summary

Modernizes the Python tooling for xblocks-contrib in three phases, aligning with the Open edX org standard established in openedx/sample-plugin.

Ticket: openedx/public-engineering#506

Changes generated by Claude Sonnet 4.6 using the modernize-python-tooling skill, reviewed by Salman.


Commits

chore: migrate package metadata to pyproject.toml

  • Consolidated all package metadata into pyproject.toml (PEP 621) with static dependencies list and dynamic = ["version"]
  • Configured setuptools-scm (version_scheme = "only-version", local_scheme = "no-local-version")
  • Updated license to SPDX string format (PEP 639): license = "AGPL-3.0" + license-files = ["LICENSE.txt"]
  • Deleted setup.py and setup.cfg

chore: switch dependency management from pip-tools to uv

  • Added [dependency-groups] (PEP 735): test-base, test (Django 5.2), django42, quality, doc, ci, dev
  • Used [tool.uv].conflicts to allow Django 4.2 and 5.2 to coexist in a single uv.lock with separate resolutions
  • [tool.edx_lint].uv_constraints holds repo-specific pins; [tool.uv].constraint-dependencies managed by edx_lint write_uv_constraints
  • Rewrote tox.ini to use tox-uv>=1 and uv-venv-lock-runner with dependency_groups
  • Updated Makefile: upgrade runs uv lock --upgrade, requirements runs uv sync --group dev
  • Updated python-tests.yml: added astral-sh/setup-uv, uv sync --group ci, uv run tox
  • Deleted entire requirements/ directory (11 files)

chore: add python-semantic-release and commitlint workflows

  • Added [tool.semantic_release] with build_command exporting SETUPTOOLS_SCM_PRETEND_VERSION=$NEW_VERSION before uv build
  • Added release.yml: runs python-tests.yml as a reusable workflow, then PSR v10.5.3 on main, publishes to PyPI via OIDC trusted publisher (no token needed)
  • Added commitlint.yml: enforces conventional commit format on PRs
  • Deleted pypi-publish.yml (was causing duplicate publishes)
  • Reverted upgrade-python-requirements.yml to shared openedx/.github reusable workflow
  • Updated README.rst with uv-based setup instructions

Test plan

  • make requirements
  • uv run tox -e django42
  • uv run tox -e django52
  • uv run tox -e docs

salman2013 and others added 2 commits May 18, 2026 23:50
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 open-source-contribution PR author is not from Axim or 2U core contributor PR author is a Core Contributor (who may or may not have write access to this repo). labels May 18, 2026
@openedx-webhooks
Copy link
Copy Markdown

Thanks for the pull request, @salman2013!

This repository is currently maintained by @openedx/axim-engineering.

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.

🔘 Update the status of your PR

Your PR is currently marked as a draft. After completing the steps above, update its status by clicking "Ready for Review", or removing "WIP" from the title, as appropriate.


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.

Comment thread .github/workflows/release.yml Dismissed
@salman2013 salman2013 changed the title Salman/modernize branch Modernize Python repos: pyproject.toml + uv + semantic-release May 18, 2026
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@salman2013 salman2013 force-pushed the salman/modernize-branch branch from 0b62620 to 767f8d9 Compare May 18, 2026 19:20
@salman2013 salman2013 changed the title Modernize Python repos: pyproject.toml + uv + semantic-release Modernize Python repo: pyproject.toml + uv + semantic-release May 18, 2026
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.

3 participants