Skip to content

Commit f31edf3

Browse files
committed
Upgrade actions, build with numpy2
1 parent 40c9e1b commit f31edf3

File tree

11 files changed

+190
-182
lines changed

11 files changed

+190
-182
lines changed

.circleci/config.yml

Lines changed: 41 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
version: 2
1+
version: 2.1
2+
3+
orbs:
4+
codecov: codecov/[email protected]
5+
26
jobs:
37
build:
48
docker:
5-
- image: cimg/python:3.7
9+
- image: cimg/python:3.9
610
steps:
711
- checkout
812

@@ -21,12 +25,12 @@ jobs:
2125
- run:
2226
name: Install development dependencies
2327
command: |
24-
pyenv global 3.8
28+
pyenv global 3.9
2529
pip install -r requirements/CI-tests-complete/requirements.txt --user
2630
pyenv rehash
2731
2832
- save_cache:
29-
key: tsinfer-{{ .Branch }}
33+
key: tsinfer-{{ .Branch }}-v1
3034
paths:
3135
- "/home/circleci/.local"
3236

@@ -37,6 +41,30 @@ jobs:
3741
# Write out the status for debugging purposes. Are we checked out at tags?
3842
git submodule status --recursive
3943
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+
4068
- run:
4169
name: Compile Python
4270
command: |
@@ -45,10 +73,13 @@ jobs:
4573
- run:
4674
name: Run Python tests and upload coverage
4775
command: |
48-
python3 -m pytest --cov=tsinfer --cov-report=xml --cov-branch -n4 tests
49-
python3 -m codecov -X gcov -F python
76+
python3 -m pytest --cov=tsinfer --cov-report=xml --cov-branch -xvs tests
5077
rm .coverage
5178
79+
- codecov/upload:
80+
flags: python
81+
token: CODECOV_TOKEN
82+
5283
- run:
5384
name: Compile C with gcc
5485
command: |
@@ -79,7 +110,10 @@ jobs:
79110
gcov -pb ./libtsinfer.a.p/object_heap.c.gcno ../lib/object_heap.c
80111
gcov -pb ./libtsinfer.a.p/err.c.gcno ../lib/err.c
81112
cd ..
82-
codecov -X gcov -F C
113+
114+
- codecov/upload:
115+
flags: C
116+
token: CODECOV_TOKEN
83117

84118
- run:
85119
name: Valgrind for C tests.
@@ -91,25 +125,3 @@ jobs:
91125
command: |
92126
ninja -C build-clang test
93127
94-
- run:
95-
name: Build the distribution tarball.
96-
command: |
97-
python setup.py sdist
98-
python setup.py check
99-
python -m twine check dist/*.tar.gz --strict
100-
rm dist/*
101-
python -m build
102-
103-
- run:
104-
name: Install from the distribution tarball
105-
command: |
106-
python -m venv venv
107-
source venv/bin/activate
108-
pip install dist/*.tar.gz
109-
python -c 'import tsinfer; print(tsinfer.__version__)'
110-
111-
#Also check the wheel
112-
pip uninstall --yes tsinfer
113-
pip install dist/*.whl
114-
python -c 'import tsinfer; print(tsinfer.__version__)'
115-
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: 6 additions & 6 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-v3-${{ 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'
@@ -63,4 +63,4 @@ jobs:
6363
curl -X POST https://api.github.com/repos/tskit-dev/tskit-site/dispatches \
6464
-H 'Accept: application/vnd.github.everest-preview+json' \
6565
-u AdminBot-tskit:${{ secrets.ADMINBOT_TOKEN }} \
66-
--data '{"event_type":"build-docs"}'
66+
--data '{"event_type":"build-docs"}'

.github/workflows/tests.yml

Lines changed: 38 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4,67 +4,67 @@ on:
44
pull_request:
55
push:
66
branches: [main]
7-
tags:
87

98
jobs:
109
pre-commit:
1110
name: Lint
1211
runs-on: ubuntu-latest
1312
steps:
1413
- name: Cancel Previous Runs
15-
uses: styfle/cancel-workflow-action@0.11.0
14+
uses: styfle/cancel-workflow-action@0.12.1
1615
with:
1716
access_token: ${{ github.token }}
18-
- uses: actions/checkout@v3
19-
- uses: actions/setup-python@v4
17+
- uses: actions/checkout@v4
18+
- uses: actions/setup-python@v5
2019
with:
21-
python-version: "3.10"
20+
python-version: '3.10'
2221
- name: install clang-format
22+
if: steps.clang_format.outputs.cache-hit != 'true'
2323
run: |
24-
pip install clang-format==6.0.1
24+
sudo pip install clang-format==6.0.1
25+
sudo ln -s /usr/local/bin/clang-format /usr/local/bin/clang-format-6.0
2526
- uses: pre-commit/[email protected]
2627

2728
test:
2829
name: Python
2930
runs-on: ${{ matrix.os }}
3031
strategy:
32+
fail-fast: false
3133
matrix:
32-
python: [ 3.7, "3.10" ]
34+
python: [ 3.9, "3.12" ]
3335
os: [ macos-latest, ubuntu-latest, windows-latest ]
3436
defaults:
3537
run:
3638
shell: bash
3739
steps:
3840
- name: Cancel Previous Runs
39-
uses: styfle/cancel-workflow-action@0.11.0
41+
uses: styfle/cancel-workflow-action@0.12.1
4042
with:
4143
access_token: ${{ github.token }}
4244

4345
- name: Checkout
44-
uses: actions/checkout@v3
46+
uses: actions/checkout@v4
4547
with:
4648
submodules: true
4749

4850
- name: Cache conda and dependancies
4951
id: cache
50-
uses: actions/cache@v3
52+
uses: actions/cache@v4
5153
with:
52-
path: |
53-
c:\Miniconda\envs\anaconda-client-env
54-
/usr/share/miniconda/envs/anaconda-client-env
55-
~/osx-conda
56-
~/.profile
57-
key: ${{ runner.os }}-${{ matrix.python}}-conda-v11-${{ hashFiles('requirements/CI-tests-conda/requirements.txt') }}-${{ hashFiles('requirements/CI-tests-pip/requirements.txt') }}
54+
path: ${{ env.CONDA }}/envs
55+
key: ${{ runner.os }}-${{ runner.arch }}-${{ matrix.python}}-conda-v5-${{ hashFiles('requirements/CI-tests-conda/requirements.txt')}}
5856

59-
- name: Install Conda
60-
uses: conda-incubator/setup-miniconda@v2
57+
- name: Install Miniconda with Mamba
58+
uses: conda-incubator/setup-miniconda@v3
6159
if: steps.cache.outputs.cache-hit != 'true'
6260
with:
6361
activate-environment: anaconda-client-env
6462
python-version: ${{ matrix.python }}
6563
channels: conda-forge
66-
channel-priority: strict
64+
# channel-priority: strict
6765
auto-update-conda: 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'
@@ -83,25 +83,34 @@ jobs:
8383
shell: bash -l {0} #We need a login shell to get conda
8484
run: conda install --yes --file=requirements/CI-tests-conda/requirements.txt
8585

86-
- name: Install pip deps
87-
if: steps.cache.outputs.cache-hit != 'true' && matrix.python != 3.7
88-
shell: bash -l {0}
89-
run: pip install -r requirements/CI-tests-pip/requirements.txt
90-
91-
- name: Fix pandas on 3.7
92-
if: steps.cache.outputs.cache-hit != 'true' && matrix.python == 3.7
93-
shell: bash -l {0}
94-
run: pip install -r requirements/CI-tests-pip/requirements3.7.txt
86+
- name: Install cyvcf2 #Fails if done via conda due to no windows support.
87+
if: steps.cache.outputs.cache-hit != 'true' && matrix.os != 'windows-latest'
88+
run: |
89+
source ~/.profile
90+
conda activate anaconda-client-env
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
9593
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
96101
97102
- name: Build module
98103
run: |
99104
source ~/.profile
100105
conda activate anaconda-client-env
106+
# Use numpy2 to build the module
107+
pip install "numpy>=2"
101108
python setup.py build_ext --inplace
102109
103110
- name: Run tests
104111
run: |
105112
source ~/.profile
106113
conda activate anaconda-client-env
107-
python -m pytest -xv -n2
114+
# Test with numpy<2 for numba
115+
pip install "numpy<2"
116+
python -m pytest -xv

.mergify.yml

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ queue_rules:
44
- "#approved-reviews-by>=1"
55
- "#changes-requested-reviews-by=0"
66
- status-success=Lint
7-
- status-success=Python (3.7, macos-latest)
8-
- status-success=Python (3.10, macos-latest)
9-
- status-success=Python (3.7, ubuntu-latest)
10-
- status-success=Python (3.10, ubuntu-latest)
11-
- status-success=Python (3.7, windows-latest)
12-
- status-success=Python (3.10, windows-latest)
7+
- status-success=Python (3.9, macos-latest)
8+
- status-success=Python (3.12, macos-latest)
9+
- status-success=Python (3.9, ubuntu-latest)
10+
- status-success=Python (3.12, ubuntu-latest)
11+
- status-success=Python (3.9, windows-latest)
12+
- status-success=Python (3.12, windows-latest)
1313
- "status-success=ci/circleci: build"
1414

1515
pull_request_rules:
@@ -21,18 +21,17 @@ pull_request_rules:
2121
- base=main
2222
- label=AUTOMERGE-REQUESTED
2323
- status-success=Lint
24-
- status-success=Python (3.7, macos-latest)
25-
- status-success=Python (3.10, macos-latest)
26-
- status-success=Python (3.7, ubuntu-latest)
27-
- status-success=Python (3.10, ubuntu-latest)
28-
- status-success=Python (3.7, windows-latest)
29-
- status-success=Python (3.10, windows-latest)
24+
- status-success=Python (3.9, macos-latest)
25+
- status-success=Python (3.12, macos-latest)
26+
- status-success=Python (3.9, ubuntu-latest)
27+
- status-success=Python (3.12, ubuntu-latest)
28+
- status-success=Python (3.9, windows-latest)
29+
- status-success=Python (3.12, windows-latest)
3030
- "status-success=ci/circleci: build"
3131
actions:
3232
queue:
3333
name: default
3434
method: rebase
35-
rebase_fallback: none
3635
update_method: rebase
3736

3837
- name: Remove label after merge
@@ -42,4 +41,4 @@ pull_request_rules:
4241
actions:
4342
label:
4443
remove:
45-
- AUTOMERGE-REQUESTED
44+
- AUTOMERGE-REQUESTED

.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: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## [0.3.2] - 2024-07-12
4+
5+
**Breaking Changes**
6+
7+
- tsinfer now requires Python 3.9 or later
8+
39
## [0.3.1] - 2023-04-19
410

511
Bug fix release for a bad dependency specification.

0 commit comments

Comments
 (0)