Skip to content

Commit dc61b6a

Browse files
committed
Upgrade actions, build with numpy2
1 parent e455221 commit dc61b6a

File tree

14 files changed

+167
-90
lines changed

14 files changed

+167
-90
lines changed

.circleci/config.yml

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,30 @@ jobs:
4141
# Write out the status for debugging purposes. Are we checked out at tags?
4242
git submodule status --recursive
4343
44+
- run:
45+
name: Build the distribution tarball.
46+
command: |
47+
python -m build --sdist
48+
python setup.py check
49+
python -m twine check dist/*.tar.gz --strict
50+
rm dist/*
51+
python -m build
52+
53+
- run:
54+
name: Install from the distribution tarball
55+
command: |
56+
python -m venv venv
57+
source venv/bin/activate
58+
pip install dist/*.tar.gz
59+
python -c 'import tsinfer; print(tsinfer.__version__)'
60+
61+
#Also check the wheel
62+
pip uninstall --yes tsinfer
63+
pip install dist/*.whl
64+
python -c 'import tsinfer; print(tsinfer.__version__)'
65+
deactivate
66+
rm -rf venv
67+
4468
- run:
4569
name: Compile Python
4670
command: |
@@ -101,25 +125,4 @@ jobs:
101125
command: |
102126
ninja -C build-clang test
103127
104-
- run:
105-
name: Build the distribution tarball.
106-
command: |
107-
python setup.py sdist
108-
python setup.py check
109-
python -m twine check dist/*.tar.gz --strict
110-
rm dist/*
111-
python -m build
112-
113-
- run:
114-
name: Install from the distribution tarball
115-
command: |
116-
python -m venv venv
117-
source venv/bin/activate
118-
pip install dist/*.tar.gz
119-
python -c 'import tsinfer; print(tsinfer.__version__)'
120-
121-
#Also check the wheel
122-
pip uninstall --yes tsinfer
123-
pip install dist/*.whl
124-
python -c 'import tsinfer; print(tsinfer.__version__)'
125128

.github/workflows/docker/shared.env

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
PYTHON_VERSIONS=(
2+
cp312-cp312
3+
cp311-cp311
24
cp310-cp310
35
cp39-cp39
4-
cp38-cp38
5-
cp37-cp37m
66
)

.github/workflows/docs.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,23 @@ jobs:
1919
runs-on: ubuntu-latest
2020
steps:
2121
- name: Cancel Previous Runs
22-
uses: styfle/cancel-workflow-action@0.11.0
22+
uses: styfle/cancel-workflow-action@0.12.1
2323
with:
2424
access_token: ${{ github.token }}
2525

26-
- uses: actions/checkout@v3
26+
- uses: actions/checkout@v4
2727
with:
2828
submodules: true
2929

30-
- uses: actions/setup-python@v4
30+
- uses: actions/setup-python@v5
3131
with:
3232
python-version: "3.10"
3333

34-
- uses: actions/cache@v3
34+
- uses: actions/cache@v4
3535
id: venv-cache
3636
with:
3737
path: venv
38-
key: docs-venv-v5-${{ hashFiles('requirements/CI-docs/requirements.txt') }}
38+
key: docs-venv-v6-${{ hashFiles('requirements/CI-docs/requirements.txt') }}
3939

4040
- name: Create venv and install deps (one by one to avoid conflict errors)
4141
if: steps.venv-cache.outputs.cache-hit != 'true'

.github/workflows/tests.yml

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- name: Cancel Previous Runs
14-
uses: styfle/cancel-workflow-action@0.11.0
14+
uses: styfle/cancel-workflow-action@0.12.1
1515
with:
1616
access_token: ${{ github.token }}
17-
- uses: actions/checkout@v3
18-
- uses: actions/setup-python@v4
17+
- uses: actions/checkout@v4
18+
- uses: actions/setup-python@v5
1919
with:
2020
python-version: '3.10'
2121
- name: install clang-format
@@ -31,28 +31,28 @@ jobs:
3131
strategy:
3232
fail-fast: false
3333
matrix:
34-
python: [ 3.9, "3.10" ]
34+
python: [ 3.9, "3.12" ]
3535
os: [ macos-latest, ubuntu-latest, windows-latest ]
3636
defaults:
3737
run:
3838
shell: bash
3939
steps:
4040
- name: Cancel Previous Runs
41-
uses: styfle/cancel-workflow-action@0.11.0
41+
uses: styfle/cancel-workflow-action@0.12.1
4242
with:
4343
access_token: ${{ github.token }}
4444

4545
- name: Checkout
46-
uses: actions/checkout@v3
46+
uses: actions/checkout@v4
4747
with:
4848
submodules: true
4949

5050
- name: Cache conda and dependancies
5151
id: cache
52-
uses: actions/cache@v3
52+
uses: actions/cache@v4
5353
with:
5454
path: ${{ env.CONDA }}/envs
55-
key: ${{ runner.os }}-${{ runner.arch }}-${{ matrix.python}}-conda-v1-${{ hashFiles('requirements/CI-tests-conda/requirements.txt')}}
55+
key: ${{ runner.os }}-${{ runner.arch }}-${{ matrix.python}}-conda-v5-${{ hashFiles('requirements/CI-tests-conda/requirements.txt')}}
5656

5757
- name: Install Miniconda with Mamba
5858
uses: conda-incubator/setup-miniconda@v3
@@ -61,10 +61,10 @@ jobs:
6161
activate-environment: anaconda-client-env
6262
python-version: ${{ matrix.python }}
6363
channels: conda-forge
64-
channel-priority: strict
64+
# channel-priority: strict
6565
auto-update-conda: true
66-
mamba-version: "*"
67-
use-mamba: true
66+
# mamba-version: "*"
67+
# use-mamba: true
6868

6969
- name: Fix windows .profile
7070
if: steps.cache.outputs.cache-hit != 'true' && matrix.os == 'windows-latest'
@@ -76,29 +76,41 @@ jobs:
7676
- name: Install compiler from conda
7777
if: steps.cache.outputs.cache-hit != 'true'
7878
shell: bash -l {0} #We need a login shell to get conda
79-
run: mamba install --yes c-compiler
79+
run: conda install --yes c-compiler
8080

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

8686
- name: Install cyvcf2 #Fails if done via conda due to no windows support.
8787
if: steps.cache.outputs.cache-hit != 'true' && matrix.os != 'windows-latest'
8888
run: |
8989
source ~/.profile
9090
conda activate anaconda-client-env
91-
pip install cyvcf2==0.30.18
91+
#Install these by pip so we don't pull in cbgen with conda as it isn't available on 3.12
92+
pip install sgkit==0.9.0 cyvcf2==0.31.1 yarl==1.9.4 aiohttp==3.9.5 requests==2.32.3
9293
94+
- name: Install sgkit only on windows
95+
if: steps.cache.outputs.cache-hit != 'true' && matrix.os == 'windows-latest'
96+
run: |
97+
source ~/.profile
98+
conda activate anaconda-client-env
99+
#Install these by pip so we don't pull in cbgen with conda as it isn't available on 3.12
100+
pip install sgkit==0.9.0
93101
94102
- name: Build module
95103
run: |
96104
source ~/.profile
97105
conda activate anaconda-client-env
106+
# Use numpy2 to build the module
107+
pip install "numpy>=2"
98108
python setup.py build_ext --inplace
99109
100110
- name: Run tests
101111
run: |
102112
source ~/.profile
103113
conda activate anaconda-client-env
114+
# Test with numpy<2 for numba
115+
pip install "numpy<2"
104116
python -m pytest -xv

.mergify.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ queue_rules:
55
- "#changes-requested-reviews-by=0"
66
- status-success=Lint
77
- status-success=Python (3.9, macos-latest)
8-
- status-success=Python (3.10, macos-latest)
8+
- status-success=Python (3.12, macos-latest)
99
- status-success=Python (3.9, ubuntu-latest)
10-
- status-success=Python (3.10, ubuntu-latest)
10+
- status-success=Python (3.12, ubuntu-latest)
1111
- status-success=Python (3.9, windows-latest)
12-
- status-success=Python (3.10, windows-latest)
12+
- status-success=Python (3.12, windows-latest)
1313
- "status-success=ci/circleci: build"
1414

1515
pull_request_rules:
@@ -22,11 +22,11 @@ pull_request_rules:
2222
- label=AUTOMERGE-REQUESTED
2323
- status-success=Lint
2424
- status-success=Python (3.9, macos-latest)
25-
- status-success=Python (3.10, macos-latest)
25+
- status-success=Python (3.12, macos-latest)
2626
- status-success=Python (3.9, ubuntu-latest)
27-
- status-success=Python (3.10, ubuntu-latest)
27+
- status-success=Python (3.12, ubuntu-latest)
2828
- status-success=Python (3.9, windows-latest)
29-
- status-success=Python (3.10, windows-latest)
29+
- status-success=Python (3.12, windows-latest)
3030
- "status-success=ci/circleci: build"
3131
actions:
3232
queue:

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ repos:
2222
rev: v3.2.2
2323
hooks:
2424
- id: pyupgrade
25-
args: [ --py3-plus, --py37-plus ]
25+
args: [ --py3-plus, --py39-plus ]
2626
- repo: https://github.com/psf/black
2727
rev: 22.10.0
2828
hooks:

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ In development
1818
- Remove the `uuid` field from SampleData. SampleData equality is now purely based
1919
on data. ({pr}`748`, {user}`benjeffery`)
2020

21+
- tsinfer now requires Python 3.9 or later
22+
2123
**Performance improvements**
2224

2325
- Reduce memory usage when running `match_samples` against large cohorts

pyproject.toml

Lines changed: 72 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,79 @@ requires = [
33
"setuptools>=42",
44
"setuptools_scm",
55
"wheel",
6-
"oldest-supported-numpy"
6+
"numpy>=2"
77
]
8-
98
build-backend = "setuptools.build_meta"
109

1110
[tool.setuptools_scm]
12-
write_to = "tsinfer/_version.py"
11+
write_to = "tsinfer/_version.py"
12+
13+
[project]
14+
name = "tsinfer"
15+
dynamic = ["version"]
16+
authors = [
17+
{name = "Tskit Developers", email = "[email protected]"},
18+
]
19+
description = "Infer tree sequences from genetic variation data."
20+
readme = "README.md"
21+
requires-python = ">=3.9"
22+
license = {text = "GNU GPLv3+"}
23+
classifiers = [
24+
"Programming Language :: C",
25+
"Programming Language :: Python",
26+
"Programming Language :: Python :: 3",
27+
"Programming Language :: Python :: 3.9",
28+
"Programming Language :: Python :: 3.10",
29+
"Programming Language :: Python :: 3.11",
30+
"Programming Language :: Python :: 3.12",
31+
"Programming Language :: Python :: 3 :: Only",
32+
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
33+
"Development Status :: 3 - Alpha",
34+
"Environment :: Other Environment",
35+
"Intended Audience :: Science/Research",
36+
"Operating System :: POSIX",
37+
"Operating System :: MacOS :: MacOS X",
38+
"Operating System :: Microsoft :: Windows",
39+
"Topic :: Scientific/Engineering",
40+
"Topic :: Scientific/Engineering :: Bio-Informatics",
41+
]
42+
keywords = [
43+
"population genetics",
44+
"tree sequence",
45+
"ancestral recombination graph",
46+
"evolutionary tree",
47+
"inference",
48+
"tsinfer",
49+
]
50+
dependencies = [
51+
"numpy>=1.23.5",
52+
"six",
53+
"tqdm",
54+
"humanize",
55+
"daiquiri",
56+
"tskit>=0.5.3",
57+
"numcodecs>=0.6",
58+
"zarr>=2.2,!=2.11.0,!=2.11.1,!=2.11.2,<3",
59+
"lmdb",
60+
"sortedcontainers",
61+
"attrs>=19.2.0",
62+
"dask[array]",
63+
"numba",
64+
]
65+
66+
[project.urls]
67+
Homepage = "https://tskit.dev/tsinfer"
68+
Documentation = "https://tskit.dev/tsinfer/docs/stable"
69+
Changelog = "https://tskit.dev/tsinfer/docs/stable/CHANGELOG.html"
70+
"Bug Tracker" = "https://github.com/tskit-dev/tsinfer/issues"
71+
"Source Code" = "https://github.com/tskit-dev/tsinfer/"
72+
73+
[project.scripts]
74+
tsinfer = "tsinfer.__main__:main"
75+
76+
[tool.setuptools]
77+
packages = ["tsinfer"]
78+
include-package-data = true
79+
80+
[tool.pytest.ini_options]
81+
testpaths = ["tests"]

requirements/CI-docs/requirements.txt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
jupyter-book==0.15.1
2-
sphinx-issues==3.0.1
1+
jupyter-book==1.0.2
2+
sphinx-issues==4.1.0
33
sphinx-argparse==0.4.0
4-
humanize==4.7.0
5-
lmdb==1.4.1
6-
tqdm==4.65.0
7-
daiquiri==3.2.1
8-
msprime==1.2.0
9-
sgkit[vcf]==0.7.0
10-
ipywidgets==8.1.0
4+
humanize==4.10.0
5+
lmdb==1.5.1
6+
tqdm==4.66.4
7+
daiquiri==3.2.5.1
8+
msprime==1.3.2
9+
sgkit[vcf]==0.9.0
10+
ipywidgets==8.1.3
1111
sphinx-book-theme #Unpinned to allow easy updating.
Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
build==1.2.1
22
colorama==0.4.6
3-
daiquiri==3.0.0
4-
humanize==4.9.0
5-
lmdb==1.4.1
6-
matplotlib==3.8.4
7-
meson==1.4.0
8-
msprime==1.3.1
9-
pytest==8.2.0
3+
daiquiri==3.2.5.1
4+
humanize==4.10.0
5+
lmdb==1.5.1
6+
matplotlib==3.9.1
7+
meson==1.5.0
8+
msprime==1.3.2
9+
pytest==8.2.2
1010
pytest-cov==5.0.0
1111
seaborn==0.13.2
12-
sgkit[vcf]==0.8.0
12+
sgkit[vcf]==0.9.0
13+
tskit==0.5.8
1314
tqdm==4.66.4
14-
twine==5.0.0
15+
twine==5.1.1
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
pytest==8.2.0
2-
msprime==1.3.1
3-
humanize==4.9.0
4-
python-lmdb==1.3.0
1+
pytest==8.2.2
2+
msprime==1.3.2
3+
humanize==4.10.0
4+
python-lmdb==1.4.1
55
tqdm==4.66.4
66
daiquiri==3.0.0
7-
sgkit[vcf]==0.8.0
8-
matplotlib==3.8.4
7+
matplotlib==3.9.1
98
seaborn==0.13.2
109
colorama==0.4.6
10+
tskit==0.5.8

0 commit comments

Comments
 (0)