Repository navigation
255 lines (248 loc) · 10.6 KB
/
Copy pathpython_matrix.yml
File metadata and controls
255 lines (248 loc) · 10.6 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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
name: Python Version Matrix
on:
workflow_dispatch:
schedule:
- cron: '0 3 * * 1' # Monday 03:00 UTC, off-cycle from the daily release
# Force local editable builds to outrank PyPI versions so pip's resolver
# doesn't replace `pip install -e ./PyAutoNerves` (1.0.dev0) with PyPI's
# autonerves-2026.x during a downstream lib install. Without this, the
# stale daily-release PyPI artifacts shadow the merged main code.
env:
SETUPTOOLS_SCM_PRETEND_VERSION_FOR_AUTOCONF: "9999.0.0"
SETUPTOOLS_SCM_PRETEND_VERSION_FOR_AUTOARRAY: "9999.0.0"
SETUPTOOLS_SCM_PRETEND_VERSION_FOR_AUTOFIT: "9999.0.0"
SETUPTOOLS_SCM_PRETEND_VERSION_FOR_AUTOGALAXY: "9999.0.0"
SETUPTOOLS_SCM_PRETEND_VERSION_FOR_AUTOLENS: "9999.0.0"
SETUPTOOLS_SCM_PRETEND_VERSION_FOR_AUTOCTI: "9999.0.0"
jobs:
unit_tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.12', '3.13', '3.14']
project:
- { name: PyAutoNerves, tests: test_autonerves }
- { name: PyAutoArray, tests: test_autoarray }
- { name: PyAutoFit, tests: test_autofit }
- { name: PyAutoGalaxy, tests: test_autogalaxy }
- { name: PyAutoLens, tests: test_autolens }
steps:
- uses: actions/checkout@v4
with: { repository: PyAutoLabs/PyAutoNerves, path: PyAutoNerves }
- uses: actions/checkout@v4
with: { repository: PyAutoLabs/PyAutoArray, path: PyAutoArray }
- uses: actions/checkout@v4
with: { repository: PyAutoLabs/PyAutoFit, path: PyAutoFit }
- uses: actions/checkout@v4
with: { repository: PyAutoLabs/PyAutoGalaxy, path: PyAutoGalaxy }
- uses: actions/checkout@v4
with: { repository: PyAutoLabs/PyAutoLens, path: PyAutoLens }
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install libraries (single combined install — all 5 local)
env:
PYTHON_VERSION: ${{ matrix.python-version }}
run: |
python -m pip install --upgrade pip wheel
# Pass all 5 libs in ONE pip invocation so the resolver knows about
# every local checkout upfront. Without this, transitive deps
# (e.g. autogalaxy as a dep of autolens) get resolved from PyPI,
# and pip backtracks through the entire PyPI release history of
# autogalaxy looking for one whose nautilus-sampler pin matches
# the local autolens — which never matches because PyPI is stale.
optional=""
if [ "$PYTHON_VERSION" = "3.12" ]; then
optional="[optional]"
fi
# Unit tests exercise numba inversions and Zeus on every supported
# Python. Keep these outside the broad extras (tfp/dm-tree constraint).
pip install numba zeus-mcmc==2.5.4 \
-e ./PyAutoNerves \
-e "./PyAutoArray${optional}" \
-e ./PyAutoFit \
-e ./PyAutoGalaxy \
-e "./PyAutoLens${optional}"
pip install pytest pytest-cov
# Show final installed versions for diagnosis
pip list | grep -iE "^(autonerves|autoarray|autofit|autogalaxy|autolens|jax|numpy|scipy|nautilus)"
- name: Run tests
env:
NUMBA_CACHE_DIR: /tmp/numba_cache
MPLCONFIGDIR: /tmp/matplotlib
JAX_ENABLE_X64: "True"
run: |
cd ${{ matrix.project.name }}
python -m pytest ${{ matrix.project.tests }}/ --tb=short
smoke_tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.12', '3.13', '3.14']
workspace:
- { repo: PyAutoLabs/autofit_workspace, path: autofit_workspace }
- { repo: PyAutoLabs/autogalaxy_workspace, path: autogalaxy_workspace }
- { repo: PyAutoLabs/autolens_workspace, path: autolens_workspace }
env:
NUMBA_CACHE_DIR: /tmp/numba_cache
MPLCONFIGDIR: /tmp/matplotlib
JAX_ENABLE_X64: "True"
steps:
- name: Checkout Hands harness
uses: actions/checkout@v4
with:
path: PyAutoHands
- uses: actions/checkout@v4
with: { repository: PyAutoLabs/PyAutoNerves, path: PyAutoNerves }
- uses: actions/checkout@v4
with: { repository: PyAutoLabs/PyAutoArray, path: PyAutoArray }
- uses: actions/checkout@v4
with: { repository: PyAutoLabs/PyAutoFit, path: PyAutoFit }
- uses: actions/checkout@v4
with: { repository: PyAutoLabs/PyAutoGalaxy, path: PyAutoGalaxy }
- uses: actions/checkout@v4
with: { repository: PyAutoLabs/PyAutoLens, path: PyAutoLens }
- uses: actions/checkout@v4
with: { repository: "${{ matrix.workspace.repo }}", path: "${{ matrix.workspace.path }}" }
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install workspace smoke environment
env:
PYTHON_VERSION: ${{ matrix.python-version }}
WORKSPACE_PATH: ${{ matrix.workspace.path }}
run: |
python -m pip install --upgrade pip wheel
python -m pip install pyyaml
bash "$WORKSPACE_PATH/.github/scripts/smoke_install.sh"
- name: Run smoke tests
env:
WORKSPACE_PATH: ${{ matrix.workspace.path }}
PYTHONPATH: ${{ github.workspace }}/PyAutoHands/autohands
run: |
cd "$WORKSPACE_PATH"
python .github/scripts/run_smoke.py --report-dir test-results
- name: Upload smoke report
if: always()
uses: actions/upload-artifact@v4
with:
name: python-matrix-${{ matrix.workspace.path }}-${{ matrix.python-version }}
path: ${{ matrix.workspace.path }}/test-results/
if-no-files-found: warn
# PyAutoCTI (cti-upkeep phase 1). Its own jobs rather than a sixth row in
# the jobs above: autocti needs arcticpy, a source-only C++ build owned by
# PyAutoHeart's install-arcticpy action (the single home of its pin), and its
# chain is Nerves/Fit/Array only. 3.12 and 3.13 only: arcticpy does not build
# on 3.14 yet (cti-upkeep ruling R4, 2026-11-04).
cti_unit_tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.12', '3.13']
steps:
- uses: actions/checkout@v4
with: { repository: PyAutoLabs/PyAutoNerves, path: PyAutoNerves }
- uses: actions/checkout@v4
with: { repository: PyAutoLabs/PyAutoArray, path: PyAutoArray }
- uses: actions/checkout@v4
with: { repository: PyAutoLabs/PyAutoFit, path: PyAutoFit }
- uses: actions/checkout@v4
with: { repository: PyAutoLabs/PyAutoCTI, path: PyAutoCTI }
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install arcticpy (source-only C++ sdist)
uses: PyAutoLabs/PyAutoHeart/.github/actions/install-arcticpy@main
- name: Install libraries (single combined install — all 4 local)
run: |
python -m pip install --upgrade pip wheel
pip install numba \
-e ./PyAutoNerves \
-e "./PyAutoArray[optional]" \
-e ./PyAutoFit \
-e ./PyAutoCTI
pip install pytest pytest-cov
pip list | grep -iE "^(autonerves|autoarray|autofit|autocti|arcticpy|numpy|scipy)"
- name: Run tests
env:
NUMBA_CACHE_DIR: /tmp/numba_cache
MPLCONFIGDIR: /tmp/matplotlib
run: |
cd PyAutoCTI
python -m pytest test_autocti/ --tb=short
cti_smoke_tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.12', '3.13']
workspace:
- { repo: PyAutoLabs/autocti_workspace, path: autocti_workspace }
- { repo: PyAutoLabs/autocti_workspace_test, path: autocti_workspace_test }
env:
NUMBA_CACHE_DIR: /tmp/numba_cache
MPLCONFIGDIR: /tmp/matplotlib
steps:
- name: Checkout Hands harness
uses: actions/checkout@v4
with:
path: PyAutoHands
- uses: actions/checkout@v4
with: { repository: PyAutoLabs/PyAutoNerves, path: PyAutoNerves }
- uses: actions/checkout@v4
with: { repository: PyAutoLabs/PyAutoArray, path: PyAutoArray }
- uses: actions/checkout@v4
with: { repository: PyAutoLabs/PyAutoFit, path: PyAutoFit }
- uses: actions/checkout@v4
with: { repository: PyAutoLabs/PyAutoCTI, path: PyAutoCTI }
- uses: actions/checkout@v4
with: { repository: "${{ matrix.workspace.repo }}", path: "${{ matrix.workspace.path }}" }
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install arcticpy (source-only C++ sdist)
uses: PyAutoLabs/PyAutoHeart/.github/actions/install-arcticpy@main
- name: Install workspace smoke environment
env:
WORKSPACE_PATH: ${{ matrix.workspace.path }}
run: |
python -m pip install --upgrade pip wheel
python -m pip install pyyaml
bash "$WORKSPACE_PATH/.github/scripts/smoke_install.sh"
- name: Run smoke tests
env:
WORKSPACE_PATH: ${{ matrix.workspace.path }}
PYTHONPATH: ${{ github.workspace }}/PyAutoHands/autohands
run: |
cd "$WORKSPACE_PATH"
python .github/scripts/run_smoke.py --report-dir test-results
- name: Upload smoke report
if: always()
uses: actions/upload-artifact@v4
with:
name: python-matrix-${{ matrix.workspace.path }}-${{ matrix.python-version }}
path: ${{ matrix.workspace.path }}/test-results/
if-no-files-found: warn
summary:
runs-on: ubuntu-latest
needs: [unit_tests, smoke_tests, cti_unit_tests, cti_smoke_tests]
if: always()
steps:
- name: Post summary
run: |
{
echo "## Python Version Matrix Results"
echo ""
echo "| Job | Result |"
echo "|--------------|---------------------------------|"
echo "| unit_tests | ${{ needs.unit_tests.result }} |"
echo "| smoke_tests | ${{ needs.smoke_tests.result }} |"
echo "| cti_unit_tests | ${{ needs.cti_unit_tests.result }} |"
echo "| cti_smoke_tests | ${{ needs.cti_smoke_tests.result }} |"
echo ""
echo "**Required and supported:** 3.12, 3.13, 3.14 (PyAutoCTI: 3.12, 3.13 until arcticpy builds on 3.14)."
echo "**Current source metadata rejects:** Python 3.11 and older."
} >> "$GITHUB_STEP_SUMMARY"