-
Notifications
You must be signed in to change notification settings - Fork 103
245 lines (243 loc) · 10.1 KB
/
build_windows.yml
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
name: Windows build
on:
push:
paths:
- '**'
- '!*'
- '*.py'
- '!doc/**'
- '!.github/**'
- '.github/workflows/build_windows.yml'
pull_request:
paths-ignore:
- 'doc/**'
schedule:
- cron: '0 20 * * 2'
jobs:
build:
runs-on: ${{ matrix.os }}
if: "!contains(github.event.head_commit.message, 'ci skip')"
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
python-version: "3.11"
TEST_FILES: tests/test_actionAngle.py
REQUIRES_PYNBODY: false
REQUIRES_ASTROPY: false
REQUIRES_ASTROQUERY: false
REQUIRES_NUMBA: false
REQUIRES_JAX: false
- os: windows-latest
python-version: "3.11"
TEST_FILES: tests/test_sphericaldf.py
REQUIRES_PYNBODY: false
REQUIRES_ASTROPY: false
REQUIRES_ASTROQUERY: false
REQUIRES_NUMBA: false
REQUIRES_JAX: false
- os: windows-latest
python-version: "3.11"
TEST_FILES: tests/test_conversion.py tests/test_galpypaper.py tests/test_import.py tests/test_interp_potential.py tests/test_kuzminkutuzov.py tests/test_util.py
REQUIRES_PYNBODY: false
REQUIRES_ASTROPY: false
REQUIRES_ASTROQUERY: false
REQUIRES_NUMBA: false
REQUIRES_JAX: false
- os: windows-latest
python-version: "3.11"
TEST_FILES: tests/test_SpiralArmsPotential.py tests/test_potential.py tests/test_scf.py
REQUIRES_PYNBODY: false
REQUIRES_ASTROPY: false
REQUIRES_ASTROQUERY: false
REQUIRES_NUMBA: false
REQUIRES_JAX: false
- os: windows-latest
python-version: "3.11"
TEST_FILES: tests/test_quantity.py tests/test_coords.py
REQUIRES_PYNBODY: false
# needs to be separate for different config
REQUIRES_ASTROPY: true
REQUIRES_ASTROQUERY: false
REQUIRES_NUMBA: false
REQUIRES_JAX: false
- os: windows-latest
python-version: "3.11"
TEST_FILES: tests/test_orbit.py -k test_energy_jacobi_conservation
REQUIRES_PYNBODY: false
REQUIRES_ASTROPY: true
REQUIRES_ASTROQUERY: true
REQUIRES_NUMBA: false
REQUIRES_JAX: false
- os: windows-latest
python-version: "3.11"
TEST_FILES: tests/test_orbit.py tests/test_orbits.py -k 'not test_energy_jacobi_conservation'
REQUIRES_PYNBODY: false
REQUIRES_ASTROPY: true
REQUIRES_ASTROQUERY: true
REQUIRES_NUMBA: false
REQUIRES_JAX: false
- os: windows-latest
python-version: "3.11"
TEST_FILES: tests/test_evolveddiskdf.py
REQUIRES_PYNBODY: false
REQUIRES_ASTROPY: false
REQUIRES_ASTROQUERY: false
REQUIRES_NUMBA: false
REQUIRES_JAX: false
- os: windows-latest
python-version: "3.11"
TEST_FILES: tests/test_jeans.py tests/test_dynamfric.py
REQUIRES_PYNBODY: false
REQUIRES_ASTROPY: false
REQUIRES_ASTROQUERY: false
REQUIRES_NUMBA: false
REQUIRES_JAX: false
- os: windows-latest
python-version: "3.11"
TEST_FILES: tests/test_qdf.py tests/test_pv2qdf.py tests/test_streamgapdf_impulse.py tests/test_noninertial.py
REQUIRES_PYNBODY: false
REQUIRES_ASTROPY: false
REQUIRES_ASTROQUERY: false
REQUIRES_NUMBA: false
REQUIRES_JAX: false
- os: windows-latest
python-version: "3.11"
TEST_FILES: tests/test_streamgapdf.py
REQUIRES_PYNBODY: false
REQUIRES_ASTROPY: false
REQUIRES_ASTROQUERY: false
REQUIRES_NUMBA: false
REQUIRES_JAX: false
- os: windows-latest
python-version: "3.11"
TEST_FILES: tests/test_diskdf.py
REQUIRES_PYNBODY: false
REQUIRES_ASTROPY: false
REQUIRES_ASTROQUERY: false
REQUIRES_NUMBA: false
REQUIRES_JAX: false
- os: windows-latest
python-version: "3.11"
TEST_FILES: tests/test_streamdf.py tests/test_streamspraydf.py
REQUIRES_PYNBODY: false
REQUIRES_ASTROPY: false
REQUIRES_ASTROQUERY: false
REQUIRES_NUMBA: false
REQUIRES_JAX: false
- os: windows-latest
python-version: "3.10"
TEST_FILES: tests/test_orbit.py -k test_energy_jacobi_conservation
REQUIRES_PYNBODY: false
REQUIRES_ASTROPY: true
REQUIRES_ASTROQUERY: true
REQUIRES_NUMBA: false
REQUIRES_JAX: false
- os: windows-latest
python-version: "3.10"
TEST_FILES: tests/test_orbit.py tests/test_orbits.py -k 'not test_energy_jacobi_conservation'
REQUIRES_PYNBODY: false
REQUIRES_ASTROPY: true
REQUIRES_ASTROQUERY: true
REQUIRES_NUMBA: false
REQUIRES_JAX: false
- os: windows-latest
python-version: 3.9
TEST_FILES: tests/test_orbit.py -k test_energy_jacobi_conservation
REQUIRES_PYNBODY: false
REQUIRES_ASTROPY: true
REQUIRES_ASTROQUERY: true
REQUIRES_NUMBA: false
REQUIRES_JAX: false
- os: windows-latest
python-version: 3.9
TEST_FILES: tests/test_orbit.py tests/test_orbits.py -k 'not test_energy_jacobi_conservation'
REQUIRES_PYNBODY: false
REQUIRES_ASTROPY: true
REQUIRES_ASTROQUERY: true
REQUIRES_NUMBA: false
REQUIRES_JAX: false
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
# Cache both conda and pip, conda done by setup-micromamba
- uses: actions/cache@v3
with:
path: ~\AppData\Local\pip\Cache
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('.github/workflows/build_windows.yml') }}-${{ matrix.REQUIRES_PYNBODY }}-${{ matrix.REQUIRES_ASTROPY }}-${{ matrix.REQUIRES_ASTROQUERY }}-${{ matrix.REQUIRES_NUMBA }}-${{ matrix.REQUIRES_JAX }}
# Install just the GSL using conda
- uses: mamba-org/setup-micromamba@v1
with:
environment-name: gsl
condarc: |
channels:
- conda-forge
create-args: gsl
cache-environment: true
cache-environment-key: ${{ runner.os }}-${{ hashFiles('.github/workflows/build_windows.yml') }}
- name: Set GSL environment variables
shell: bash -l {0}
run: |
echo "INCLUDE=$CONDA_PREFIX\\Library\\include" >> $GITHUB_ENV
echo "LIB=$CONDA_PREFIX\\Library\\lib" >> $GITHUB_ENV
echo "LIBPATH=$CONDA_PREFIX\\Library\\lib" >> $GITHUB_ENV
echo "$CONDA_PREFIX\\Library\\bin" >> $GITHUB_PATH # necessary when we don't activate the environment
- name: Install Python dependencies
run: |
pip install --upgrade --upgrade-strategy eager numpy scipy matplotlib numexpr setuptools cython pytest tqdm
- name: Install pynbody
if: ${{ matrix.REQUIRES_PYNBODY }}
run: |
pip install --upgrade --upgrade-strategy eager h5py pandas pytz
pip install --upgrade --upgrade-strategy eager wheel
pip install --upgrade --upgrade-strategy eager pynbody
- name: Install astropy
if: ${{ matrix.REQUIRES_ASTROPY && matrix.python-version != 4.0 }}
run: |
pip install astropy pyerfa
- name: Install astropy (Python 4.0; doesn't exist of course, placeholder for new python v)
if: ${{ matrix.REQUIRES_ASTROPY && matrix.python-version == 4.0 }}
run: |
pip install pyerfa
pip install --extra-index-url=https://pkgs.dev.azure.com/astropy-project/astropy/_packaging/nightly/pypi/simple/ --pre astropy
- name: Install astroquery
if: ${{ matrix.REQUIRES_ASTROQUERY }}
run: pip install astroquery
- name: Install numba
if: ${{ matrix.REQUIRES_NUMBA }}
run: pip install numba
- name: Install JAX
if: ${{ matrix.REQUIRES_JAX }}
run: pip install jax jaxlib
- name: Install package
run: |
python -m pip install -ve .
- name: Print debug info
shell: pwsh
env:
REQUIRES_ASTROPY : ${{ matrix.REQUIRES_ASTROPY }}
REQUIRES_ASTROQUERY : ${{ matrix.REQUIRES_ASTROQUERY }}
REQUIRES_PYNBODY : ${{ matrix.REQUIRES_PYNBODY }}
run: |
python -c "import numpy; print('numpy: {}'.format(numpy.__version__))"
python -c "import scipy; print('scipy: {}'.format(scipy.__version__))"
python -c "import matplotlib; print('matplotlib: {}'.format(matplotlib.__version__))"
if ( $REQUIRES_ASTROPY ) { python -c "import astropy; print('astropy: {}'.format(astropy.__version__))"}
if ( $REQUIRES_ASTROQUERY ) { python -c "import astroquery; print('astroquery: {}'.format(astroquery.__version__))"}
if ( $REQUIRES_PYNBODY ) {python -c "import pynbody; print('pynbody: {}'.format(pynbody.__version__))"}
- name: Test with pytest
shell: bash
env:
TEST_FILES: ${{ matrix.TEST_FILES }}
REQUIRES_ASTROPY : ${{ matrix.REQUIRES_ASTROPY }}
run: |
pip install pytest-cov
# Turn astropy deprecation warnings into errors as well if astropy
if $REQUIRES_ASTROPY; then export PYTEST_ADDOPTS="-W error::astropy.utils.exceptions.AstropyDeprecationWarning"; else export PYTEST_ADDOPTS=""; fi
export XDRLIB_DEPRECATION="-W ignore:\"'xdrlib' is deprecated and slated for removal in Python 3.13\":DeprecationWarning"
# eval necessary for -k 'not ...' in TEST_FILES
eval "pytest -W error::DeprecationWarning -W error::FutureWarning $PYTEST_ADDOPTS $XDRLIB_DEPRECATION -v $TEST_FILES --cov galpy --cov-config .coveragerc --disable-pytest-warnings --durations=0"