Skip to content

Commit daf770f

Browse files
committed
nox: use uv as default venv backend
1 parent eb69f8d commit daf770f

File tree

2 files changed

+27
-16
lines changed

2 files changed

+27
-16
lines changed

.github/workflows/tests.yaml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ env:
1414
# facilitate testing by building vLLM for CPU when needed
1515
VLLM_CPU_DISABLE_AVX512: "true"
1616
VLLM_TARGET_DEVICE: "cpu"
17-
# prefer torch cpu version
18-
PIP_EXTRA_INDEX_URL: "https://download.pytorch.org/whl/cpu"
17+
# prefer index for torch cpu version
18+
UV_EXTRA_INDEX_URL: "https://download.pytorch.org/whl/cpu"
19+
# have uv match pip's behaviour for extra index operations
20+
UV_INDEX_STRATEGY: "unsafe-best-match"
1921

2022
concurrency:
2123
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
@@ -56,19 +58,18 @@ jobs:
5658
ccache \
5759
libnuma-dev libdnnl-dev opencl-dev
5860
59-
- name: Set up Python ${{ matrix.pyv }}
60-
uses: actions/setup-python@v5
61-
id: setup-python
61+
- name: Install the latest version of uv
62+
uses: astral-sh/setup-uv@v5
6263
with:
64+
version: "latest"
6365
python-version: ${{ matrix.pyv }}
64-
cache: pip
65-
cache-dependency-path: pyproject.toml
66+
enable-cache: true
67+
cache-dependency-glob: |
68+
pyproject.toml
6669
67-
- name: Upgrade pip and nox
70+
- name: Install nox
6871
run: |
69-
python -m pip install --upgrade pip nox
70-
pip --version
71-
nox --version
72+
uv pip install nox
7273
7374
- name: nox envs cache
7475
id: cache

noxfile.py

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,29 @@
55

66
nox.options.reuse_existing_virtualenvs = True
77
nox.options.sessions = "lint", "tests"
8+
nox.options.default_venv_backend = "uv"
89
locations = "src", "tests"
910

10-
versions = ["3.9", "3.10", "3.11", "3.12"]
11+
versions = [
12+
"3.12",
13+
"3.11",
14+
"3.10",
15+
"3.9",
16+
]
1117

1218

1319
@nox.session(python=versions)
1420
def tests(session: nox.Session) -> None:
1521
if vllm_version := os.getenv("VLLM_VERSION_OVERRIDE"):
16-
session.install(vllm_version, "-v")
22+
session.install(vllm_version)
1723

1824
session.install(".[tests]")
1925

2026
session.run(
2127
"pytest",
2228
"--cov",
2329
"--cov-config=pyproject.toml",
30+
"--no-cov-on-fail",
2431
*session.posargs,
2532
env={"COVERAGE_FILE": f".coverage.{session.python}"},
2633
)
@@ -58,8 +65,11 @@ def dev(session: nox.Session) -> None:
5865
venv_dir = Path(args[0])
5966

6067
session.log(f"Setting up virtual environment in {venv_dir}")
61-
session.install("virtualenv")
62-
session.run("virtualenv", venv_dir, silent=True)
68+
session.install("uv")
69+
session.run("uv", "venv", venv_dir, silent=True)
6370

6471
python = venv_dir / "bin/python"
65-
session.run(python, "-m", "pip", "install", "-e", ".[dev]", external=True)
72+
session.run(
73+
*f"{python} -m uv pip install -e .[dev]".split(),
74+
external=True,
75+
)

0 commit comments

Comments
 (0)