-
Notifications
You must be signed in to change notification settings - Fork 24
feat: modernize Python tooling (pyproject.toml + uv + semantic-release) #693
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
38
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.
+2,835
−2,643
Open
Changes from all commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
db37b47
feat: consolidate package metadata into pyproject.toml
73ac819
feat: switch dependency management from pip-compile to uv
31b597e
feat: add semantic-release for automated PyPI publishing
e167513
fix: correct release tag format and drop stale MANIFEST.in entries
5f703cc
fix: prevent uv sync from implicitly pulling in the dev group
ac3a32e
fix: publish to PyPI via OIDC instead of token
ed2b1fb
fix: pin pypa/gh-action-pypi-publish to a commit SHA
173d45c
fix: set major_on_zero=false and allow_zero_version=true for consistency
f1e097f
refactor: adopt src-layout, matching openedx/sample-plugin
a6cfe64
fix: update hardcoded fixture path in test_enterprise_client.py for s…
e433dd6
fix: pattern-gap audit (uv setup, package=true, changelog, MANIFEST.in)
f80b057
docs: drop stale Version/Changelog checklist items from PR template
ade014a
fix: pattern-gap audit round 2 (coverage config, twine removal, codec…
a1e15bc
Merge branch 'master' into irfanuddinahmad/uv-migration
1910560
fix: add codecov.yml to absorb one-time coverage measurement-scope drop
624f159
fix: restore CHANGELOG.rst and enable automated changelog updates
b8a1b05
fix: use stable pypa publish tag and drop tox from Makefile
db3521e
Merge branch 'master' into irfanuddinahmad/uv-migration
48c7381
fix: use int-parseable fallback_version instead of 0.0.0.dev0
d65e5dd
fix: pure-uv mysql8-migrations job, remove permanent codecov threshold
ae737a5
Merge branch 'master' into irfanuddinahmad/uv-migration
f471ded
fix: disable python-semantic-release changelog generation
2aa0151
style: trim codecov.yml explanatory comment
88e5d15
fix: pin pytest-django<4.13.0 to match master's compat constraint
d1621ee
fix: create GitHub release with assets attached, not after publish
irfanuddinahmad 00ce65d
fix: pin release.yml actions to sample-plugin's verified SHAs
irfanuddinahmad ab0a1a8
fix: use v-prefixed tag_format for release tag consistency
irfanuddinahmad e0f6a43
fix: update author to Open edX Project convention
irfanuddinahmad dca14b5
fix: restore __version__ dropped during pyproject.toml consolidation
irfanuddinahmad bcdb0bd
fix: remove dangling codecov.yml comments, not present pre-migration
irfanuddinahmad 397c9ba
Merge remote-tracking branch 'origin/master' into irfanuddinahmad/uv-…
irfanuddinahmad 1f1bf7c
fix: use secrets.GITHUB_TOKEN instead of custom org secret for releas…
irfanuddinahmad a8cadeb
fix: restore tox delegation for quality target
irfanuddinahmad 587a630
fix: drop uv run from Makefile per feanil's review feedback
irfanuddinahmad dd37c40
fix: inherit secrets in release.yml's run_ci call
irfanuddinahmad d6014a4
Merge remote-tracking branch 'upstream/master' into irfanuddinahmad/u…
irfanuddinahmad b28dec2
revert: drop unnecessary py312- prefix from tox envnames
irfanuddinahmad 722f89e
build(deps): bump python-semantic-release action pin to v10.7.0
irfanuddinahmad File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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,100 @@ | ||
| name: Semantic Release | ||
|
|
||
| on: | ||
| push: | ||
| branches: [master] | ||
|
|
||
| jobs: | ||
| run_ci: | ||
| uses: ./.github/workflows/ci.yml | ||
| secrets: inherit | ||
|
|
||
| release: | ||
| 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 | ||
| 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. `gh release create` handles this by creating the release as | ||
| # a draft, uploading the assets, and only then publishing 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 }} | ||
| RELEASE_NOTES: ${{ steps.release.outputs.release_notes }} | ||
| TAG: ${{ steps.release.outputs.tag }} | ||
| run: | | ||
| printf '%s' "$RELEASE_NOTES" > "$RUNNER_TEMP/release_notes.md" | ||
| gh release create "$TAG" \ | ||
| --verify-tag \ | ||
| --title "$TAG" \ | ||
| --notes-file "$RUNNER_TEMP/release_notes.md" \ | ||
| dist/* | ||
|
|
||
| - name: Upload | Distribution Artifacts | ||
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | ||
| 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: | ||
| 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@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | ||
| 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -81,4 +81,5 @@ geckodriver/ | |
|
|
||
| # pyenv | ||
| .python-version | ||
| venv/ | ||
| venv/ | ||
| .venv/ | ||
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,6 @@ | ||
| include CHANGELOG.rst | ||
| include CONTRIBUTING.rst | ||
| include LICENSE.txt | ||
| include README.rst | ||
| recursive-include enterprise_data *.html *.png *.gif *js *.css *jpg *jpeg *svg *py *.txt *.json | ||
| recursive-include enterprise_reporting *.html *.png *.gif *js *.css *jpg *jpeg *svg *py *.txt *.json | ||
| recursive-include enterprise_data_roles *.html *.png *.gif *js *.css *jpg *jpeg *svg *py *.txt *.json | ||
| recursive-include requirements *.txt | ||
| include requirements/base.in | ||
| include requirements/reporting.in | ||
| include requirements/constraints.txt | ||
| include README.md | ||
| recursive-include src/enterprise_data *.html *.png *.gif *js *.css *jpg *jpeg *svg *py *.txt *.json | ||
| recursive-include src/enterprise_reporting *.html *.png *.gif *js *.css *jpg *jpeg *svg *py *.txt *.json | ||
| recursive-include src/enterprise_data_roles *.html *.png *.gif *js *.css *jpg *jpeg *svg *py *.txt *.json | ||
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 |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| coverage: | ||
| status: | ||
| project: | ||
| default: | ||
| target: auto | ||
| patch: | ||
| default: | ||
| target: auto | ||
|
|
||
| comment: false |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you check if this .txt still needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
*.txtglob in therecursive-includeline is still there — onlyrequirements/*.txtwas removed, since therequirements/directory itself no longer exists now that dependencies live inpyproject.toml/uv.lock.There's currently no tracked
.txtfile under the package source dir that this pattern would match, but it was already present (unchanged) before this migration, so I left it as a harmless no-op rather than pruning it as part of this PR.