Skip to content

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

Merged
feanil merged 7 commits into
openedx:masterfrom
salman2013:modernize-python-tooling
Sep 9, 2026
Merged

feanil merged 7 commits into
openedx:masterfrom
salman2013:modernize-python-tooling

Conversation

@salman2013

Copy link
Copy Markdown
Contributor

Summary

  • Phase 1: Migrates package metadata from setup.py to pyproject.toml (PEP 621) with setuptools-scm for dynamic versioning and importlib.metadata for __version__
  • Phase 2: Replaces pip-tools + requirements/ with uv dependency groups (test-base, test, django42, quality, ci, dev), adds tox.ini with uv-venv-lock-runner and a Django 4.2/5.2 version matrix, and updates CI to use astral-sh/setup-uv
  • Phase 3: Adds [tool.semantic_release] config and release.yml workflow (runs CI → cuts release → publishes to PyPI via OIDC), replaces the old tag-triggered pypi-publish.yml
  • Phase 4: Moves package to src/crowdsourcehinter/ layout

Test plan

  • make quality passes (tox -e quality)
  • make test passes (tox -e py312-django42 and tox -e py312-django52)
  • CI matrix runs all three envs: quality, py312-django42, py312-django52
  • Configure OIDC trusted publisher on PyPI (workflow: release.yml)

🤖 Generated with Claude Code

salman2013 and others added 4 commits July 17, 2026 19:06
Replaces setup.py with pyproject.toml using PEP 621 static metadata,
setuptools-scm for dynamic versioning, and importlib.metadata for __version__.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replaces requirements/*.txt/in files with uv dependency groups in
pyproject.toml (test-base, test, django42, quality, ci, dev), adds
tox.ini with uv-venv-lock-runner and a Django version matrix, and
updates CI to use astral-sh/setup-uv with uv sync/run tox.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds [tool.semantic_release] config using setuptools-scm for dynamic
versioning, and replaces the tag-triggered pypi-publish.yml with a
release.yml that runs CI, cuts a release, and publishes to PyPI via
OIDC trusted publisher.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Moves crowdsourcehinter/ to src/crowdsourcehinter/ and updates
pyproject.toml (where = ["src"]), tox.ini, and pytest.ini paths
accordingly.

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

- Add [flake8] max-line-length = 127 to tox.ini to match original CI config
- Add noqa: F401 to intentional CrowdsourceHinter re-export in __init__.py
- Fix pre-existing style violations in crowdsourcehinter.py (E203, E231,
  E261, E303, E501, W291, W293)
- Remove django test envs from CI matrix until tests are written

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@mphilbrick211 mphilbrick211 moved this from Needs Triage to Ready for Review in Contributions Jul 20, 2026
@mphilbrick211

Copy link
Copy Markdown

@feanil can you help with reviewing this?

Comment thread .github/workflows/ci.yml
@@ -1,33 +1,33 @@
name: Python CI

on:

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.

CI should also run on merges to master to make sure we did have a bad merge.

Comment thread Makefile Outdated

test: test-python ## run tests
test: ## run tests
tox -e test

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.

This is not a valid environment that we've defined.

❯ make test
tox -e test
ROOT: HandledError| provided environments not found in configuration file:
test
make: *** [Makefile:25: test] Error 254

@mphilbrick211 mphilbrick211 moved this from Ready for Review to In Eng Review in Contributions Aug 19, 2026
salman2013 and others added 2 commits September 2, 2026 23:28
- ci.yml: add push: master trigger and permissions: contents: read
- release.yml: add github_token, vcs_release: false, Create GitHub
  Release with Assets step, release_notes output, permissions
- MANIFEST.in: remove stale requirements/constraints.txt ref, add
  prune rules for sdist hygiene
- Makefile: switch quality/test to uv run --group, split test-python
  target matching original style, add exit-5 guard for no tests
- pyproject.toml: add package-data for static/public, default-groups=[],
  tool.edx_lint section, source_pkgs for src layout, remove
  allow_zero_version/major_on_zero (repo is 1.x)
- tox.ini: remove django envs from envlist until tests exist, add
  max-complexity/show-source/count/statistics to flake8 config

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ublish.yml deleted

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@salman2013
salman2013 requested a review from feanil September 2, 2026 18:32
@feanil
feanil merged commit af5f1a5 into openedx:master Sep 9, 2026
3 checks passed
@github-project-automation github-project-automation Bot moved this from In Eng Review to Done in Contributions Sep 9, 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

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants