Skip to content

Commit a2bfbae

Browse files
committed
Use uv for CI.
1 parent 9a1f663 commit a2bfbae

File tree

8 files changed

+48
-97
lines changed

8 files changed

+48
-97
lines changed

.github/workflows/news.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

.github/workflows/tests.yml

Lines changed: 40 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -13,58 +13,66 @@ jobs:
1313
runs-on: ubuntu-latest
1414
strategy:
1515
matrix:
16-
python-version: ["3.9", "3.10", "3.11"]
17-
nox-session: ["test"]
18-
x64: ["1"]
16+
python-version: ["3.10"]
17+
x64: ["0"]
1918
include:
20-
- python-version: "3.10"
21-
nox-session: "test"
22-
x64: "0"
23-
- python-version: "3.10"
24-
nox-session: "comparison"
19+
- python-version: "3.13"
2520
x64: "1"
26-
- python-version: "3.10"
27-
nox-session: "doctest"
28-
x64: "1"
29-
3021
steps:
3122
- name: Checkout
3223
uses: actions/checkout@v4
3324
with:
3425
fetch-depth: 0
35-
- name: Setup Python
36-
uses: actions/setup-python@v5
26+
- name: Set up uv
27+
uses: astral-sh/setup-uv@v6
28+
- name: Run tests
29+
run: |
30+
uv run --extra test --python ${{ matrix.python-version }} pytest -n auto tests
31+
env:
32+
JAX_ENABLE_X64: ${{ matrix.x64 }}
33+
34+
comparison:
35+
runs-on: ubuntu-latest
36+
steps:
37+
- name: Checkout
38+
uses: actions/checkout@v4
3739
with:
38-
python-version: ${{ matrix.python-version }}
39-
- name: Install dependencies
40+
fetch-depth: 0
41+
- name: Set up uv
42+
uses: astral-sh/setup-uv@v6
43+
- name: Run tests
4044
run: |
41-
python -m pip install -U pip
42-
python -m pip install nox
45+
uv run --extra test --extra comparison --python 3.12 pytest -n auto tests
46+
env:
47+
JAX_ENABLE_X64: "1"
48+
49+
doctest:
50+
runs-on: ubuntu-latest
51+
steps:
52+
- name: Checkout
53+
uses: actions/checkout@v4
54+
with:
55+
fetch-depth: 0
56+
- name: Set up uv
57+
uses: astral-sh/setup-uv@v6
4358
- name: Run tests
4459
run: |
45-
python -m nox --non-interactive --error-on-missing-interpreter \
46-
--session ${{ matrix.nox-session }} --python ${{ matrix.python-version }}
60+
uv run --extra test --extra doctest --python 3.12 pytest --doctest-modules -v src/tinygp
4761
env:
48-
JAX_ENABLE_X64: ${{ matrix.x64 }}
62+
JAX_ENABLE_X64: "1"
4963

5064
build:
5165
runs-on: ubuntu-latest
5266
steps:
5367
- uses: actions/checkout@v4
5468
with:
5569
fetch-depth: 0
56-
- uses: actions/setup-python@v5
57-
name: Install Python
58-
with:
59-
python-version: "3.10"
60-
- name: Install dependencies
61-
run: |
62-
python -m pip install -U pip
63-
python -m pip install -U build twine
70+
- name: Set up uv
71+
uses: astral-sh/setup-uv@v6
6472
- name: Build the distribution
65-
run: python -m build .
73+
run: uv build
6674
- name: Check the distribution
67-
run: python -m twine check --strict dist/*
75+
run: uv run --with twine python -m twine check --strict dist/*
6876
- uses: actions/upload-artifact@v4
6977
with:
7078
path: dist/*
@@ -75,7 +83,7 @@ jobs:
7583
url: https://pypi.org/p/tinygp
7684
permissions:
7785
id-token: write
78-
needs: [tests, build]
86+
needs: [tests, comparison, doctest, build]
7987
runs-on: ubuntu-latest
8088
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
8189
steps:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@
88
docs/api/summary
99
__pycache__
1010
*.egg-info
11+
uv.lock

CONTRIBUTING.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ Tracker](https://github.com/dfm/tinygp/issues).
3434
## How to test the project
3535

3636
```bash
37-
python -m pip install nox
38-
python -m nox -s test -p 3.10
37+
uv run --extra test pytest
3938
```
4039

4140
## How to submit changes

docs/install.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,5 @@ If you installed from source, you can run the unit tests. From the root of the
3434
source directory, run:
3535

3636
```bash
37-
python -m pip install nox
38-
python -m nox -s test -p 3.10
37+
uv run --extra test pytest
3938
```

noxfile.py

Lines changed: 0 additions & 34 deletions
This file was deleted.

pyproject.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "tinygp"
33
description = "The tiniest of Gaussian Process libraries"
44
authors = [{ name = "Dan Foreman-Mackey", email = "[email protected]" }]
55
readme = "README.md"
6-
requires-python = ">=3.9"
6+
requires-python = ">=3.10"
77
license = { text = "MIT" }
88
classifiers = [
99
"Development Status :: 4 - Beta",
@@ -15,11 +15,12 @@ classifiers = [
1515
"Programming Language :: Python :: 3",
1616
]
1717
dynamic = ["version"]
18-
dependencies = ["jax", "jaxlib", "equinox"]
18+
dependencies = ["jax", "equinox"]
1919

2020
[project.optional-dependencies]
21-
test = ["pytest"]
21+
test = ["pytest", "pytest-xdist"]
2222
comparison = ["george", "celerite"]
23+
doctest = ["numpyro"]
2324
docs = [
2425
"sphinx-book-theme",
2526
"myst-nb",

tests/test_solvers/test_quasisep/test_solver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,6 @@ def test_unsorted(data):
130130
def impl(X, y):
131131
return GaussianProcess(kernel, X, diag=0.1).log_probability(y)
132132

133-
with pytest.raises(jax.lib.xla_extension.XlaRuntimeError) as exc_info:
133+
with pytest.raises(jax.errors.JaxRuntimeError) as exc_info:
134134
impl(x_, y_).block_until_ready()
135135
assert exc_info.match(r"Input coordinates must be sorted")

0 commit comments

Comments
 (0)