-
Notifications
You must be signed in to change notification settings - Fork 60
143 lines (112 loc) · 3.88 KB
/
python_tests.yml
File metadata and controls
143 lines (112 loc) · 3.88 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
name: Python tests
on:
push:
branches: [master]
paths: ['src/**', 'tests/**', 'pyproject.toml']
pull_request:
branches: [master]
paths: ['src/**', 'tests/**', 'pyproject.toml']
jobs:
test-core:
name: ${{ matrix.platform }} / Python ${{ matrix.python-version }}
strategy:
fail-fast: false
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.10", "3.11", "3.12", "3.13"]
runs-on: ${{ matrix.platform }}
env:
FORCE_COLOR: true
steps:
- uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Set up uv
uses: astral-sh/setup-uv@v7
- name: Install dependencies
run: uv pip install --group=test . --system
- name: Test with pytest
run: pytest --verbose --no-cov
test-dependency-combinations:
name: Dep combo / ${{ matrix.platform }} / ${{ matrix.label }}
strategy:
fail-fast: false
matrix:
platform: [ubuntu-latest, windows-latest]
include:
- label: minimum-versions
python-version: "3.10"
numpy: "1.22.4"
scipy: "1.8.0"
scikit-learn: "1.2.0"
numba: "0.57.0"
- label: old-versions
python-version: "3.11"
numpy: "1.25.2"
scipy: "1.11.4"
scikit-learn: "1.4.2"
numba: "0.59.0"
- label: mid-versions
python-version: "3.12"
numpy: "2.0.2"
scipy: "1.14.1"
scikit-learn: "1.5.2"
numba: "0.60.0"
runs-on: ${{ matrix.platform }}
env:
FORCE_COLOR: true
steps:
- uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Set up uv
uses: astral-sh/setup-uv@v7
- name: Install numpy (pinned)
if: matrix.numpy != ''
run: uv pip install "numpy==${{ matrix.numpy }}" --system
- name: Install numpy (latest)
if: matrix.numpy == ''
run: uv pip install numpy --system
- name: Install pinned dependencies
if: matrix.label != 'latest-versions'
run: uv pip install "scipy==${{ matrix.scipy }}" "scikit-learn==${{ matrix.scikit-learn }}" "numba==${{ matrix.numba }}" --system
- name: Install latest dependencies
if: matrix.label == 'latest-versions'
run: uv pip install scipy scikit-learn numba --system
- name: Install antropy (no deps, already pinned above)
run: uv pip install . --no-deps --system
- name: Install test dependencies
run: uv pip install --group=test --system
- name: Print installed versions
run: |
python -c "import numpy, scipy, sklearn, numba; print(f'numpy={numpy.__version__}, scipy={scipy.__version__}, sklearn={sklearn.__version__}, numba={numba.__version__}')"
- name: Test with pytest
run: pytest --verbose --no-cov
coverage:
name: Coverage (Ubuntu)
runs-on: ubuntu-latest
env:
FORCE_COLOR: true
NUMBA_DISABLE_JIT: "1"
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version-file: "pyproject.toml"
- name: Set up uv
uses: astral-sh/setup-uv@v7
- name: Install dependencies
run: uv pip install --group=test . --system
- name: Test with pytest and coverage
run: pytest --cov --cov-report=xml --verbose
- name: Upload coverage report
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
fail_ci_if_error: true