Skip to content

Commit 459d161

Browse files
CI: Use 'uv tool run' for build and twine (#101)
* 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. * c.f. https://docs.astral.sh/uv/reference/cli/#uv-tool-run
1 parent 9d888d2 commit 459d161

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

.github/workflows/ci.yml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,15 @@ jobs:
3131
with:
3232
python-version: '3.x'
3333

34-
- name: Install python-build and twine
35-
run: |
36-
python -m pip install --upgrade pip
37-
python -m pip install build twine
38-
python -m pip list
34+
- name: Install the latest version of uv
35+
uses: astral-sh/setup-uv@v3
3936

4037
- name: Build v0.0.1 wheel and sdist
4138
run: |
42-
python -m build --outdir ./dist _action_path/tests/test_package
39+
uv tool run --from build pyproject-build --installer=uv --outdir ./dist _action_path/tests/test_package
4340
4441
- name: Verify the distribution
45-
run: twine check --strict dist/*
42+
run: uv tool run twine check --strict dist/*
4643

4744
- name: List contents of sdist
4845
run: python -m tarfile --list dist/test_package-*.tar.gz
@@ -67,7 +64,7 @@ jobs:
6764
# Bump version to avoid wheel name conflicts
6865
sed -i 's/0.0.1/0.0.2/g' _action_path/tests/test_package/pyproject.toml
6966
rm ./dist/*
70-
python -m build --outdir ./dist _action_path/tests/test_package
67+
uv tool run --from build pyproject-build --installer=uv --outdir ./dist _action_path/tests/test_package
7168
7269
- name: Test upload with non-main label
7370
uses: ./_action_path/
@@ -81,7 +78,7 @@ jobs:
8178
# Bump version to avoid wheel name conflicts
8279
sed -i 's/0.0.2/0.0.3/g' _action_path/tests/test_package/pyproject.toml
8380
rm ./dist/*
84-
python -m build --outdir ./dist _action_path/tests/test_package
81+
uv tool run --from build pyproject-build --installer=uv --outdir ./dist _action_path/tests/test_package
8582
8683
- name: Test upload with multiple labels
8784
uses: ./_action_path/

0 commit comments

Comments
 (0)