Skip to content

Commit 956f10c

Browse files
authored
ci: use uv (#805)
* ci: use uv Signed-off-by: Henry Schreiner <[email protected]> * chore: drop uv from 3.7 jobs Signed-off-by: Henry Schreiner <[email protected]> --------- Signed-off-by: Henry Schreiner <[email protected]>
1 parent 48f82a1 commit 956f10c

File tree

2 files changed

+21
-10
lines changed

2 files changed

+21
-10
lines changed

.github/workflows/ci.yml

+17-9
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
build:
1818
runs-on: ${{ matrix.os }}
1919
strategy:
20+
fail-fast: false
2021
matrix:
2122
os: [ubuntu-20.04, windows-latest, macos-latest]
2223
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
@@ -26,16 +27,22 @@ jobs:
2627
uses: actions/setup-python@v5
2728
with:
2829
python-version: ${{ matrix.python-version }}
30+
- name: Setup uv
31+
uses: yezz123/setup-uv@v4
32+
if: matrix.python-version != '3.7'
2933
- name: Set up Miniconda
3034
uses: conda-incubator/setup-miniconda@v3
3135
with:
3236
auto-update-conda: true
3337
python-version: ${{ matrix.python-version }}
3438
miniforge-variant: Mambaforge
3539
use-mamba: true
36-
- name: Install Nox-under-test
37-
run: |
38-
python -m pip install --disable-pip-version-check .
40+
- name: Install Nox-under-test (uv)
41+
if: matrix.python-version != '3.7'
42+
run: uv pip install --system .
43+
- name: Install Nox-under-test (pip)
44+
if: matrix.python-version == '3.7'
45+
run: python -m pip install --disable-pip-version-check .
3946
- name: Run tests on ${{ matrix.os }} (tox <4)
4047
run: nox --non-interactive --error-on-missing-interpreter --session "tests(python='${{ matrix.python-version }}', tox_version='<4')" -- --full-trace
4148
- name: Run tox-to-nox tests on ${{ matrix.os }} (tox latest)
@@ -56,9 +63,10 @@ jobs:
5663
uses: actions/setup-python@v5
5764
with:
5865
python-version: "3.11"
66+
- name: Setup uv
67+
uses: yezz123/setup-uv@v4
5968
- name: Install Nox-under-test
60-
run: |
61-
python -m pip install --disable-pip-version-check .
69+
run: uv pip install --system .
6270
- name: Download individual coverage reports
6371
uses: actions/download-artifact@v4
6472
with:
@@ -78,8 +86,7 @@ jobs:
7886
with:
7987
python-version: 3.9
8088
- name: Install Nox-under-test
81-
run: |
82-
python -m pip install --disable-pip-version-check .
89+
run: python -m pip install --disable-pip-version-check .
8390
- name: Lint
8491
run: nox --non-interactive --error-on-missing-interpreter --session "lint"
8592
docs:
@@ -90,9 +97,10 @@ jobs:
9097
uses: actions/setup-python@v5
9198
with:
9299
python-version: 3.9
100+
- name: Setup uv
101+
uses: yezz123/setup-uv@v4
93102
- name: Install Nox-under-test
94-
run: |
95-
python -m pip install --disable-pip-version-check .
103+
run: uv pip install --system .
96104
- name: Docs
97105
run: nox --non-interactive --error-on-missing-interpreter --session "docs"
98106
deploy:

noxfile.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@
2727

2828
ON_WINDOWS_CI = "CI" in os.environ and platform.system() == "Windows"
2929

30+
nox.needs_version = ">=2024.3.2"
31+
nox.options.default_venv_backend = "uv|virtualenv"
32+
3033
# Skip 'conda_tests' if user doesn't have conda installed
3134
nox.options.sessions = ["tests", "cover", "lint", "docs"]
3235
if shutil.which("conda"):
@@ -76,7 +79,7 @@ def tests(session: nox.Session, tox_version: str) -> None:
7679
con.execute("DELETE FROM file WHERE SUBSTR(path, 2, 1) == ':'")
7780

7881

79-
@nox.session(python=["3.7", "3.8", "3.9", "3.10"], venv_backend="conda")
82+
@nox.session(python=["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"], venv_backend="conda")
8083
def conda_tests(session: nox.Session) -> None:
8184
"""Run test suite with pytest."""
8285
session.create_tmp() # Fixes permission errors on Windows

0 commit comments

Comments
 (0)