-
Notifications
You must be signed in to change notification settings - Fork 1
229 lines (223 loc) · 9.45 KB
/
Copy pathpython_matrix.yml
File metadata and controls
229 lines (223 loc) · 9.45 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
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"
jobs:
unit_tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.12', '3.13']
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 }}
allow-prereleases: true
- name: Install libraries (single combined install — all 5 local)
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.
pip install \
-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
# Python 3.14 is deliberately unit-suite evidence only. The known PyAutoFit
# workspace-level factor-graph regression is tracked separately and is not
# exercised by this job. Every project gets an isolated cell, but a failure
# cannot weaken or mask the required 3.12/3.13 matrix above.
experimental_python_314:
runs-on: ubuntu-latest
continue-on-error: true
strategy:
fail-fast: false
matrix:
python-version: ['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 }}
allow-prereleases: true
- name: Install libraries (experimental 3.14 evidence)
run: |
python -m pip install --upgrade pip wheel
pip install \
-e ./PyAutoNerves \
-e "./PyAutoArray[optional]" \
-e ./PyAutoFit \
-e ./PyAutoGalaxy \
-e "./PyAutoLens[optional]"
pip install pytest pytest-cov
pip list | grep -iE "^(autonerves|autoarray|autofit|autogalaxy|autolens|jax|numpy|scipy|nautilus)"
- name: Run experimental 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
- name: Record experimental cell result
if: always()
run: |
{
echo "### Python 3.14 experimental unit evidence"
echo ""
echo "- Project: ${{ matrix.project.name }}"
echo "- Cell status before continue-on-error: ${{ job.status }}"
echo "- This cell is non-required and does not cover workspace scripts."
} >> "$GITHUB_STEP_SUMMARY"
smoke_tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.12', '3.13']
workspace:
- { repo: PyAutoLabs/autofit_workspace, path: autofit_workspace }
- { repo: PyAutoLabs/autogalaxy_workspace, path: autogalaxy_workspace }
- { repo: PyAutoLabs/autolens_workspace, path: autolens_workspace }
env:
PYAUTO_TEST_MODE: "1"
PYAUTO_SMALL_DATASETS: "1"
PYAUTO_FAST_PLOTS: "1"
NUMBA_CACHE_DIR: /tmp/numba_cache
MPLCONFIGDIR: /tmp/matplotlib
JAX_ENABLE_X64: "True"
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/checkout@v4
with: { repository: "${{ matrix.workspace.repo }}", path: "${{ matrix.workspace.path }}" }
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Install libraries (single combined install — all 5 local)
run: |
python -m pip install --upgrade pip wheel
pip install \
-e ./PyAutoNerves \
-e "./PyAutoArray[optional]" \
-e "./PyAutoFit[optional]" \
-e ./PyAutoGalaxy \
-e "./PyAutoLens[optional]"
pip install numba
pip list | grep -iE "^(autonerves|autoarray|autofit|autogalaxy|autolens|jax|numpy|scipy|nautilus)"
- name: Run smoke tests
run: |
cd ${{ matrix.workspace.path }}
if [ ! -f smoke_tests.txt ]; then
echo "No smoke_tests.txt found in ${{ matrix.workspace.path }} -- skipping"
exit 0
fi
fail=0
while IFS= read -r script || [ -n "$script" ]; do
[ -z "$script" ] && continue
case "$script" in \#*) continue ;; esac
echo "::group::$script"
if python "scripts/$script"; then
echo "PASS: $script"
else
echo "FAIL: $script"
fail=$((fail + 1))
fi
echo "::endgroup::"
done < smoke_tests.txt
if [ "$fail" -gt 0 ]; then
echo "$fail smoke test(s) failed"
exit 1
fi
summary:
runs-on: ubuntu-latest
needs: [unit_tests, smoke_tests, experimental_python_314]
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 "| python_314 (non-required job conclusion) | ${{ needs.experimental_python_314.result }} |"
echo ""
echo "Each 3.14 matrix cell records its pre-continue-on-error status"
echo "in that cell's summary; the aggregate conclusion may be coerced"
echo "to success by GitHub's job-level continue-on-error semantics."
echo ""
echo "**Required and supported:** 3.12, 3.13."
echo "**Experimental evidence (non-required):** 3.14."
echo "**Current source metadata rejects:** Python 3.11 and older."
} >> "$GITHUB_STEP_SUMMARY"