Skip to content

Commit ab11774

Browse files
committed
Use uv lock file for reproducibility in docs and tests
1 parent 0a9ba36 commit ab11774

File tree

4 files changed

+1794
-17
lines changed

4 files changed

+1794
-17
lines changed

.github/workflows/main.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,13 @@ jobs:
4040
- uses: actions/setup-python@v5
4141
with:
4242
python-version: ${{ matrix.python-version }}
43+
- name: Install uv
44+
uses: astral-sh/setup-uv@v4
4345
- name: Install package
44-
run: python -m pip install .[test]
46+
run: uv sync ${{ github.event_name == 'schedule' && '--upgrade' || '--frozen' }} --group test
4547
- name: Configure token access
4648
run: |
47-
viresclient set_token "https://vires.services/ows" ${{ secrets.VIRES_TOKEN_SWARM }}
48-
viresclient set_default_server https://vires.services/ows
49+
uv run viresclient set_token "https://vires.services/ows" ${{ secrets.VIRES_TOKEN_SWARM }}
50+
uv run viresclient set_default_server https://vires.services/ows
4951
- name: Test package
50-
run: python -m pytest -ra
52+
run: uv run pytest -ra

.readthedocs.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,24 @@
66
version: 2
77

88
# Set the OS, Python version and other tools you might need
9+
# Use uv so that the uv.lock file is used for reproducibility
910
build:
1011
os: ubuntu-24.04
1112
tools:
1213
python: "3.12"
14+
jobs:
15+
pre_create_environment:
16+
- asdf plugin add uv
17+
- asdf install uv latest
18+
- asdf global uv latest
19+
create_environment:
20+
- uv venv "${READTHEDOCS_VIRTUALENV_PATH}"
21+
install:
22+
- UV_PROJECT_ENVIRONMENT="${READTHEDOCS_VIRTUALENV_PATH}" uv sync --frozen --group docs
1323

1424
# Build documentation in the docs/ directory with Sphinx
1525
sphinx:
1626
configuration: docs/conf.py
1727

1828
# Include PDF and ePub
1929
formats: all
20-
21-
python:
22-
install:
23-
- method: pip
24-
path: .
25-
extra_requirements:
26-
- docs

pyproject.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ maintainers = [
1717
license = { file = "LICENSE" }
1818
description = "A Python client for interacting with a VirES server"
1919
readme = "README.rst"
20-
requires-python = ">=3.7"
20+
requires-python = ">=3.9"
2121
classifiers = [
2222
"License :: OSI Approved :: MIT License",
2323
"Topic :: Scientific/Engineering",
@@ -47,7 +47,7 @@ dependencies = [
4747
"xarray >= 0.11.0",
4848
]
4949

50-
[project.optional-dependencies]
50+
[dependency-groups]
5151
test = [
5252
"pytest >=6",
5353
]
@@ -56,10 +56,10 @@ dev = [
5656
"nox >=2022",
5757
]
5858
docs = [
59-
"Sphinx == 8.2",
60-
"sphinx-book-theme == 1.1.4",
61-
"sphinx-copybutton == 0.5.2",
62-
"sphinx-tabs == 3.4.7",
59+
"Sphinx == 8.2; python_version>='3.11'",
60+
"sphinx-book-theme == 1.1.4; python_version>='3.11'",
61+
"sphinx-copybutton == 0.5.2; python_version>='3.11'",
62+
"sphinx-tabs == 3.4.7; python_version>='3.11'",
6363
]
6464

6565
[project.scripts]

0 commit comments

Comments
 (0)