Skip to content

Commit dbf9141

Browse files
committed
Pyproject reqs
1 parent 7b6f418 commit dbf9141

File tree

8 files changed

+96
-133
lines changed

8 files changed

+96
-133
lines changed

.circleci/config.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,17 @@ jobs:
1717
name: Install dependencies and set PATH
1818
command: |
1919
sudo apt-get update
20-
sudo apt-get install libgsl-dev libcap-dev libnuma-dev libcunit1-dev \
21-
libconfig-dev ninja-build valgrind clang python3-pip
20+
sudo apt-get install libcap-dev libnuma-dev libcunit1-dev \
21+
libconfig-dev ninja-build valgrind clang
2222
# set path persistently https://circleci.com/docs/2.0/env-vars/#setting-path
2323
echo 'export PATH=/home/circleci/.local/bin:$PATH' >> $BASH_ENV
2424
2525
- run:
26-
name: Install development dependencies
26+
name: Install test dependencies
2727
command: |
2828
pyenv global 3.9
29-
pip install -r requirements/CI-tests-complete/requirements.txt --user
29+
pip install uv
30+
uv pip install --system -r pyproject.toml --extra test
3031
pyenv rehash
3132
3233
- save_cache:

.github/workflows/docs.yml

Lines changed: 2 additions & 3 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 tabix
15-
make-command: make all
14+
make-command: make all

.github/workflows/tests.yml

Lines changed: 17 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ jobs:
2020
with:
2121
python-version: '3.10'
2222
- name: install clang-format
23-
if: steps.clang_format.outputs.cache-hit != 'true'
2423
run: |
2524
sudo pip install clang-format==6.0.1
2625
sudo ln -s /usr/local/bin/clang-format /usr/local/bin/clang-format-6.0
@@ -48,70 +47,39 @@ jobs:
4847
with:
4948
submodules: true
5049

51-
- name: Cache conda and dependancies
52-
id: cache
53-
uses: actions/[email protected]
50+
- name: Install uv and set the python version
51+
uses: astral-sh/setup-uv@v6
5452
with:
55-
path: ${{ env.CONDA }}/envs
56-
key: ${{ runner.os }}-${{ runner.arch }}-${{ matrix.python}}-conda-v5-${{ hashFiles('requirements/CI-tests-conda/requirements.txt')}}
57-
58-
- name: Install Miniconda with Mamba
59-
uses: conda-incubator/[email protected]
60-
if: steps.cache.outputs.cache-hit != 'true'
61-
with:
62-
activate-environment: anaconda-client-env
6353
python-version: ${{ matrix.python }}
64-
channels: conda-forge
65-
# channel-priority: strict
66-
auto-update-conda: true
67-
# mamba-version: "*"
68-
# use-mamba: true
54+
version: "0.8.15"
6955

70-
- name: Fix windows .profile
71-
if: steps.cache.outputs.cache-hit != 'true' && matrix.os == 'windows-latest'
56+
- name: Setup venv
7257
run: |
73-
cp ~/.bash_profile ~/.profile
74-
75-
# Work around weird issues on OSX possibly caused by mixed compilers
76-
# https://github.com/tskit-dev/tsinfer/issues/376
77-
- name: Install compiler from conda
78-
if: steps.cache.outputs.cache-hit != 'true'
79-
shell: bash -l {0} #We need a login shell to get conda
80-
run: conda install --yes c-compiler
81-
82-
- name: Install conda deps
83-
if: steps.cache.outputs.cache-hit != 'true'
84-
shell: bash -l {0} #We need a login shell to get conda
85-
run: conda install --yes --file=requirements/CI-tests-conda/requirements.txt
58+
uv venv
8659
8760
- name: Install cyvcf2 #Fails if done via conda due to no windows support.
88-
if: steps.cache.outputs.cache-hit != 'true' && matrix.os != 'windows-latest'
61+
if: matrix.os != 'windows-latest'
8962
run: |
90-
source ~/.profile
91-
conda activate anaconda-client-env
9263
#Install these by pip so we don't pull in cbgen with conda as it isn't available on 3.12
93-
pip install sgkit==0.9.0 cyvcf2==0.31.1 yarl==1.9.4 aiohttp==3.9.5 requests==2.32.3
64+
uv pip install sgkit==0.9.0 cyvcf2==0.31.1 yarl==1.9.4 aiohttp==3.9.5 requests==2.32.3
9465
9566
- name: Install sgkit only on windows
96-
if: steps.cache.outputs.cache-hit != 'true' && matrix.os == 'windows-latest'
67+
if: matrix.os == 'windows-latest'
9768
run: |
98-
source ~/.profile
99-
conda activate anaconda-client-env
100-
#Install these by pip so we don't pull in cbgen with conda as it isn't available on 3.12
101-
pip install sgkit==0.9.0
69+
uv pip install sgkit==0.9.0
70+
71+
- name: Install pip deps
72+
run: |
73+
uv pip install -r pyproject.toml --extra test
10274
10375
- name: Build module
10476
run: |
105-
source ~/.profile
106-
conda activate anaconda-client-env
10777
# Use numpy2 to build the module
108-
pip install "numpy>=2"
109-
python setup.py build_ext --inplace
78+
uv pip install "numpy>=2"
79+
uv run --no-sync python setup.py build_ext --inplace
11080
11181
- name: Run tests
11282
run: |
113-
source ~/.profile
114-
conda activate anaconda-client-env
11583
# Test with numpy<2 for numba
116-
pip install "numpy<2"
117-
python -m pytest -xv
84+
uv pip install "numpy<2"
85+
uv run --no-sync python -m pytest -xv

pyproject.toml

Lines changed: 72 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ dependencies = [
5454
"humanize",
5555
"daiquiri",
5656
"tskit>=0.5.3",
57-
"numcodecs>=0.6",
57+
"numcodecs>=0.6,<0.15.1", #Pinned due to https://github.com/zarr-developers/numcodecs/issues/733
5858
"zarr>=2.2,!=2.11.0,!=2.11.1,!=2.11.2,<3",
5959
"lmdb",
6060
"sortedcontainers",
@@ -73,6 +73,77 @@ Changelog = "https://tskit.dev/tsinfer/docs/stable/CHANGELOG.html"
7373
[project.scripts]
7474
tsinfer = "tsinfer.__main__:main"
7575

76+
[project.optional-dependencies]
77+
test = [
78+
"build==1.2.2.post1",
79+
"colorama==0.4.6",
80+
"daiquiri==3.2.5.1",
81+
"humanize==4.12.1",
82+
"lmdb==1.6.2",
83+
"matplotlib==3.9.4",
84+
"meson==1.7.0",
85+
"msprime==1.3.4",
86+
"pytest==8.3.5",
87+
"pytest-cov==6.0.0",
88+
"seaborn==0.13.2",
89+
"sgkit[vcf]==0.9.0; sys_platform != 'win32'",
90+
"tskit==0.6.0",
91+
"tqdm==4.67.1",
92+
"twine==6.1.0"
93+
]
94+
95+
docs = [
96+
"jupyter-book==1.0.4.post1",
97+
"sphinx-issues==5.0.0",
98+
"sphinx-argparse==0.5.2",
99+
"humanize==4.12.1",
100+
"lmdb==1.6.2",
101+
"tqdm==4.67.1",
102+
"daiquiri==3.3.0",
103+
"msprime==1.3.3",
104+
"sgkit[vcf]==0.9.0",
105+
"ipywidgets==8.1.5",
106+
"Bio==1.7.1",
107+
"bio2zarr==0.1.4",
108+
"sphinx-book-theme",
109+
"pyfaidx==0.8.1.3"
110+
]
111+
112+
dev = [
113+
"attrs",
114+
"codecov",
115+
"coverage",
116+
"flake8",
117+
"six",
118+
"tqdm",
119+
"humanize",
120+
"daiquiri",
121+
"msprime>=1.0.0",
122+
"tskit>=0.5.3",
123+
"lmdb",
124+
"pre-commit",
125+
"pytest",
126+
"pytest-coverage",
127+
"h5py",
128+
"sortedcontainers",
129+
"python-prctl; sys_platform == 'linux'",
130+
"numa; sys_platform == 'linux'",
131+
"sphinx",
132+
"sphinx-argparse",
133+
"sphinx_rtd_theme",
134+
"setuptools>=45",
135+
"setuptools_scm",
136+
"matplotlib",
137+
"seaborn",
138+
"colorama",
139+
"sgkit[vcf]",
140+
"sphinx-book-theme",
141+
"jupyter-book",
142+
"sphinx-issues",
143+
"ipywidgets",
144+
"pyfaidx"
145+
]
146+
76147
[tool.setuptools]
77148
packages = ["tsinfer"]
78149
include-package-data = true

requirements/CI-docs/requirements.txt

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

requirements/CI-tests-complete/requirements.txt

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

requirements/CI-tests-conda/requirements.txt

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

requirements/development.txt

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

0 commit comments

Comments
 (0)