Skip to content

Commit 9dd9b6a

Browse files
committed
⬆️ Opt fully into uv
1 parent 25e078a commit 9dd9b6a

12 files changed

Lines changed: 4207 additions & 126 deletions

.github/dependabot.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
version: 2
22
updates:
3-
- package-ecosystem: pip
3+
- package-ecosystem: uv
44
directory: "/"
55
schedule:
66
interval: weekly
77
day: friday
88
time: "18:00"
99
timezone: Europe/Amsterdam
1010
open-pull-requests-limit: 20
11-
reviewers:
12-
- jsnel
1311
assignees:
1412
- jsnel
13+
- s-weigand
1514
# Maintain dependencies for GitHub Actions
1615
- package-ecosystem: "github-actions"
1716
directory: "/"

.github/requirements_min.txt

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

.github/workflows/integration-tests.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,11 @@ jobs:
3737
uses: actions/setup-python@v6
3838
with:
3939
python-version: "3.10"
40-
41-
- name: Install pyglotaran-extras
40+
- name: Install uv
41+
uses: astral-sh/setup-uv@v4
42+
- name: Install dependencies
4243
run: |
43-
pip install wheel
44-
pip install -r requirements_pinned.txt
45-
pip install .
44+
uv sync --frozen --no-default-groups
4645
4746
- name: ${{ matrix.example_name }}
4847
id: example-run

.github/workflows/test.yml

Lines changed: 62 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -29,45 +29,64 @@ jobs:
2929
docs:
3030
name: Build Docs
3131
runs-on: ubuntu-latest
32-
defaults:
33-
run:
34-
shell: bash -l {0}
3532
steps:
3633
- name: Check out repo
37-
uses: actions/checkout@v6
38-
39-
- name: Setup docs env same as on RTD
40-
uses: mamba-org/setup-micromamba@v2
34+
uses: actions/checkout@v4
35+
- name: Set up Python 3.10
36+
uses: actions/setup-python@v5
4137
with:
42-
environment-file: docs/environment.yml
43-
cache-environment: true
38+
python-version: "3.10"
39+
- name: Install asdf package manager
40+
uses: asdf-vm/actions/setup@v4
4441

42+
- name: Install pandoc
43+
run: |
44+
asdf plugin add pandoc
45+
asdf install pandoc latest
46+
- name: Install uv
47+
uses: astral-sh/setup-uv@v4
48+
- name: Install just
49+
run: |
50+
uv tool install rust-just
51+
- name: Install dependencies
52+
run: |
53+
uv sync --frozen --group docs
4554
- name: Show installed dependencies
46-
run: pip freeze
47-
55+
run: |
56+
uv tree
4857
- name: Build docs
4958
run: just docs/html
5059

5160
docs-link:
5261
name: Check Doc Links
5362
runs-on: ubuntu-latest
54-
defaults:
55-
run:
56-
shell: bash -l {0}
5763
steps:
5864
- name: Check out repo
59-
uses: actions/checkout@v6
60-
61-
- name: Setup docs env same as on RTD
62-
uses: mamba-org/setup-micromamba@v2
65+
uses: actions/checkout@v4
66+
- name: Set up Python 3.10
67+
uses: actions/setup-python@v5
6368
with:
64-
environment-file: docs/environment.yml
65-
cache-environment: true
69+
python-version: "3.10"
70+
- name: Install asdf package manager
71+
uses: asdf-vm/actions/setup@v4
6672

73+
- name: Install pandoc
74+
run: |
75+
asdf plugin add pandoc
76+
asdf install pandoc latest
77+
- name: Install uv
78+
uses: astral-sh/setup-uv@v4
79+
- name: Install just
80+
run: |
81+
uv tool install rust-just
82+
- name: Install dependencies
83+
run: |
84+
uv sync --frozen --group docs
6785
- name: Show installed dependencies
68-
run: pip freeze
86+
run: |
87+
uv tree
6988
70-
- name: Build docs
89+
- name: Check links in docs
7190
run: just docs/linkcheck
7291

7392
test:
@@ -88,14 +107,15 @@ jobs:
88107
with:
89108
python-version: ${{ matrix.python-version }}
90109

110+
- name: Install uv
111+
uses: astral-sh/setup-uv@v4
112+
91113
- name: Install dependencies
92114
run: |
93-
python -m pip install -U pip wheel
94-
python -m pip install -r requirements_pinned.txt
95-
python -m pip install -U ".[test]"
115+
uv sync --frozen --group test
96116
97117
- name: Run tests
98-
run: python -m pytest --nbval --cov=pyglotaran_extras --cov-report term --cov-report xml --cov-config pyproject.toml tests
118+
run: uv run pytest --nbval --cov=pyglotaran_extras --cov-report term --cov-report xml --cov-config pyproject.toml tests
99119

100120
- name: Codecov Upload
101121
continue-on-error: true
@@ -120,18 +140,19 @@ jobs:
120140
with:
121141
python-version: "3.10"
122142

143+
- name: Install uv
144+
uses: astral-sh/setup-uv@v4
145+
123146
- name: Install dependencies
124147
run: |
125-
python -m pip install -U pip wheel
126-
python -m pip install -r requirements_pinned.txt
127-
python -m pip install -U ".[test]"
128-
python -m pip install git+https://github.com/glotaran/pyglotaran
148+
uv sync --frozen --group test
149+
uv add git+https://github.com/glotaran/pyglotaran
129150
130151
- name: Show installed dependencies
131-
run: pip freeze
152+
run: uv tree
132153

133154
- name: Run tests
134-
run: python -m pytest --nbval --cov=pyglotaran_extras --cov-report term --cov-report xml --cov-config pyproject.toml tests
155+
run: uv run pytest --nbval --cov=pyglotaran_extras --cov-report term --cov-report xml --cov-config pyproject.toml tests
135156

136157
- name: Codecov Upload
137158
continue-on-error: true
@@ -156,17 +177,18 @@ jobs:
156177
with:
157178
python-version: "3.10"
158179

180+
- name: Install uv
181+
uses: astral-sh/setup-uv@v4
182+
159183
- name: Install dependencies
160184
run: |
161-
python -m pip install -U pip wheel
162-
python -m pip install -r .github/requirements_min.txt
163-
python -m pip install -e ".[test]"
185+
uv sync --group test --resolution lowest
164186
165187
- name: Show installed dependencies
166-
run: pip freeze
188+
run: uv tree
167189

168190
- name: Run tests
169-
run: python -m pytest --nbval --cov=./ --cov-report term --cov-report xml --cov-config pyproject.toml tests
191+
run: uv run pytest --nbval --cov=./ --cov-report term --cov-report xml --cov-config pyproject.toml tests
170192

171193
- name: Codecov Upload
172194
continue-on-error: true
@@ -190,12 +212,11 @@ jobs:
190212
uses: actions/setup-python@v6
191213
with:
192214
python-version: "3.10"
193-
194-
- name: Install dependencies
195-
run: python -m pip install -U hatch
215+
- name: Install uv
216+
uses: astral-sh/setup-uv@v4
196217

197218
- name: Build dist
198-
run: hatch build
219+
run: uv build
199220

200221
- name: Publish package
201222
uses: pypa/gh-action-pypi-publish@v1.13.0

.ruff-notebooks.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ extend-ignore = [
1414
]
1515

1616
[lint.isort]
17-
required-imports = []
17+
required-imports = [ ]
1818
force-single-line = false

.ruff.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,20 +58,20 @@ ignore = [
5858
# Covered by formatter
5959
"ISC001",
6060
]
61-
external = ["DOC"]
61+
external = [ "DOC" ]
6262

6363
# Allow unused variables when underscore-prefixed.
6464
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
6565

6666
[lint.per-file-ignores]
67-
"tests/*" = ["ARG001"]
68-
"tests/data/*" = ["INP", "D"]
67+
"tests/*" = [ "ARG001" ]
68+
"tests/data/*" = [ "INP", "D" ]
6969
"tests/data/config/run_load_config_on_import.py" = [
7070
"I002", # from __future__ import annotations
7171
]
7272
[lint.isort]
73-
required-imports = ["from __future__ import annotations"]
74-
known-first-party = ["pyglotaran_extras"]
73+
required-imports = [ "from __future__ import annotations" ]
74+
known-first-party = [ "pyglotaran_extras" ]
7575
force-single-line = true
7676

7777
[lint.pydocstyle]

.taplo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
[formatting]
22
align_comments = true
33
array_auto_collapse = false
4+
compact_arrays = false

docs/environment.yml

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

pyproject.toml

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -34,21 +34,35 @@ dynamic = [
3434
"version",
3535
]
3636
dependencies = [
37-
"cycler>=0.10",
38-
"docstring-parser>=0.16",
39-
"matplotlib>=3.3",
40-
"numpy>=1.22",
41-
"packaging>=23.1",
42-
"pydantic>=2.7",
43-
"pyglotaran>=0.7",
44-
"ruamel-yaml>=0.18.6",
45-
"tabulate>=0.8.9",
46-
"xarray>=2022.3",
37+
"cycler==0.12.1",
38+
"docstring-parser==0.17",
39+
"matplotlib==3.10.8",
40+
"numpy==2.2.6",
41+
"packaging==26",
42+
"pydantic==2.12.5",
43+
"pyglotaran==0.7.4",
44+
"ruamel-yaml==0.19.1",
45+
"tabulate==0.9",
46+
"xarray==2025.6.1",
4747
]
48-
optional-dependencies.dev = [
49-
"pyglotaran-extras[docs,test]",
48+
urls.Changelog = "https://pyglotaran-extras.readthedocs.io/en/latest/changelog.html"
49+
urls.Documentation = "https://pyglotaran-extras.readthedocs.io"
50+
urls."GloTarAn Ecosystem" = "https://glotaran.org"
51+
urls.Homepage = "https://github.com/glotaran/pyglotaran-extras"
52+
urls.Source = "https://github.com/glotaran/pyglotaran-extras"
53+
urls.Tracker = "https://github.com/glotaran/pyglotaran-extras/issues"
54+
55+
[dependency-groups]
56+
dev = [ { include-group = "docs" }, { include-group = "test" } ]
57+
test = [
58+
"coverage[toml]",
59+
"jsonschema>=4.22",
60+
"nbval>=0.9.6",
61+
"pluggy>=0.7",
62+
"pytest>=3.7.1",
63+
"pytest-cov>=2.5.1",
5064
]
51-
optional-dependencies.docs = [
65+
docs = [
5266
"autodoc-pydantic>=2.2",
5367
"jupyterlab>=3",
5468
"myst-nb>=1.1.1", # notebook docs
@@ -60,20 +74,6 @@ optional-dependencies.docs = [
6074
"sphinx-last-updated-by-git>=0.3",
6175
"sphinxcontrib-mermaid>=0.9.2",
6276
]
63-
optional-dependencies.test = [
64-
"coverage[toml]",
65-
"jsonschema>=4.22",
66-
"nbval>=0.9.6",
67-
"pluggy>=0.7",
68-
"pytest>=3.7.1",
69-
"pytest-cov>=2.5.1",
70-
]
71-
urls.Changelog = "https://pyglotaran-extras.readthedocs.io/en/latest/changelog.html"
72-
urls.Documentation = "https://pyglotaran-extras.readthedocs.io"
73-
urls."GloTarAn Ecosystem" = "https://glotaran.org"
74-
urls.Homepage = "https://github.com/glotaran/pyglotaran-extras"
75-
urls.Source = "https://github.com/glotaran/pyglotaran-extras"
76-
urls.Tracker = "https://github.com/glotaran/pyglotaran-extras/issues"
7777

7878
[tool.hatch.version]
7979
path = "pyglotaran_extras/__init__.py"

readthedocs.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
version: 2
22

3-
formats: all
4-
53
sphinx:
64
configuration: docs/conf.py
75

86
build:
9-
os: ubuntu-lts-latest
7+
os: ubuntu-24.04
108
tools:
11-
python: "mambaforge-latest"
12-
13-
conda:
14-
environment: docs/environment.yml
9+
python: "3.13"
10+
jobs:
11+
pre_create_environment:
12+
- asdf plugin add uv
13+
- asdf install uv latest
14+
- asdf plugin add pandoc
15+
- asdf install pandoc latest
16+
create_environment:
17+
- uv venv "${READTHEDOCS_VIRTUALENV_PATH}"
18+
install:
19+
- UV_PROJECT_ENVIRONMENT="${READTHEDOCS_VIRTUALENV_PATH}" uv sync --frozen --group docs

0 commit comments

Comments
 (0)