-
Notifications
You must be signed in to change notification settings - Fork 10
Modernize Python repo: pyproject.toml + uv + semantic-release #251
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
Merged
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
371b251
chore: migrate package metadata to pyproject.toml
salman2013 4e95632
chore: switch dependency management from pip-tools to uv
salman2013 767f8d9
chore: add python-semantic-release and commitlint workflows
salman2013 6a63483
Merge origin/main into salman/modernize-branch
salman2013 9bedfc8
Merge origin/main into salman/modernize-branch
salman2013 0d00eff
Merge remote-tracking branch 'origin/main' into salman/modernize-branch
salman2013 b57901f
chore: fix semantic-release build_command to use python -m build
salman2013 abf6f6d
chore: migrate to ruff and modernize tooling
salman2013 bd2ce76
chore: align ruff and coverage config with xblocks-extra standard
salman2013 5f3c03a
Merge remote-tracking branch 'origin/main' into salman/modernize-branch
salman2013 7b309a7
fix: fixed the comments by reviewer and copilot
salman2013 64a0b4c
chore: add explicit permissions to run_tests job in release.yml
salman2013 1488138
chore: remove redundant setup-python step in CI workflow
salman2013 bc068a4
chore: fix ruff lint and formatting issues (#267)
salman2013 3fff179
fix: resolve remaining ruff quality violations to pass CI checks
salman2013 e13d1f3
fix: apply ruff formatting to 5 files failing format check
salman2013 6c47d7e
fix: remove sensitive data from LTI OAuth error logs
salman2013 c69fc0f
fix: address PR review feedback on modernize changes
salman2013 246fb7c
Merge remote-tracking branch 'origin/main' into salman/modernize-branch
salman2013 cc03563
fix: use kebab-case for setuptools exclude-package-data section
salman2013 6a9a661
chore: merge main into salman/modernize-branch, resolve requirements …
salman2013 e07978d
fix: revert PyPI auth to token-based to avoid OIDC trusted publisher …
salman2013 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 was deleted.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,101 @@ | ||
| name: Release | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
|
|
||
| jobs: | ||
| run_tests: | ||
| uses: ./.github/workflows/python-tests.yml | ||
| secrets: inherit | ||
| permissions: | ||
| contents: read | ||
|
|
||
| release: | ||
|
github-advanced-security[bot] marked this conversation as resolved.
Fixed
|
||
| needs: run_tests | ||
| runs-on: ubuntu-latest | ||
| if: github.ref_name == 'main' | ||
| concurrency: | ||
| group: ${{ github.workflow }}-release-${{ github.ref_name }} | ||
| cancel-in-progress: false | ||
|
|
||
| permissions: | ||
| contents: write | ||
|
|
||
| steps: | ||
| # Checkout at the branch that triggered the workflow, then force-reset to | ||
| # the exact sha so we don't accidentally release commits that arrived | ||
| # while this workflow was running. | ||
| - name: Setup | Checkout Repository on Release Branch | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| with: | ||
| ref: ${{ github.ref_name }} | ||
|
|
||
| - name: Setup | Force release branch to workflow sha | ||
| run: git reset --hard ${{ github.sha }} | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 | ||
| with: | ||
| python-version: "3.12" | ||
|
|
||
| - name: Set up Node.js | ||
| uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | ||
| with: | ||
| node-version: 24 | ||
|
|
||
| - name: Install npm dependencies and build | ||
| run: | | ||
| npm ci | ||
| npm run build | ||
|
|
||
| - name: Action | Semantic Version Release | ||
| id: release | ||
| uses: python-semantic-release/python-semantic-release@754a065a2ea187da71977ada6630a8ec0f98e380 # v10.5.3 | ||
| with: | ||
| github_token: ${{ secrets.GITHUB_TOKEN }} | ||
| git_committer_name: "github-actions" | ||
| git_committer_email: "actions@users.noreply.github.com" | ||
| changelog: "false" | ||
|
|
||
| - name: Publish | Upload to GitHub Release Assets | ||
| uses: python-semantic-release/publish-action@68eaac9f1f594e9ec4b985245d06355734f43eea # v10.5.3 | ||
| if: steps.release.outputs.released == 'true' | ||
| with: | ||
| github_token: ${{ secrets.GITHUB_TOKEN }} | ||
| tag: ${{ steps.release.outputs.tag }} | ||
|
|
||
| - name: Upload | Distribution Artifacts | ||
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.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: | ||
| # Separate from the release job for least privilege and retry-ability: | ||
| # publishing can fail independently and shouldn't require reversing the release. | ||
| runs-on: ubuntu-latest | ||
| needs: release | ||
| if: github.ref_name == 'main' && needs.release.outputs.released == 'true' | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| steps: | ||
| - name: Download Distribution Artifacts | ||
| uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 | ||
| with: | ||
| name: distribution-artifacts | ||
| path: dist/ | ||
|
|
||
| - name: Publish to PyPI | ||
| uses: pypa/gh-action-pypi-publish@7f25271a4aa483500f742f9492b2ab5648d61011 # v1.12.4 | ||
| with: | ||
| user: __token__ | ||
| password: ${{ secrets.PYPI_UPLOAD_TOKEN }} | ||
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
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.