-
Notifications
You must be signed in to change notification settings - Fork 29
Use UV in workflows #209
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
Use UV in workflows #209
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
2ce36f3
Move to UV, adjust docs
jqtrde b913d80
Use uv in Github actions
jqtrde e60d352
Add uv.lock
jqtrde aa66069
Update uv.lock
jqtrde c4a4788
Rebase cleanup
jqtrde 0371029
Use 3.11 in release flow
jqtrde 90365b6
Update uv.lock
jqtrde 1526049
Test action installs from uv.lock
jqtrde 3c5c67f
Bump setup-uv action versions
jqtrde ca2fac7
Address security issues in workflows
jqtrde fabf0ee
Bump version to v2.2.0
jqtrde 6f9fe6b
Position is important
jqtrde 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 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,51 +1,62 @@ | ||
| name: release | ||
|
|
||
| on: | ||
| permissions: | ||
| contents: read | ||
|
|
||
| on: | ||
| push: | ||
| tags: | ||
| - '*' | ||
| - "*" | ||
|
|
||
| jobs: | ||
| release-test: | ||
| runs-on: ubuntu-22.04 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - uses: ./.github/actions/build-package | ||
| with: | ||
| python-version: '3.11' | ||
|
|
||
| - name: Set up a fresh environment and run tests | ||
| run: | | ||
| python -m venv venv | ||
| source venv/bin/activate | ||
| pip install dist/*.tar.gz | ||
| pip install dist/*.whl | ||
| pip install -e '.[test,estimate-area]' | ||
| pytest | ||
|
|
||
| release: | ||
| runs-on: ubuntu-22.04 | ||
| needs: release-test | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Python 3.11 | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: '3.11' | ||
|
|
||
| - name: Compare tags | ||
| run: | | ||
| PKG_VERSION=$(python -c "import pathlib, tomllib; data = tomllib.loads(pathlib.Path('pyproject.toml').read_text()); print(data['project']['version'])") | ||
| echo "Checking that package version [v$PKG_VERSION] matches release tag [${{ github.ref_name }}]" | ||
| [ "${{ github.ref_type }}" = "tag" ] && [ "${{ github.ref_name }}" = "v$PKG_VERSION" ] | ||
|
|
||
| - uses: ./.github/actions/build-package | ||
| with: | ||
| python-version: '3.11' | ||
|
|
||
| - name: Run deployment | ||
| run: | ||
| twine upload dist/* -r pypi -u __token__ -p ${{ secrets.PYPI_PASSWORD }} | ||
| release-test: | ||
| runs-on: ubuntu-22.04 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up uv | ||
| uses: astral-sh/setup-uv@v7 | ||
| with: | ||
| python-version: "3.11" | ||
|
|
||
| - name: Build package | ||
| run: uv build | ||
|
|
||
| - name: Set up a fresh environment and run tests | ||
| run: | | ||
| uv venv | ||
| uv pip install dist/*.tar.gz | ||
| uv pip install dist/*.whl | ||
| uv pip install -e '.[test,estimate-area]' | ||
| uv run pytest | ||
|
|
||
| release: | ||
| runs-on: ubuntu-22.04 | ||
| needs: release-test | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up uv | ||
| uses: astral-sh/setup-uv@v7 | ||
| with: | ||
| python-version: "3.11" | ||
|
|
||
| - name: Compare tags | ||
| run: | | ||
| PKG_VERSION=$(python -c "import pathlib, tomllib; data = tomllib.loads(pathlib.Path('pyproject.toml').read_text()); print(data['project']['version'])") | ||
| echo "Checking that package version [v$PKG_VERSION] matches release tag [${{ github.ref_name }}]" | ||
| [ "${{ github.ref_type }}" = "tag" ] && [ "${{ github.ref_name }}" = "v$PKG_VERSION" ] | ||
|
|
||
| - name: Build package | ||
| run: uv build | ||
|
|
||
| - name: Install Twine | ||
| run: | | ||
| uv venv | ||
| uv pip install twine | ||
|
|
||
| - name: Validate deployment | ||
| run: uv run twine check dist/* | ||
|
|
||
| - name: Run deployment | ||
| run: uv run twine upload dist/* -r pypi -u __token__ -p ${{ secrets.PYPI_PASSWORD }} | ||
|
||
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 |
|---|---|---|
|
|
@@ -2,6 +2,9 @@ | |
|
|
||
| ======= | ||
|
|
||
| # 2.2.0 (2026-01-06) | ||
| - Use UV | ||
|
|
||
| # 2.1.0 (2025-12-24) | ||
| - Replace black with ruff | ||
|
|
||
|
|
||
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
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.