Skip to content

Commit ac1df5c

Browse files
jcfrhenryiii
andcommitted
ci: Speed-up using "uv" instead of "pip"
Co-authored-by: Henry Schreiner <[email protected]>
1 parent 8b5b869 commit ac1df5c

File tree

4 files changed

+13
-12
lines changed

4 files changed

+13
-12
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,10 @@ jobs:
5757
python-version: ${{ matrix.python-version }}
5858
allow-prereleases: true
5959

60+
- uses: yezz123/setup-uv@v4
61+
6062
- name: Install package
61-
run: python -m pip install .[test]
63+
run: uv pip install --system -e.[test]
6264

6365
- name: Test package
6466
run: python -m pytest --durations=20

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ repos:
5555
args: []
5656
additional_dependencies:
5757
- pytest
58+
- scikit-build-core
5859

5960
- repo: https://github.com/codespell-project/codespell
6061
rev: "v2.3.0"

noxfile.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
from __future__ import annotations
22

33
import argparse
4-
import shutil
54
from pathlib import Path
65

76
import nox
87

98
DIR = Path(__file__).parent.resolve()
109

10+
nox.needs_version = ">=2024.3.2"
11+
nox.options.default_venv_backend = "uv|virtualenv"
1112
nox.options.sessions = ["lint", "pylint", "tests"]
1213

1314

@@ -38,7 +39,7 @@ def tests(session: nox.Session) -> None:
3839
"""
3940
Run the unit and regular tests.
4041
"""
41-
session.install(".[test]")
42+
session.install("-e.[test]")
4243
session.run("pytest", *session.posargs)
4344

4445

@@ -109,9 +110,5 @@ def build(session: nox.Session) -> None:
109110
Build an SDist and wheel.
110111
"""
111112

112-
build_path = DIR.joinpath("build")
113-
if build_path.exists():
114-
shutil.rmtree(build_path)
115-
116113
session.install("build")
117114
session.run("python", "-m", "build")

pyproject.toml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,8 @@ any = "cython_cmake.cmake"
3838
[project.optional-dependencies]
3939
test = [
4040
"pytest >=6",
41-
]
42-
dev = [
43-
"pytest >=6",
41+
"scikit-build-core",
42+
"cython",
4443
]
4544
docs = [
4645
"sphinx>=7.0",
@@ -62,9 +61,11 @@ version.source = "vcs"
6261
build.hooks.vcs.version-file = "src/cython_cmake/_version.py"
6362

6463
[tool.hatch.envs.default]
65-
features = ["test"]
66-
scripts.test = "pytest {args}"
64+
installer = "uv"
6765

66+
[tool.hatch.envs.hatch-test]
67+
features = ["test"]
68+
extra-dependencies = ["cmake", "ninja"]
6869

6970
[tool.pytest.ini_options]
7071
minversion = "6.0"

0 commit comments

Comments
 (0)