Skip to content
This repository was archived by the owner on Aug 28, 2026. It is now read-only.

chore: modernize Python tooling (uv, pyproject.toml, src layout, semantic-release) - #258

Closed
salman2013 wants to merge 4 commits into
openedx-unsupported:masterfrom
salman2013:modernize-python-tooling
Closed

salman2013 wants to merge 4 commits into
openedx-unsupported:masterfrom
salman2013:modernize-python-tooling

Conversation

@salman2013

@salman2013 salman2013 commented Jul 17, 2026 •

Copy link
Copy Markdown

Summary

  • Phase 1: Migrate all package metadata from setup.py to pyproject.toml (PEP 621); replace hardcoded __version__ with importlib.metadata; configure setuptools-scm for git-tag-based versioning
  • Phase 2: Replace pip-tools + requirements/*.txt with uv dependency groups and uv.lock; update tox.ini to use tox-uv / uv-venv-lock-runner; update Makefile and CI workflow to use uv run tox
  • Phase 3: Add python-semantic-release workflow (release.yml) with OIDC PyPI publishing; delete old pypi-publish.yml
  • Phase 4: Migrate package from flat layout to src/freetextresponse/; update all filesystem path references in tox.ini, Makefile, and i18n.mk

Test plan

  • uv run tox -e quality passes locally (pylint 10.00/10, pycodestyle clean ✅)
  • CI passes on all matrix envs (django42, django52, quality, csslint, eslint, translations_validate)
  • Configure OIDC trusted publisher on PyPI before merging: Publisher = GitHub Actions, workflow = release.yml

🤖 Generated with Claude Code

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

🔘 Find a technical reviewer To get help with finding a technical reviewer, reach out to the community contributions project manager for this PR:
  1. On the right-hand side of the PR, find the Contributions project, click the caret in the top right corner to expand it, and check the "Primary PM" field for the name of your project manager.
  2. Find their GitHub handle here.

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
@mphilbrick211 mphilbrick211 moved this from Needs Triage to Ready for Review in Contributions Jul 20, 2026
@mphilbrick211
mphilbrick211 requested a review from feanil July 20, 2026 20:34
@salman2013
salman2013 removed the request for review from feanil July 30, 2026 13:33
@salman2013
salman2013 force-pushed the modernize-python-tooling branch from cec23ca to 9992edf Compare July 30, 2026 13:40
salman2013 and others added 3 commits July 30, 2026 18:41
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add release.yml with OIDC PyPI publishing via python-semantic-release
- Add commitlint.yml workflow
- Delete pypi-publish.yml
- Migrate package to src/freetextresponse/ layout
- Update tox.ini, Makefile, and i18n.mk for src/ paths
- Fix CI: add npm install step, remove unnecessary permissions block
- Use source_pkgs for coverage (src/ layout)
- Remove unused __version__ from __init__.py

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@salman2013
salman2013 force-pushed the modernize-python-tooling branch from 9992edf to 9b5427b Compare July 30, 2026 13:42
Run CI on direct pushes to master, not just on PRs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

@feanil feanil left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

A couple more things I noticed on review.

@@ -3,5 +3,3 @@
Instructors can specify a list of phrases, of which one must be
present in order for the student to receive credit.
"""

__version__ = "5.1.0"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

We should load the version variable from the package data rather than removing this.

Comment thread Makefile
pip install -r requirements/pip.txt
pip install -r requirements/base.txt
requirements_py: ## Install required python packages
uv sync --group dev

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

It looks like before, this was just thebase requirements not the dev requirements. So I think this should just be a uv sync?

Comment thread pyproject.toml
license = "AGPL-3.0"
license-files = ["LICENSE"]
authors = [
{name = "stv", email = "stv@stanford.edu"},

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

we can update this to "Open edX" and "oscm@openedx.org"

Comment thread pyproject.toml
"tox-uv>=1",
]
dev = [
{include-group = "quality"},

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Shouldn't dev also include test?

@mphilbrick211 mphilbrick211 moved this from Ready for Review to In Eng Review in Contributions Aug 19, 2026
@farhan

farhan commented Aug 28, 2026

Copy link
Copy Markdown

@salman2013 We should close this as we have moved this xblock into xblocks-extras

@salman2013 salman2013 closed this Aug 28, 2026
@github-project-automation github-project-automation Bot moved this from In Eng Review to Done in Contributions Aug 28, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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

None yet

Development

Successfully merging this pull request may close these issues.

4 participants