CI: Use 'uv tool run' for build and twine#101
Merged
matthewfeickert merged 1 commit intomainfrom Sep 30, 2024
Merged
Conversation
* Use the astral-sh/setup-uv GitHub Action to setup the latest uv.
- This GitHub Action can be left unpinned as it should be updated
regularly.
* Use 'uv tool run --from build pyproject-build' to run build as the PyPI
project name is 'build' but the executable it provides is named
'pyproject-build'.
* Use 'uv tool run twine' to run twine.
tupui
approved these changes
Sep 30, 2024
Member
tupui
left a comment
There was a problem hiding this comment.
Happy to move to UV personally 👍
matthewfeickert
commented
Sep 30, 2024
| - name: Build v0.0.1 wheel and sdist | ||
| run: | | ||
| python -m build --outdir ./dist _action_path/tests/test_package | ||
| uv tool run --from build pyproject-build --installer=uv --outdir ./dist _action_path/tests/test_package |
Member
Author
There was a problem hiding this comment.
I do know that uvx exists and is an alias for uv tool run, but I decided to keep it more explicit for now.
Member
There was a problem hiding this comment.
yep also not sure about their plans in the future so fine with that 👍
bsipocz
reviewed
Sep 30, 2024
| python -m pip install build twine | ||
| python -m pip list | ||
| - name: Install the latest version of uv | ||
| uses: astral-sh/setup-uv@v3 |
Member
There was a problem hiding this comment.
We pin everything to hashes in here, please do so with this one, too.
This was referenced Oct 1, 2024
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
astral-sh/setup-uvGitHub Action to setup the latestuv.uv tool run --from build pyproject-buildto run build as the PyPI project name isbuildbut the executable it provides is namedpyproject-build.uv tool run twineto runtwine.c.f. https://docs.astral.sh/uv/reference/cli/#uv-tool-run
Time comparison between
python -m build,python -m build --installer=uv, anduv tool run --from build pyproject-build: