Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ jobs:
command: |
sudo apt-get update
sudo apt-get install libgsl0-dev libcunit1-dev libconfig-dev ninja-build valgrind clang
pip install --user -r requirements/CI-complete/requirements.txt
pip install --user build twine meson
pip install uv
uv venv
uv pip install -r pyproject.toml --extra test
# way to set path persistently https://circleci.com/docs/2.0/env-vars/#setting-path
echo 'export PATH=/home/circleci/.local/bin:$PATH' >> $BASH_ENV
- save_cache:
Expand All @@ -39,12 +40,14 @@ jobs:
- run:
name: Compile Python
command: |
source .venv/bin/activate
make allchecks

- run:
name: Run highlevel tests
# Run tests without background threads
command: |
source .venv/bin/activate
pytest --cov=msprime --cov-report=xml --cov-branch -n 0 tests

- codecov/upload:
Expand All @@ -59,11 +62,13 @@ jobs:
- run:
name: Compile C with gcc
command: |
source .venv/bin/activate
CFLAGS=--coverage meson lib/ build-gcc && ninja -C build-gcc

- run:
name: Run the low-level tests.
command: |
source .venv/bin/activate
ninja -C build-gcc test

- run:
Expand Down Expand Up @@ -100,7 +105,7 @@ jobs:
- run:
name: Make sure we can build a distribution.
command: |
python -m pip install build
source .venv/bin/activate
python -m build --sdist
python -m build --wheel
python -m twine check dist/*.tar.gz --strict
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ on:
merge_group:
jobs:
Docs:
uses: tskit-dev/.github/.github/workflows/docs-build-template.yml@main
uses: tskit-dev/.github/.github/workflows/docs-build-template.yml@v1
with:
requirements-path: requirements/CI-docs/requirements.txt
additional-setup: sudo apt-get install -y libgsl0-dev
make-command: make cmodule
23 changes: 9 additions & 14 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,8 @@ jobs:
with:
submodules: true

- name: Cache conda and dependencies
id: cache
uses: actions/cache@v4.2.2
with:
path: ${{ env.CONDA }}/envs
key: ${{ runner.os }}-${{ runner.arch }}-${{ matrix.python}}-conda-v2-${{ hashFiles('requirements/CI-tests-conda/requirements.txt') }}-${{ hashFiles('requirements/CI-tests-pip/requirements.txt') }}

- name: Install Conda
- name: Install Conda (needed for GSL)
uses: conda-incubator/setup-miniconda@v3.1.1
if: steps.cache.outputs.cache-hit != 'true'
with:
activate-environment: anaconda-client-env
python-version: ${{ matrix.python }}
Expand All @@ -72,17 +64,20 @@ jobs:
run: |
cp ~/.bash_profile ~/.profile

- name: Install conda deps
- name: Install GSL
if: steps.cache.outputs.cache-hit != 'true'
shell: bash -l {0} #We need a login shell to get conda
run: conda install --yes --file=requirements/CI-tests-conda/requirements.txt
run: conda install gsl

- name: Install uv
uses: astral-sh/setup-uv@v6
with:
version: "0.8.15"

- name: Install pip deps
if: steps.cache.outputs.cache-hit != 'true'
shell: bash -l {0}
run: |
pip install -r requirements/CI-tests-pip/requirements.txt
pip uninstall -y msprime
uv pip install -r pyproject.toml --extra test

- name: Build module
env:
Expand Down
23 changes: 14 additions & 9 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,18 @@ on the documentation because it requires a locally built version of the

### Python requirements

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

```
conda install --file requirements/development.txt
$ python -m pip install -e ".[dev]"
```
or

For conda users, you may need to install GSL first:
```
$ python -m pip install -r requirements/development.txt
conda install gsl
pip install -e ".[dev]"
```
depending on whether you are a conda or pip user.

## Overview

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

The statistical tests are all run via the `verification.py` script in the project root.
The script has some extra dependencies listed in the `requirements/verification.txt`,
which can be installed using `pip install -r` or `conda install --file`. Run
this script using:
The script has some extra dependencies, which can be installed using:

```
pip install -e ".[verification]"
```

Run this script using:

```{code-block} bash

Expand Down
86 changes: 86 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,92 @@ include-package-data = true
[tool.setuptools_scm]
write_to = "msprime/_version.py"

[project.optional-dependencies]
test = [
"bintrees==2.2.0",
"build==1.3.0",
"daiquiri==3.2.5.1; python_version<='3.9'",
"daiquiri==3.3.0; python_version>'3.9'",
"demes==0.2.3",
"kastore==0.3.3",
"meson==1.9.0",
"newick==1.10.0",
"pytest==8.4.1",
"pytest-cov==6.2.1",
"pytest-xdist==3.8.0",
"python_jsonschema_objects==0.5.7",
"setuptools==80.9.0",
"scipy==1.13.1; python_version<='3.10'",
"scipy==1.16.1; python_version>'3.10'",
"tskit==0.6.4",
"twine==6.2.0"
]

docs = [
"daiquiri==3.3.0",
"demes==0.2.3",
"demesdraw==0.4.0",
"jupyter-book==1.0.4.post1",
"networkx==3.5",
"matplotlib==3.10.3",
"newick==1.10.0",
"setuptools==80.9.0",
"sphinx-argparse==0.5.2",
"sphinx-book-theme",
"sphinx-issues==5.0.1",
"tskit==0.6.4",
"scipy==1.16.1"
]

dev = [
"docutils==0.21.2",
"asv==0.6.1",
"bintrees",
"coverage",
"daiquiri",
"demes>=0.2.0",
"demesdraw",
"flake8",
"matplotlib>=3.4.0",
"meson>=0.61.0",
"mock",
"mypy",
"ninja",
"numpy",
"pre-commit",
"pytest",
"pytest-cov",
"pytest-xdist",
"tskit>=0.5.2",
"kastore",
"sphinx-book-theme",
"scipy",
"setuptools_scm",
"sphinx>=4.4",
"sphinx-argparse",
"sphinx-issues",
"jupyter-book",
"networkx",
"newick>=1.3.0",
"python_jsonschema_objects"
]

verification = [
"dendropy",
"matplotlib",
"numpy",
"pandas",
"pyvolve",
"scipy==1.2",
"scikit-allel",
"statsmodels",
"seaborn",
"tqdm",
"argparse",
"daiquiri",
"pyslim>=1.0"
]

[tool.pytest.ini_options]
addopts = "-n 4"
testpaths = ["tests"]
Expand Down
12 changes: 0 additions & 12 deletions requirements/CI-complete/requirements.txt

This file was deleted.

13 changes: 0 additions & 13 deletions requirements/CI-docs/requirements.txt

This file was deleted.

2 changes: 0 additions & 2 deletions requirements/CI-tests-conda/requirements.txt

This file was deleted.

12 changes: 0 additions & 12 deletions requirements/CI-tests-pip/requirements.txt

This file was deleted.

30 changes: 0 additions & 30 deletions requirements/development.txt

This file was deleted.

15 changes: 0 additions & 15 deletions requirements/verification.txt

This file was deleted.

Loading