Skip to content

Commit 589740a

Browse files
committed
Reqs in pyproject
1 parent 7a0ff9d commit 589740a

File tree

11 files changed

+118
-112
lines changed

11 files changed

+118
-112
lines changed

.circleci/config.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ jobs:
2727
command: |
2828
sudo apt-get update
2929
sudo apt-get install libgsl0-dev libcunit1-dev libconfig-dev ninja-build valgrind clang
30-
pip install --user -r requirements/CI-complete/requirements.txt
31-
pip install --user build twine meson
30+
pip install uv
31+
uv venv
32+
uv pip install -r pyproject.toml --extra test
3233
# way to set path persistently https://circleci.com/docs/2.0/env-vars/#setting-path
3334
echo 'export PATH=/home/circleci/.local/bin:$PATH' >> $BASH_ENV
3435
- save_cache:
@@ -39,12 +40,14 @@ jobs:
3940
- run:
4041
name: Compile Python
4142
command: |
43+
source .venv/bin/activate
4244
make allchecks
4345
4446
- run:
4547
name: Run highlevel tests
4648
# Run tests without background threads
4749
command: |
50+
source .venv/bin/activate
4851
pytest --cov=msprime --cov-report=xml --cov-branch -n 0 tests
4952
5053
- codecov/upload:
@@ -59,11 +62,13 @@ jobs:
5962
- run:
6063
name: Compile C with gcc
6164
command: |
65+
source .venv/bin/activate
6266
CFLAGS=--coverage meson lib/ build-gcc && ninja -C build-gcc
6367
6468
- run:
6569
name: Run the low-level tests.
6670
command: |
71+
source .venv/bin/activate
6772
ninja -C build-gcc test
6873
6974
- run:
@@ -100,7 +105,7 @@ jobs:
100105
- run:
101106
name: Make sure we can build a distribution.
102107
command: |
103-
python -m pip install build
108+
source .venv/bin/activate
104109
python -m build --sdist
105110
python -m build --wheel
106111
python -m twine check dist/*.tar.gz --strict

.github/workflows/docs.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ on:
88
merge_group:
99
jobs:
1010
Docs:
11-
uses: tskit-dev/.github/.github/workflows/docs-build-template.yml@main
11+
uses: tskit-dev/.github/.github/workflows/docs-build-template.yml@v1
1212
with:
13-
requirements-path: requirements/CI-docs/requirements.txt
1413
additional-setup: sudo apt-get install -y libgsl0-dev
1514
make-command: make cmodule

.github/workflows/tests.yml

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,8 @@ jobs:
4343
with:
4444
submodules: true
4545

46-
- name: Cache conda and dependencies
47-
id: cache
48-
uses: actions/cache@v4.2.2
49-
with:
50-
path: ${{ env.CONDA }}/envs
51-
key: ${{ runner.os }}-${{ runner.arch }}-${{ matrix.python}}-conda-v2-${{ hashFiles('requirements/CI-tests-conda/requirements.txt') }}-${{ hashFiles('requirements/CI-tests-pip/requirements.txt') }}
52-
53-
- name: Install Conda
46+
- name: Install Conda (needed for GSL)
5447
uses: conda-incubator/setup-miniconda@v3.1.1
55-
if: steps.cache.outputs.cache-hit != 'true'
5648
with:
5749
activate-environment: anaconda-client-env
5850
python-version: ${{ matrix.python }}
@@ -72,17 +64,20 @@ jobs:
7264
run: |
7365
cp ~/.bash_profile ~/.profile
7466
75-
- name: Install conda deps
67+
- name: Install GSL
7668
if: steps.cache.outputs.cache-hit != 'true'
7769
shell: bash -l {0} #We need a login shell to get conda
78-
run: conda install --yes --file=requirements/CI-tests-conda/requirements.txt
70+
run: conda install gsl
7971

72+
- name: Install uv
73+
uses: astral-sh/setup-uv@v6
74+
with:
75+
version: "0.8.15"
76+
8077
- name: Install pip deps
81-
if: steps.cache.outputs.cache-hit != 'true'
8278
shell: bash -l {0}
8379
run: |
84-
pip install -r requirements/CI-tests-pip/requirements.txt
85-
pip uninstall -y msprime
80+
uv pip install -r pyproject.toml --extra test
8681
8782
- name: Build module
8883
env:

docs/development.md

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,17 +64,18 @@ on the documentation because it requires a locally built version of the
6464

6565
### Python requirements
6666

67-
The list of packages needed for development are listed in
68-
``requirements/development.txt``. Install these using either:
67+
The packages needed for development are specified as optional dependencies
68+
in the ``pyproject.toml`` file. Install these using:
6969

7070
```
71-
conda install --file requirements/development.txt
71+
$ python -m pip install -e ".[dev]"
7272
```
73-
or
73+
74+
For conda users, you may need to install GSL first:
7475
```
75-
$ python -m pip install -r requirements/development.txt
76+
conda install gsl
77+
pip install -e ".[dev]"
7678
```
77-
depending on whether you are a conda or pip user.
7879

7980
## Overview
8081

@@ -734,9 +735,13 @@ new simulation functionality, as subtle statistical bugs can easily slip in
734735
unnoticed.
735736

736737
The statistical tests are all run via the `verification.py` script in the project root.
737-
The script has some extra dependencies listed in the `requirements/verification.txt`,
738-
which can be installed using `pip install -r` or `conda install --file`. Run
739-
this script using:
738+
The script has some extra dependencies, which can be installed using:
739+
740+
```
741+
pip install -e ".[verification]"
742+
```
743+
744+
Run this script using:
740745

741746
```{code-block} bash
742747

pyproject.toml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,92 @@ include-package-data = true
6969
[tool.setuptools_scm]
7070
write_to = "msprime/_version.py"
7171

72+
[project.optional-dependencies]
73+
test = [
74+
"bintrees==2.2.0",
75+
"build==1.3.0",
76+
"daiquiri==3.2.5.1; python_version<='3.9'",
77+
"daiquiri==3.3.0; python_version>'3.9'",
78+
"demes==0.2.3",
79+
"kastore==0.3.3",
80+
"meson==1.9.0",
81+
"newick==1.10.0",
82+
"pytest==8.4.1",
83+
"pytest-cov==6.2.1",
84+
"pytest-xdist==3.8.0",
85+
"python_jsonschema_objects==0.5.7",
86+
"setuptools==80.9.0",
87+
"scipy==1.13.1; python_version<='3.10'",
88+
"scipy==1.16.1; python_version>'3.10'",
89+
"tskit==0.6.4",
90+
"twine==6.2.0"
91+
]
92+
93+
docs = [
94+
"daiquiri==3.3.0",
95+
"demes==0.2.3",
96+
"demesdraw==0.4.0",
97+
"jupyter-book==1.0.4.post1",
98+
"networkx==3.5",
99+
"matplotlib==3.10.3",
100+
"newick==1.10.0",
101+
"setuptools==80.9.0",
102+
"sphinx-argparse==0.5.2",
103+
"sphinx-book-theme",
104+
"sphinx-issues==5.0.1",
105+
"tskit==0.6.4",
106+
"scipy==1.16.1"
107+
]
108+
109+
dev = [
110+
"docutils==0.21.2",
111+
"asv==0.6.1",
112+
"bintrees",
113+
"coverage",
114+
"daiquiri",
115+
"demes>=0.2.0",
116+
"demesdraw",
117+
"flake8",
118+
"matplotlib>=3.4.0",
119+
"meson>=0.61.0",
120+
"mock",
121+
"mypy",
122+
"ninja",
123+
"numpy",
124+
"pre-commit",
125+
"pytest",
126+
"pytest-cov",
127+
"pytest-xdist",
128+
"tskit>=0.5.2",
129+
"kastore",
130+
"sphinx-book-theme",
131+
"scipy",
132+
"setuptools_scm",
133+
"sphinx>=4.4",
134+
"sphinx-argparse",
135+
"sphinx-issues",
136+
"jupyter-book",
137+
"networkx",
138+
"newick>=1.3.0",
139+
"python_jsonschema_objects"
140+
]
141+
142+
verification = [
143+
"dendropy",
144+
"matplotlib",
145+
"numpy",
146+
"pandas",
147+
"pyvolve",
148+
"scipy==1.2",
149+
"scikit-allel",
150+
"statsmodels",
151+
"seaborn",
152+
"tqdm",
153+
"argparse",
154+
"daiquiri",
155+
"pyslim>=1.0"
156+
]
157+
72158
[tool.pytest.ini_options]
73159
addopts = "-n 4"
74160
testpaths = ["tests"]

requirements/CI-complete/requirements.txt

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

requirements/CI-docs/requirements.txt

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

requirements/CI-tests-conda/requirements.txt

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

requirements/CI-tests-pip/requirements.txt

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

requirements/development.txt

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

0 commit comments

Comments
 (0)