-
Notifications
You must be signed in to change notification settings - Fork 14
185 lines (157 loc) · 5.84 KB
/
Copy pathci.yml
File metadata and controls
185 lines (157 loc) · 5.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
name: CI
on:
push:
pull_request:
workflow_dispatch:
schedule:
- cron: "0 0 1 * *"
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
name: Ruff
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
version: "0.12.2"
python-version: "3.14"
enable-cache: true
- name: Ruff
run: uvx ruff@0.7.1 check
documentation:
name: Documentation
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install uv and Python 3.14
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
version: "0.12.2"
python-version: "3.14"
enable-cache: true
cache-suffix: documentation
- name: Install documentation dependencies
run: uv sync --frozen --extra dev
- name: Build documentation from clean sources
run: uv run --frozen --no-sync sphinx-build -W --keep-going -E -a -d "${{ runner.temp }}/doctrees" -b html doc/source "${{ runner.temp }}/generated-docs"
- name: Verify generated documentation is current
run: diff -ru --exclude=.nojekyll "${{ runner.temp }}/generated-docs" docs
test:
name: Test (${{ matrix.os }}, Python ${{ matrix.python-version }})
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-2022, macos-15-intel, macos-15]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
runs-on: ${{ matrix.os }}
timeout-minutes: 30
env:
UV_PYTHON: ${{ matrix.python-version }}
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install uv and Python ${{ matrix.python-version }}
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
version: "0.12.2"
python-version: ${{ matrix.python-version }}
enable-cache: true
cache-suffix: ${{ matrix.os }}-${{ matrix.python-version }}
- name: Install core test dependencies
run: uv sync --frozen --extra dev
- name: Run the canonical core suite
run: uv run --frozen --no-sync python tests/test.py
- name: Install optional dependencies
run: uv sync --frozen --all-extras
- name: Run the optional BGEN suite
run: uv run --frozen --no-sync pytest pysnptools/distreader/test_bgen2.py
build:
name: Build distributions
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
version: "0.12.2"
python-version: "3.14"
enable-cache: true
- name: Build wheel and source distribution
run: uv build --no-sources
- name: Build wheel from the source distribution
run: uv build --wheel --no-sources --out-dir sdist-dist dist/*.tar.gz
- name: Compare direct and sdist-derived wheels
shell: bash
run: cmp dist/*.whl sdist-dist/*.whl
- name: Upload distributions
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: distributions
path: |
dist/*.whl
dist/*.tar.gz
if-no-files-found: error
retention-days: 7
artifact-test:
name: Artifact test (${{ matrix.kind }}, Python ${{ matrix.python-version }})
needs: build
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
include:
- kind: wheel
python-version: "3.10"
package: dist/*.whl
- kind: sdist
python-version: "3.10"
package: dist/*.tar.gz
- kind: wheel
python-version: "3.14"
package: dist/*.whl
- kind: sdist
python-version: "3.14"
package: dist/*.tar.gz
steps:
- name: Install uv and Python ${{ matrix.python-version }}
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
version: "0.12.2"
python-version: ${{ matrix.python-version }}
no-project: true
enable-cache: false
- name: Download distributions
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: distributions
path: dist
- name: Create clean environment
run: uv venv --python ${{ matrix.python-version }} .artifact-venv
- name: Install exact ${{ matrix.kind }} artifact
run: uv pip install --python .artifact-venv/bin/python ${{ matrix.package }}
- name: Smoke-test installed package
run: >-
.artifact-venv/bin/python -c
"from importlib.resources import files;
import numpy as np;
import pysnptools;
from pysnptools.snpreader import SnpData;
data = SnpData(iid=[['a','a'],['b','b']], sid=['s1','s2'], val=np.array([[0.0,1.0],[2.0,1.0]]));
assert data.standardize().read().val.shape == (2,2);
manifests = ['pysnptools.hashdown.json','bgen.hashdown.json','synth.hashdown.json'];
assert all(files('pysnptools.util').joinpath(name).is_file() for name in manifests);
assert '.artifact-venv' in pysnptools.__file__;
print(pysnptools.__file__)"