Skip to content

Commit 6041845

Browse files
committed
Reqs in pyproject
1 parent 7a0ff9d commit 6041845

11 files changed

Lines changed: 100 additions & 98 deletions

File tree

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ 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
30+
pip install --user -e ".[test]"
3131
pip install --user build twine meson
3232
# way to set path persistently https://circleci.com/docs/2.0/env-vars/#setting-path
3333
echo 'export PATH=/home/circleci/.local/bin:$PATH' >> $BASH_ENV

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ jobs:
1010
Docs:
1111
uses: tskit-dev/.github/.github/workflows/docs-build-template.yml@main
1212
with:
13-
requirements-path: requirements/CI-docs/requirements.txt
13+
requirements-path: ".[docs]"
1414
additional-setup: sudo apt-get install -y libgsl0-dev
1515
make-command: make cmodule

.github/workflows/tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
uses: actions/cache@v4.2.2
4949
with:
5050
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') }}
51+
key: ${{ runner.os }}-${{ runner.arch }}-${{ matrix.python}}-conda-v3-${{ hashFiles('requirements/conda-minimal.txt') }}-${{ hashFiles('pyproject.toml') }}
5252

5353
- name: Install Conda
5454
uses: conda-incubator/setup-miniconda@v3.1.1
@@ -75,13 +75,13 @@ jobs:
7575
- name: Install conda deps
7676
if: steps.cache.outputs.cache-hit != 'true'
7777
shell: bash -l {0} #We need a login shell to get conda
78-
run: conda install --yes --file=requirements/CI-tests-conda/requirements.txt
78+
run: conda install gsl demes==0.2.3
7979

8080
- name: Install pip deps
8181
if: steps.cache.outputs.cache-hit != 'true'
8282
shell: bash -l {0}
8383
run: |
84-
pip install -r requirements/CI-tests-pip/requirements.txt
84+
pip install -e ".[test]"
8585
pip uninstall -y msprime
8686
8787
- name: Build module

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 still need to install conda-only dependencies first:
7475
```
75-
$ python -m pip install -r requirements/development.txt
76+
conda install --file requirements/conda-minimal.txt
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: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,87 @@ 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+
"daiquiri==3.2.5.1; python_version<='3.9'",
76+
"daiquiri==3.3.0; python_version>'3.9'",
77+
"kastore==0.3.3",
78+
"newick==1.10.0",
79+
"pytest==8.4.1",
80+
"pytest-xdist==3.8.0",
81+
"python_jsonschema_objects==0.5.7",
82+
"setuptools==80.9.0",
83+
"scipy==1.13.1; python_version<='3.9'",
84+
"scipy==1.16.1; python_version>'3.9'",
85+
"tskit==0.6.4"
86+
]
87+
88+
docs = [
89+
"daiquiri==3.3.0",
90+
"demes==0.2.3",
91+
"demesdraw==0.4.0",
92+
"jupyter-book==1.0.4.post1",
93+
"networkx==3.5",
94+
"matplotlib==3.10.3",
95+
"newick==1.10.0",
96+
"setuptools==80.9.0",
97+
"sphinx-argparse==0.5.2",
98+
"sphinx-book-theme",
99+
"sphinx-issues==5.0.1",
100+
"tskit==0.6.4",
101+
"scipy==1.16.1"
102+
]
103+
104+
dev = [
105+
"docutils==0.21.2",
106+
"asv==0.6.1",
107+
"bintrees",
108+
"coverage",
109+
"daiquiri",
110+
"demes>=0.2.0",
111+
"demesdraw",
112+
"flake8",
113+
"matplotlib>=3.4.0",
114+
"meson>=0.61.0",
115+
"mock",
116+
"mypy",
117+
"ninja",
118+
"numpy",
119+
"pre-commit",
120+
"pytest",
121+
"pytest-cov",
122+
"pytest-xdist",
123+
"tskit>=0.5.2",
124+
"kastore",
125+
"sphinx-book-theme",
126+
"scipy",
127+
"setuptools_scm",
128+
"sphinx>=4.4",
129+
"sphinx-argparse",
130+
"sphinx-issues",
131+
"jupyter-book",
132+
"networkx",
133+
"newick>=1.3.0",
134+
"python_jsonschema_objects"
135+
]
136+
137+
verification = [
138+
"dendropy",
139+
"matplotlib",
140+
"numpy",
141+
"pandas",
142+
"pyvolve",
143+
"scipy==1.2",
144+
"scikit-allel",
145+
"statsmodels",
146+
"seaborn",
147+
"tqdm",
148+
"argparse",
149+
"daiquiri",
150+
"pyslim>=1.0"
151+
]
152+
72153
[tool.pytest.ini_options]
73154
addopts = "-n 4"
74155
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)