Skip to content

Commit 4ab4415

Browse files
committed
CI: use uv
1 parent c9df947 commit 4ab4415

File tree

5 files changed

+20
-24
lines changed

5 files changed

+20
-24
lines changed

.github/scripts/build-cpu.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ declare build_os
44

55
set -xeuo pipefail
66

7-
pip install cmake==3.28.3
7+
uv tool install cmake==3.28.3
88

99
if [ "${build_os:0:5}" == macos ] && [ "${build_arch}" == aarch64 ]; then
1010
cmake -DCMAKE_OSX_ARCHITECTURES=arm64 -DCOMPUTE_BACKEND=cpu .

.github/scripts/build-cuda.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ else
2727
[[ "${cuda_version}" == 13.*.* ]] && build_capability="75;80;86;89;90;100;120"
2828
fi
2929

30-
[[ "${build_os}" = windows-* ]] && python3 -m pip install ninja
30+
uv tool install ninja cmake==3.28.3
3131

3232
if [ "${build_os:0:6}" == ubuntu ]; then
3333
# We'll use Rocky Linux 8 in order to maintain manylinux 2.24 compatibility.
@@ -41,7 +41,6 @@ if [ "${build_os:0:6}" == ubuntu ]; then
4141
&& cmake -DCOMPUTE_BACKEND=cuda -DCOMPUTE_CAPABILITY=\"${build_capability}\" . \
4242
&& cmake --build . --config Release"
4343
else
44-
pip install cmake==3.28.3
4544
cmake -G Ninja -DCOMPUTE_BACKEND=cuda -DCOMPUTE_CAPABILITY="${build_capability}" -DCMAKE_BUILD_TYPE=Release -S .
4645
cmake --build . --config Release
4746
fi

.github/scripts/build-rocm.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ if [ "${build_os:0:6}" == ubuntu ]; then
1818
docker run --rm --platform "linux/$build_arch" -i \
1919
-w /src -v "$PWD:/src" "$image" sh -c \
2020
"apt-get update \
21-
&& pip install cmake==3.31.6 \
21+
&& uv tool install cmake==3.31.6 \
2222
&& cmake -DCOMPUTE_BACKEND=hip -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_HIP_FLAGS=\"--offload-compress\" -DBNB_ROCM_ARCH=\"${bnb_rocm_arch}\" . \
2323
&& cmake --build ."
2424
fi

.github/workflows/python-package.yml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,9 @@ jobs:
140140
runs-on: ${{ matrix.os }}
141141
steps:
142142
- uses: actions/checkout@v6
143+
- uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b
144+
with:
145+
python-version: '3.14'
143146
- name: Clean up disk space
144147
run: |
145148
echo "Disk space before cleanup:"
@@ -209,18 +212,17 @@ jobs:
209212
ls -lR output/
210213
cp output/${{ matrix.os }}/${{ matrix.arch }}/* bitsandbytes/
211214
- name: Set up Python ${{ matrix.python-version }}
212-
uses: actions/setup-python@v6
215+
uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b # v7.2.0
213216
with:
214217
python-version: ${{ matrix.python-version }}
215-
cache: pip
216-
- run: pip install build wheel
217-
- run: python -m build .
218+
enable-cache: 'true'
219+
- run: uv build
218220
- name: Determine and Set Platform Tag, then Tag Wheel
219221
shell: bash
220222
run: |
221223
PLATFORM_TAG=$(python .github/scripts/set_platform_tag.py "${{ matrix.arch }}")
222224
echo "PLATFORM_TAG=$PLATFORM_TAG"
223-
wheel tags --remove --abi-tag=none --python-tag=py3 --platform-tag=$PLATFORM_TAG dist/bitsandbytes-*.whl
225+
uvx wheel tags --remove --abi-tag=none --python-tag=py3 --platform-tag=$PLATFORM_TAG dist/bitsandbytes-*.whl
224226
- name: Upload build artifact
225227
uses: actions/upload-artifact@v6
226228
with:
@@ -378,12 +380,8 @@ jobs:
378380
with:
379381
name: bdist_wheel_${{ matrix.os }}_${{ matrix.arch }}
380382
path: wheels/
381-
- name: Set up Python
382-
uses: actions/setup-python@v6
383-
with:
384-
python-version: "3.12"
385-
- run: pip install auditwheel
386-
- run: python ./.github/scripts/auditwheel_show.py wheels/* | tee $GITHUB_STEP_SUMMARY
383+
- uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b # v7.2.0
384+
- run: uv run --no-sync --with=auditwheel ./.github/scripts/auditwheel_show.py wheels/* | tee $GITHUB_STEP_SUMMARY
387385

388386
publish-wheels:
389387
name: Publish wheels to PyPI

.github/workflows/test-runner.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -193,10 +193,10 @@ jobs:
193193
path: bitsandbytes/
194194
merge-multiple: true
195195

196-
- name: Setup Python
197-
uses: actions/setup-python@v6
196+
- uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b
198197
with:
199198
python-version: '3.10'
199+
activate-environment: 'true'
200200

201201
# Windows: Setup MSVC for torch.compile
202202
- name: Setup MSVC
@@ -205,21 +205,20 @@ jobs:
205205

206206
- name: Install dependencies
207207
run: |
208-
pip install torch==${{ inputs.torch_version }} --index-url ${{ inputs.pypi_index }}
209-
pip install -e ".[test]" -v
210-
pip install pytest-cov
208+
uv pip install torch==${{ inputs.torch_version }} --index-url ${{ inputs.pypi_index }}
209+
uv pip install pytest-cov -e ".[test]"
211210
212211
# Windows: Downgrade NumPy for torch<2.4.1 compatibility
213212
# See: https://github.com/pytorch/pytorch/issues/131668
214213
- name: Downgrade NumPy
215214
if: inputs.platform == 'windows' && startsWith(inputs.torch_version, '2.3.')
216-
run: pip install "numpy<2"
215+
run: uv pip install "numpy<2"
217216

218217
- name: Show installed packages
219-
run: pip list
218+
run: uv pip list
220219

221220
- name: Show environment information
222-
run: python -m torch.utils.collect_env
221+
run: uv run -m torch.utils.collect_env
223222

224223
- name: Run tests
225-
run: pytest --durations=100
224+
run: uv run pytest --durations=100

0 commit comments

Comments
 (0)