Skip to content

Commit d7961fe

Browse files
authored
Use uv with nox (#5383)
Right now I see creating venvs taking 30 seconds sometimes, this should dramatically speed that up
1 parent 6de9021 commit d7961fe

File tree

7 files changed

+19
-16
lines changed

7 files changed

+19
-16
lines changed

.github/workflows/benches.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
tool: cargo-codspeed
3838

3939
- name: Install nox
40-
run: pip install nox
40+
run: pip install nox[uv]
4141

4242
- name: Run the benchmarks
4343
uses: CodSpeedHQ/action@v3

.github/workflows/build.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ on:
2323
type: boolean
2424
default: false
2525

26+
env:
27+
NOX_DEFAULT_VENV_BACKEND: uv
28+
2629
jobs:
2730
build:
2831
continue-on-error: ${{ endsWith(inputs.python-version, '-dev') || contains(fromJSON('["3.7", "3.8"]'), inputs.python-version) || contains(fromJSON('["beta", "nightly"]'), inputs.rust) }}
@@ -49,7 +52,7 @@ jobs:
4952
check-latest: ${{ startsWith(inputs.python-version, 'pypy') }}
5053

5154
- name: Install nox
52-
run: python -m pip install --upgrade pip && pip install nox
55+
run: python -m pip install --upgrade pip && pip install nox[uv]
5356

5457
- name: Install Rust toolchain
5558
uses: dtolnay/rust-toolchain@master

.github/workflows/changelog.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ jobs:
1313
- uses: actions/setup-python@v5
1414
with:
1515
python-version: '3.13'
16-
- run: python -m pip install --upgrade pip && pip install nox
16+
- run: python -m pip install --upgrade pip && pip install nox[uv]
1717
- run: nox -s check-changelog

.github/workflows/ci.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- uses: actions/setup-python@v5
2525
with:
2626
python-version: "3.13"
27-
- run: python -m pip install --upgrade pip && pip install nox
27+
- run: python -m pip install --upgrade pip && pip install nox[uv]
2828
- uses: dtolnay/rust-toolchain@stable
2929
with:
3030
components: rustfmt
@@ -73,7 +73,7 @@ jobs:
7373
- uses: Swatinem/rust-cache@v2
7474
with:
7575
save-if: ${{ github.ref == 'refs/heads/main' || contains(github.event.pull_request.labels.*.name, 'CI-save-pr-cache') }}
76-
- run: python -m pip install --upgrade pip && pip install nox
76+
- run: python -m pip install --upgrade pip && pip install nox[uv]
7777
# This is a smoke test to confirm that CI will run on MSRV (including dev dependencies)
7878
- name: Check with MSRV package versions
7979
run: |
@@ -414,7 +414,7 @@ jobs:
414414
save-if: ${{ github.ref == 'refs/heads/main' || contains(github.event.pull_request.labels.*.name, 'CI-save-pr-cache') }}
415415
- uses: dtolnay/rust-toolchain@stable
416416
- uses: taiki-e/install-action@valgrind
417-
- run: python -m pip install --upgrade pip && pip install nox
417+
- run: python -m pip install --upgrade pip && pip install nox[uv]
418418
- run: nox -s test-rust -- release skip-full
419419
env:
420420
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER: valgrind --leak-check=no --error-exitcode=1
@@ -437,7 +437,7 @@ jobs:
437437
with:
438438
components: rust-src
439439
- uses: taiki-e/install-action@cargo-careful
440-
- run: python -m pip install --upgrade pip && pip install nox
440+
- run: python -m pip install --upgrade pip && pip install nox[uv]
441441
- run: nox -s test-rust -- careful skip-full
442442
env:
443443
RUST_BACKTRACE: 1
@@ -480,7 +480,7 @@ jobs:
480480
- uses: actions/setup-node@v4
481481
with:
482482
node-version: 18
483-
- run: python -m pip install --upgrade pip && pip install nox
483+
- run: python -m pip install --upgrade pip && pip install nox[uv]
484484
- uses: actions/cache/restore@v4
485485
id: cache
486486
with:
@@ -528,7 +528,7 @@ jobs:
528528
echo PYTHONHOME=$(pwd)/python/install >> $GITHUB_ENV
529529
echo PYO3_PYTHON=$(pwd)/python/install/bin/python3 >> $GITHUB_ENV
530530
- run: python3 -m sysconfig
531-
- run: python3 -m pip install --upgrade pip && pip install nox
531+
- run: python3 -m pip install --upgrade pip && pip install nox[uv]
532532
- run: |
533533
PYO3_CONFIG_FILE=$(mktemp)
534534
cat > $PYO3_CONFIG_FILE << EOF
@@ -559,7 +559,7 @@ jobs:
559559
with:
560560
save-if: ${{ github.ref == 'refs/heads/main' || contains(github.event.pull_request.labels.*.name, 'CI-save-pr-cache') }}
561561
- uses: dtolnay/rust-toolchain@stable
562-
- run: python3 -m pip install --upgrade pip && pip install nox
562+
- run: python3 -m pip install --upgrade pip && pip install nox[uv]
563563
- run: python3 -m nox -s test-version-limits
564564

565565
check-feature-powerset:
@@ -588,7 +588,7 @@ jobs:
588588
- uses: taiki-e/install-action@v2
589589
with:
590590
tool: cargo-hack,cargo-minimal-versions
591-
- run: python3 -m pip install --upgrade pip && pip install nox
591+
- run: python3 -m pip install --upgrade pip && pip install nox[uv]
592592
- run: python3 -m nox -s check-feature-powerset -- ${{ matrix.rust != 'stable' && 'minimal-versions' || '' }}
593593

594594
test-cross-compilation:
@@ -732,7 +732,7 @@ jobs:
732732
- uses: Swatinem/rust-cache@v2
733733
with:
734734
save-if: ${{ github.ref == 'refs/heads/main' || contains(github.event.pull_request.labels.*.name, 'CI-save-pr-cache') }}
735-
- run: python -m pip install --upgrade pip && pip install nox
735+
- run: python -m pip install --upgrade pip && pip install nox[uv]
736736
- run: nox -s test-introspection
737737
env:
738738
CARGO_BUILD_TARGET: ${{ matrix.platform.rust-target }}

.github/workflows/netlify-build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
# This builds the book in target/guide/.
5151
- name: Build the guide
5252
run: |
53-
python -m pip install --upgrade pip && pip install nox
53+
python -m pip install --upgrade pip && pip install nox[uv]
5454
nox -s ${{ github.event_name == 'release' && 'build-guide' || 'check-guide' }}
5555
env:
5656
PYO3_VERSION_TAG: ${{ steps.prepare_tag.outputs.tag_name }}
@@ -75,7 +75,7 @@ jobs:
7575
7676
- name: Build the site
7777
run: |
78-
python -m pip install --upgrade pip && pip install nox towncrier requests
78+
python -m pip install --upgrade pip && pip install nox[uv] towncrier requests
7979
nox -s build-netlify-site -- ${{ (github.ref != 'refs/heads/main' && '--preview') || '' }}
8080
8181
# Upload the built site as an artifact for deploy workflow to consume

.netlify/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ if [ "${INSTALLED_MDBOOK_TABS_VERSION}" != "mdbook-tabs v${MDBOOK_TABS_VERSION}"
9797
cargo install mdbook-tabs@${MDBOOK_TABS_VERSION} --force
9898
fi
9999

100-
pip install nox
100+
pip install nox[uv]
101101
nox -s build-guide
102102
mv target/guide/ netlify_build/main/
103103

pytests/noxfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
@nox.session
99
def test(session: nox.Session):
1010
session.env["MATURIN_PEP517_ARGS"] = "--profile=dev"
11-
session.run_always("python", "-m", "pip", "install", "-v", ".[dev]")
11+
session.install("-v", ".[dev]")
1212

1313
def try_install_binary(package: str, constraint: str):
1414
try:

0 commit comments

Comments
 (0)