-
Notifications
You must be signed in to change notification settings - Fork 10
CI: Use 'uv tool run' for build and twine #101
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
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.
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.
Happy to move to UV personally 👍
|
||
- 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 |
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.
I do know that uvx
exists and is an alias for uv tool run
, but I decided to keep it more explicit for now.
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.
yep also not sure about their plans in the future so fine with that 👍
python -m pip install build twine | ||
python -m pip list | ||
- name: Install the latest version of uv | ||
uses: astral-sh/setup-uv@v3 |
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.
We pin everything to hashes in here, please do so with this one, too.
astral-sh/setup-uv
GitHub Action to setup the latestuv
.uv tool run --from build pyproject-build
to run build as the PyPI project name isbuild
but the executable it provides is namedpyproject-build
.uv tool run twine
to 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
: