Repository navigation
feat: modernize Python tooling (pyproject.toml + uv + semantic-release) #2654
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
irfanuddinahmad
wants to merge
49
commits into
master
Choose a base branch
from
irfanuddinahmad/uv-migration
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
49 commits
Select commit
Hold shift + click to select a range
c66ff7a
feat: consolidate package metadata into pyproject.toml
9600316
feat: switch dependency management from pip-compile to uv
6091ef2
feat: add semantic-release for automated PyPI publishing
ad1309a
fix: pin pylint/astroid and fix lxml extras parsing in platform const…
d262ab7
fix: docs testenv build+twine chain (locale symlink, twine pin, setup…
06b6d6d
fix: restore pycodestyle config lost when setup.cfg was removed
b385c85
fix: drop stale MANIFEST.in requirements entries and dead exclusion c…
b923687
fix: prevent uv sync from implicitly pulling in the dev group
0563b55
fix: mark openedx-platform-synced pins with provenance comments
436c7a8
fix: publish to PyPI via OIDC instead of token
c8f7597
fix: pin pypa/gh-action-pypi-publish to a commit SHA
b3b7f2a
fix: set major_on_zero=false and allow_zero_version=true for consistency
0d6299b
refactor: adopt src-layout, matching openedx/sample-plugin
ed4f0c6
fix: pattern-gap audit (uv setup, package=true, coverage, changelog)
ce5c672
docs: drop stale Version/Changelog checklist items from PR template
d201fb2
fix: pattern-gap audit round 2 (uv run wrapping, dynamic readme, read…
2f469b5
Merge branch 'master' into irfanuddinahmad/uv-migration
8c68932
fix: restore CHANGELOG.rst and enable auto-updating changelog via sem…
d974976
docs: remove stale manual tag/PyPI-verification steps from PR template
5c7b458
fix: use stable pypa publish tag and drop tox from Makefile
2421d08
Merge branch 'master' into irfanuddinahmad/uv-migration
6929158
fix: use int-parseable fallback_version instead of 0.0.0.dev0
6e831b2
Merge branch 'master' into irfanuddinahmad/uv-migration
00f569e
fix: bump openedx-filters constraint to 3.9.0 for logistration filters
f60b136
fix: restore dropped docs deps, use pure uv for mysql8/postgresql mig…
192d9a9
Merge branch 'master' into irfanuddinahmad/uv-migration
ef4810c
fix: disable python-semantic-release changelog generation
a9194aa
Merge branch 'master' into irfanuddinahmad/uv-migration
12aa57c
Merge remote-tracking branch 'origin/master' into irfanuddinahmad/uv-…
irfanuddinahmad dadb888
fix: upgrade edx-lint to 6.2.0 to match merged pylintrc
irfanuddinahmad 66931c6
fix: create GitHub release with assets attached, not after publish
irfanuddinahmad 441a17c
Merge remote-tracking branch 'upstream/master' into irfanuddinahmad/u…
irfanuddinahmad 87851f9
fix: align release.yml action pins with sample-plugin gold standard
irfanuddinahmad e3a25ab
fix: align importlib.metadata.version aliasing with sample-plugin
irfanuddinahmad 8aa66a1
fix: update author to Open edX Project convention
irfanuddinahmad b92a54d
fix: real package description, correct tag_format for semantic-release
irfanuddinahmad 16e0fe2
fix: restore native RTD formats/fail_on_warning via uv install method
irfanuddinahmad b2f4195
Merge remote-tracking branch 'origin/master' into irfanuddinahmad/uv-…
irfanuddinahmad 41218ad
fix: use uv run python for the BROWSER auto-open helper
irfanuddinahmad 4eab35d
Merge remote-tracking branch 'origin/master' into irfanuddinahmad/uv-…
irfanuddinahmad 1009d09
fix: use secrets.GITHUB_TOKEN instead of custom org secret for releas…
irfanuddinahmad 49c51b7
fix: restore tox delegation for docs/isort/isort-check/pii_check/jasmine
irfanuddinahmad c97f348
fix: drop uv run from Makefile per feanil's review feedback
irfanuddinahmad 7c12a15
Merge remote-tracking branch 'origin/master' into irfanuddinahmad/uv-…
irfanuddinahmad 3cb35e5
chore: bump python-semantic-release action to v10.7.0
irfanuddinahmad 4584c0e
Merge remote-tracking branch 'origin/master' into irfanuddinahmad/uv-…
irfanuddinahmad 0fb3df3
Merge remote-tracking branch 'origin/master' into irfanuddinahmad/uv-…
irfanuddinahmad b043c35
Merge branch 'master' into irfanuddinahmad/uv-migration
irfanuddinahmad eb67eef
fix: match release.yml to sample-plugin's current file
irfanuddinahmad File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,117 @@ | ||
| name: Semantic Release | ||
|
|
||
| on: | ||
| push: | ||
| branches: [master] | ||
|
|
||
| jobs: | ||
| # The same aggregate a pull request has to pass, so the release runs exactly | ||
| # the checks that were required to merge -- and picks up any package added to | ||
| # ci.yml later without needing a change here. | ||
| run_ci: | ||
| uses: ./.github/workflows/ci.yml | ||
|
|
||
| release: | ||
| # Every package this workflow publishes has to build before we tag | ||
| # anything. The GitHub release and the PyPI uploads cannot be taken back, | ||
| # so a package that only fails to build in its publish job would leave the | ||
| # release half-finished. | ||
| needs: [run_ci] | ||
| runs-on: ubuntu-latest | ||
| if: github.ref_name == 'master' | ||
| concurrency: | ||
| group: ${{ github.workflow }}-release-${{ github.ref_name }} | ||
| cancel-in-progress: false | ||
|
|
||
| permissions: | ||
| contents: write | ||
|
|
||
| steps: | ||
| # Note: We checkout the repository at the branch that triggered the workflow. | ||
| # Python Semantic Release will automatically convert shallow clones to full clones | ||
| # if needed to ensure proper history evaluation. However, we forcefully reset the | ||
| # branch to the workflow sha because it is possible that the branch was updated | ||
| # while the workflow was running, which prevents accidentally releasing un-evaluated | ||
| # changes. | ||
| - name: Setup | Checkout Repository on Release Branch | ||
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| ref: ${{ github.ref_name }} | ||
|
|
||
| - name: Setup | Force release branch to be at workflow sha | ||
| run: | | ||
| git reset --hard ${{ github.sha }} | ||
|
|
||
| - name: Action | Semantic Version Release | ||
| id: release | ||
| # Adjust tag with desired version if applicable. | ||
| uses: python-semantic-release/python-semantic-release@b700dbeb1f431a0fcc30a79f3f0869407fe07278 # v10.7.0 | ||
| with: | ||
| github_token: ${{ secrets.GITHUB_TOKEN }} | ||
| git_committer_name: "github-actions" | ||
| git_committer_email: "actions@users.noreply.github.com" | ||
| changelog: "false" | ||
| # Commit, tag, push and build, but don't create the GitHub release. | ||
| # We create it ourselves in the next step so that the distributions | ||
| # are attached before the release is published. See that step for why. | ||
| vcs_release: "false" | ||
|
|
||
| # This repo has immutable releases enabled, which freezes a release's | ||
| # assets the moment it is published, so assets cannot be attached | ||
| # afterwards. Everything we want on the release has to be built by now | ||
| # and passed to this one command, which creates the release as a draft, | ||
| # uploads the assets, and only then publishes it: | ||
| # https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/immutable-releases | ||
| - name: Publish | Create GitHub Release with Assets | ||
| if: steps.release.outputs.released == 'true' | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| # Reuse the release notes python-semantic-release generated for us. | ||
| RELEASE_NOTES: ${{ steps.release.outputs.release_notes }} | ||
| TAG: ${{ steps.release.outputs.tag }} | ||
| run: | | ||
| # Output the release notes to a file | ||
| printf '%s' "$RELEASE_NOTES" > "$RUNNER_TEMP/release_notes.md" | ||
| # Creates the release as a draft, uploads the assets, and then | ||
| # publishes it -- all within this one command. | ||
| gh release create "$TAG" \ | ||
| --verify-tag \ | ||
| --title "$TAG" \ | ||
| --notes-file "$RUNNER_TEMP/release_notes.md" \ | ||
| dist/* | ||
|
|
||
| - name: Upload | Distribution Artifacts | ||
| uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 | ||
| if: steps.release.outputs.released == 'true' | ||
| with: | ||
| name: distribution-artifacts | ||
| path: dist | ||
| if-no-files-found: error | ||
|
|
||
| outputs: | ||
| released: ${{ steps.release.outputs.released || 'false' }} | ||
| version: ${{ steps.release.outputs.version }} | ||
|
|
||
| publish_to_pypi: | ||
| # 1. Separate out the publish step from the github release step to run each step at | ||
| # the least amount of token privilege | ||
| # 2. Also, publishing can fail, and its better to have a separate job if you need to retry | ||
| # and it won't require reversing the release. | ||
| runs-on: ubuntu-latest | ||
| needs: release | ||
| if: github.ref_name == 'master' && needs.release.outputs.released == 'true' | ||
|
|
||
| permissions: | ||
| contents: read | ||
| id-token: write | ||
|
|
||
| steps: | ||
| - name: Setup | Download Build Artifacts | ||
| uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 | ||
| id: artifact-download | ||
| with: | ||
| name: distribution-artifacts | ||
| path: dist | ||
|
|
||
| - name: Publish to PyPi | ||
| uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,9 @@ | ||
| include AUTHORS | ||
| include CHANGELOG.rst | ||
| include CONTRIBUTING.rst | ||
| include LICENSE.txt | ||
| include README.rst | ||
| recursive-include enterprise *.html *.png *.gif *js *.css *jpg *jpeg *svg *py *.txt *.po *.mo | ||
| recursive-include enterprise_learner_portal *.html *.png *.gif *js *.css *jpg *jpeg *svg *py *.txt | ||
| recursive-include integrated_channels *.html *.png *.gif *js *.css *jpg *jpeg *svg *py *.txt | ||
| recursive-include consent *.html *.png *.gif *js *.css *jpg *jpeg *svg *py *.txt | ||
| recursive-include requirements *.txt *.in | ||
| include requirements/constraints.txt | ||
| recursive-include src/enterprise *.html *.png *.gif *js *.css *jpg *jpeg *svg *py *.txt *.po *.mo | ||
| exclude src/enterprise/locale | ||
| recursive-include src/enterprise_learner_portal *.html *.png *.gif *js *.css *jpg *jpeg *svg *py *.txt | ||
| recursive-include src/integrated_channels *.html *.png *.gif *js *.css *jpg *jpeg *svg *py *.txt | ||
| recursive-include src/consent *.html *.png *.gif *js *.css *jpg *jpeg *svg *py *.txt | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.