Skip to content

Modernize python tooling - #685

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

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

Conversation

@salman2013

@salman2013 salman2013 commented Jul 14, 2026 •

Copy link
Copy Markdown

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

Ticket: openedx/public-engineering#511
Parent ticket: openedx/public-engineering#506

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

@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 14, 2026
@openedx-webhooks

Copy link
Copy Markdown

Thanks for the pull request, @salman2013!

This repository is currently maintained by @Faraz32123.

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.

@codecov

codecov Bot commented Jul 14, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.77%. Comparing base (334393e) to head (557fafc).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #685      +/-   ##
==========================================
- Coverage   97.93%   91.77%   -6.17%     
==========================================
  Files          84       36      -48     
  Lines        8147     3052    -5095     
  Branches        0      367     +367     
==========================================
- Hits         7979     2801    -5178     
- Misses        168      193      +25     
- Partials        0       58      +58     
Flag Coverage Δ
unittests 91.77% <100.00%> (-6.17%) ⬇️

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.

@mphilbrick211 mphilbrick211 moved this from Needs Triage to Ready for Review in Contributions Jul 15, 2026
@mphilbrick211
mphilbrick211 requested a review from Faraz32123 July 15, 2026 14:43

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

Thanks for the PR. Once CI is green, I'll again take a look at the PR.

Comment thread .github/workflows/ci.yml Outdated
python-version:
- '3.12'
toxenv: [django52, quality]
toxenv: [django42, django52, quality]

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.

django42 testing was already dropped. Let's only support django5.2.

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.

Already done — current ci.yml matrix is [django52, quality], no django42.

@irfanuddinahmad

Copy link
Copy Markdown
Contributor

👋 Reviewed this against the same checklist we've been applying across the modernization effort. One shared issue, one non-blocking note:

pypa/gh-action-pypi-publish@release/v1 is a floating branch ref, not a pinned SHA. This is what caused openedx/xblocks-core's release to fail with docker: manifest unknown (https://github.com/openedx/xblocks-core/actions/runs/29327012856/job/87066591905) — the ref resolved to a commit whose Docker image wasn't published on ghcr.io yet. Worth pinning to a commit SHA like the rest of this workflow's actions already are. (Traces back to openedx/sample-plugin's reference release.yml, which has the same gap — filed openedx/sample-plugin#54 and openedx/xblocks-core#280 for that.)

Minor/non-blocking: codecov/project is currently failing — real tests and codecov/patch (100%) pass, looks like a coverage-threshold comparison issue rather than a functional problem. major_on_zero/allow_zero_version are already correctly set here, nice.

@salman2013
salman2013 force-pushed the modernize-python-tooling branch 2 times, most recently from 10e707e to 9e15933 Compare July 17, 2026 17:31
@salman2013
salman2013 force-pushed the modernize-python-tooling branch 3 times, most recently from 6c30241 to 9a92bec Compare July 31, 2026 07:54
@salman2013

Copy link
Copy Markdown
Author

@Faraz32123 You can review the PR, thanks.

@salman2013
salman2013 requested a review from Faraz32123 July 31, 2026 07:56
@Faraz32123

Copy link
Copy Markdown
Contributor

@Faraz32123 You can review the PR, thanks.

@salman2013 Unfortunately, I’ve been quite busy lately and missed your message. Could you please resolve the conflicts and tag me again once they’re resolved?

salman2013 and others added 2 commits September 15, 2026 12:47
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add NOTICE to license-files so it ships in wheel dist-info
- Exclude test subpackages from wheel via packages.find
- Add default-groups = [] to [tool.uv]
- Fix release.yml: concurrency group, PSR v10.6.2, vcs_release=false,
  gh release create step, released output fallback, publish_to_pypi
  if-condition, pin pypa/gh-action-pypi-publish to SHA

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@salman2013
salman2013 force-pushed the modernize-python-tooling branch from 9a92bec to 01f0ba5 Compare September 15, 2026 08:07
@salman2013

Copy link
Copy Markdown
Author

@Faraz32123 conflicts have been resolved.

@irfanuddinahmad

Copy link
Copy Markdown
Contributor

A few things from a modernize-python-tooling review pass:

  1. pyproject.toml line 10: license = "AGPL-3.0" is the bare/deprecated SPDX form. setup.py's classifier reads 'License :: OSI Approved :: GNU Affero General Public License v3' with no "or later" — should be license = "AGPL-3.0-only".
  2. codecov/project is failing and the PR description doesn't explain the coverage shift — can you add a line on why, or confirm it's expected from the migration?
  3. (Minor/non-blocking) release.yml's GitHub-release step hardcodes TAG: v${{ steps.release.outputs.version }} instead of reusing ${{ steps.release.outputs.tag }} the way sample-plugin (and the other repos in this batch) do. Functionally equivalent today since tag_format defaults to v{version}, but fragile if that default is ever overridden.

- Use AGPL-3.0-only SPDX identifier to match the original
  "no or later" classifier, instead of the deprecated bare
  AGPL-3.0 form.
- Reuse python-semantic-release's tag output in release.yml
  instead of hardcoding a v-prefixed version string, matching
  the pattern used in sample-plugin.
- Fix make test to pass the lti_consumer label explicitly.
  After the src-layout migration, unittest's discovery can no
  longer recurse into src/ (no __init__.py), so the bare
  ./test.py --noinput invocation was silently running 0 tests
  while still exiting 0. This is what caused the codecov/project
  coverage drop from 97.93% to 33.28%.

Co-Authored-By: Claude Sonnet 5 <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: Ready for Review

Development

Successfully merging this pull request may close these issues.

5 participants