Skip to content

Commit 68ab640

Browse files
dweindlclaude
andcommitted
Use dependency groups for development dependencies
Move development-only dependencies from extras to dependency groups (`test`, `doc`, `dev`), keep feature extras (`antimony`, `combine`, `reports`, `sciml`, `vis`) and add an `all` extra. * `dev` (`test` + `pre-commit`) is the default group for `uv sync`. * Merge the former `ci` group into `test`, since the test suite requires `petabtests` and `benchmark_models_petab`. * Use pysb from master via `tool.uv.sources`. * Relax the `Jinja2` pin in `reports`. * Drop the unused `sphinxcontrib-napoleon`. * Read the Docs: install via `uv sync --group doc`. * CI: fetch the BNGL test corpus without syncing the project. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent da74567 commit 68ab640

4 files changed

Lines changed: 45 additions & 41 deletions

File tree

‎.github/workflows/ci_tests.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ jobs:
3030
if: matrix.platform == 'ubuntu-latest'
3131

3232
- name: Fetch BNGL test corpus
33-
run: uv run python tests/v1/fetch_bngl_corpus.py
33+
run: uv run --no-project python -P tests/v1/fetch_bngl_corpus.py
3434

3535
- name: Unit tests
3636
run: |
37-
uv sync --group ci
37+
uv sync --no-default-groups --group test
3838
uv pip list
3939
uv run pytest --cov=petab --cov-report=xml --cov-append --durations=10 tests
4040

‎.readthedocs.yaml‎

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@ build:
1111
os: "ubuntu-24.04"
1212
tools:
1313
python: "3.12"
14-
15-
python:
16-
install:
17-
- method: pip
18-
path: .
19-
extra_requirements:
20-
- doc
21-
- vis
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 --no-default-groups --group doc

‎doc/development.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ To build the documentation, run:
8585

8686
.. code-block:: bash
8787
88-
uv sync --extra doc --extra vis
88+
uv sync --group doc
8989
cd doc
9090
make html
9191
# then open `build/html/index.html` in a browser

‎pyproject.toml‎

Lines changed: 33 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -33,48 +33,26 @@ maintainers = [
3333
]
3434

3535
[project.optional-dependencies]
36-
tests = [
37-
"antimony>=3.1.0",
38-
"copasi-basico>=0.85",
39-
"petab_sciml",
40-
"pysb",
41-
"pytest",
42-
"pytest-cov",
43-
"scipy",
44-
]
45-
quality = [
46-
"pre-commit",
47-
]
48-
reports = [
49-
# https://github.com/spatialaudio/nbsphinx/issues/641
50-
"Jinja2==3.1.6",
51-
]
5236
antimony = [
5337
"antimony>=2.14.0",
5438
]
5539
combine = [
5640
"python-libcombine>=0.2.6",
5741
]
58-
doc = [
59-
"sphinx>=3.5.3, !=5.1.0",
60-
"sphinxcontrib-napoleon>=0.7",
61-
"sphinx-markdown-tables>=0.0.15",
62-
"sphinx-rtd-theme>=0.5.1",
63-
"m2r2",
64-
"myst-nb>=0.14.0",
65-
# https://github.com/spatialaudio/nbsphinx/issues/687#issuecomment-1339271312
66-
"ipython>=7.21.0, !=8.7.0",
67-
"pysb",
68-
"antimony>=2.14.0",
69-
]
7042
vis = [
7143
"matplotlib>=3.6.0",
7244
"seaborn",
7345
"scipy"
7446
]
47+
reports = [
48+
"Jinja2",
49+
]
7550
sciml = [
7651
"petab_sciml",
7752
]
53+
all = [
54+
"petab[antimony,combine,reports,sciml,vis]",
55+
]
7856

7957
[project.scripts]
8058
petablint = "petab.petablint:main"
@@ -85,19 +63,44 @@ Repository = "https://github.com/PEtab-dev/libpetab-python"
8563
Documentation = "https://petab.readthedocs.io/projects/libpetab-python/"
8664

8765
[dependency-groups]
88-
ci = [
89-
"petab[tests,reports,combine,vis]",
66+
test = [
67+
"petab[all]",
68+
"antimony>=3.1.0",
69+
"copasi-basico>=0.85",
70+
"pysb",
71+
"pytest",
72+
"pytest-cov",
73+
"scipy",
9074
"petabtests @ git+https://github.com/PEtab-dev/petab_test_suite@main",
9175
"benchmark_models_petab @ git+https://github.com/Benchmarking-Initiative/Benchmark-Models-PEtab.git@master#subdirectory=src/python",
9276
]
77+
doc = [
78+
"petab[antimony,vis]",
79+
"sphinx>=3.5.3, !=5.1.0",
80+
"sphinx-markdown-tables>=0.0.15",
81+
"sphinx-rtd-theme>=0.5.1",
82+
"m2r2",
83+
"myst-nb>=0.14.0",
84+
# https://github.com/spatialaudio/nbsphinx/issues/687#issuecomment-1339271312
85+
"ipython>=7.21.0, !=8.7.0",
86+
"pysb",
87+
]
88+
dev = [
89+
{include-group = "test"},
90+
"pre-commit",
91+
]
9392

9493
[tool.uv]
94+
default-groups = ["dev"]
9595
# pysb<1.17 fails to build: its legacy `ez_setup.py` bootstrap downloads
9696
# setuptools from a defunct pypi.python.org URL.
9797
constraint-dependencies = ["pysb>=1.17.0"]
9898
# pysb pins an older sympy than we need; force a newer one.
9999
override-dependencies = ["sympy>=1.12.1"]
100100

101+
[tool.uv.sources]
102+
pysb = { git = "https://github.com/pysb/pysb", branch = "master" }
103+
101104
[tool.setuptools.packages.find]
102105
include = ["petab", "petab.*"]
103106
namespaces = false

0 commit comments

Comments
 (0)