Skip to content

Commit de4a08c

Browse files
ricardoV94twiecki
authored andcommitted
Get rid of python-version specific conda test environments
1 parent 027f827 commit de4a08c

File tree

6 files changed

+46
-127
lines changed

6 files changed

+46
-127
lines changed

.github/workflows/tests.yml

Lines changed: 44 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ jobs:
3434
matrix:
3535
os: [ubuntu-20.04]
3636
floatx: [float64]
37+
python-version: ["3.7"]
3738
test-subset:
3839
- |
3940
pymc/tests/test_util.py
@@ -88,12 +89,12 @@ jobs:
8889
- name: Cache conda
8990
uses: actions/cache@v3
9091
env:
91-
# Increase this value to reset cache if environment-test-py37.yml has not changed
92+
# Increase this value to reset cache if environment-test.yml has not changed
9293
CACHE_NUMBER: 0
9394
with:
9495
path: ~/conda_pkgs_dir
95-
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
96-
hashFiles('conda-envs/environment-test-py37.yml') }}
96+
key: ${{ runner.os }}-py${{matrix.python-version}}-conda-${{ env.CACHE_NUMBER }}-${{
97+
hashFiles('conda-envs/environment-test.yml') }}
9798
- name: Cache multiple paths
9899
uses: actions/cache@v3
99100
env:
@@ -111,20 +112,21 @@ jobs:
111112
miniforge-variant: Mambaforge
112113
miniforge-version: latest
113114
mamba-version: "*"
114-
activate-environment: pymc-test-py37
115+
activate-environment: pymc-test
115116
channel-priority: strict
116-
environment-file: conda-envs/environment-test-py37.yml
117+
environment-file: conda-envs/environment-test.yml
118+
python-version: ${{matrix.python-version}}
117119
use-mamba: true
118120
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
119121
- name: Install-pymc
120122
run: |
121-
conda activate pymc-test-py37
123+
conda activate pymc-test
122124
pip install -e .
123125
pip install --pre -U polyagamma
124126
python --version
125127
- name: Run tests
126128
run: |
127-
conda activate pymc-test-py37
129+
conda activate pymc-test
128130
python -m pytest -vv --cov=pymc --cov-report=xml --cov-report term --durations=50 $TEST_SUBSET
129131
- name: Upload coverage to Codecov
130132
uses: codecov/codecov-action@v2
@@ -137,6 +139,7 @@ jobs:
137139
matrix:
138140
os: [windows-latest]
139141
floatx: [float64]
142+
python-version: ["3.8"]
140143
test-subset:
141144
- pymc/tests/test_variational_inference.py pymc/tests/test_initial_point.py
142145
- pymc/tests/test_pickling.py pymc/tests/test_profile.py pymc/tests/test_step.py
@@ -156,12 +159,12 @@ jobs:
156159
- name: Cache conda
157160
uses: actions/cache@v3
158161
env:
159-
# Increase this value to reset cache if conda-envs/environment-test-py38.yml has not changed
162+
# Increase this value to reset cache if conda-envs/windows-environment-test.yml has not changed
160163
CACHE_NUMBER: 0
161164
with:
162165
path: ~/conda_pkgs_dir
163-
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
164-
hashFiles('conda-envs/windows-environment-test-py38.yml') }}
166+
key: ${{ runner.os }}-py${{matrix.python-version}}-conda-${{ env.CACHE_NUMBER }}-${{
167+
hashFiles('conda-envs/windows-environment-test.yml') }}
165168
- name: Cache multiple paths
166169
uses: actions/cache@v3
167170
env:
@@ -179,22 +182,23 @@ jobs:
179182
miniforge-variant: Mambaforge
180183
miniforge-version: latest
181184
mamba-version: "*"
182-
activate-environment: pymc-test-py38
185+
activate-environment: pymc-test
183186
channel-priority: strict
184-
environment-file: conda-envs/windows-environment-test-py38.yml
187+
environment-file: conda-envs/windows-environment-test.yml
188+
python-version: ${{matrix.python-version}}
185189
use-mamba: true
186190
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
187191
- name: Install-pymc
188192
run: |
189-
conda activate pymc-test-py38
193+
conda activate pymc-test
190194
pip install -e .
191195
pip install --pre -U polyagamma
192196
python --version
193197
- name: Run tests
194198
# This job uses a cmd shell, therefore the environment variable syntax is different!
195199
# The ">-" in the next line replaces newlines with spaces (see https://stackoverflow.com/a/66809682).
196200
run: >-
197-
conda activate pymc-test-py38 &&
201+
conda activate pymc-test &&
198202
python -m pytest -vv --cov=pymc --cov-report=xml --cov-report term --durations=50 %TEST_SUBSET%
199203
- name: Upload coverage to Codecov
200204
uses: codecov/codecov-action@v2
@@ -207,6 +211,7 @@ jobs:
207211
matrix:
208212
os: [macos-latest]
209213
floatx: [float64]
214+
python-version: ["3.9"]
210215
test-subset:
211216
- |
212217
pymc/tests/test_parallel_sampling.py
@@ -232,12 +237,12 @@ jobs:
232237
- name: Cache conda
233238
uses: actions/cache@v3
234239
env:
235-
# Increase this value to reset cache if environment-test-py39.yml has not changed
240+
# Increase this value to reset cache if environment-test.yml has not changed
236241
CACHE_NUMBER: 0
237242
with:
238243
path: ~/conda_pkgs_dir
239-
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
240-
hashFiles('conda-envs/environment-test-py39.yml') }}
244+
key: ${{ runner.os }}-py${{matrix.python-version}}-conda-${{ env.CACHE_NUMBER }}-${{
245+
hashFiles('conda-envs/environment-test.yml') }}
241246
- name: Cache multiple paths
242247
uses: actions/cache@v3
243248
env:
@@ -255,14 +260,15 @@ jobs:
255260
miniforge-variant: Mambaforge
256261
miniforge-version: latest
257262
mamba-version: "*"
258-
activate-environment: pymc-test-py39
263+
activate-environment: pymc-test
259264
channel-priority: strict
260-
environment-file: conda-envs/environment-test-py39.yml
265+
environment-file: conda-envs/environment-test.yml
266+
python-version: ${{matrix.python-version}}
261267
use-mamba: true
262268
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
263269
- name: Install pymc
264270
run: |
265-
conda activate pymc-test-py39
271+
conda activate pymc-test
266272
pip install -e .
267273
python --version
268274
- name: Run tests
@@ -279,6 +285,7 @@ jobs:
279285
matrix:
280286
os: [ubuntu-20.04]
281287
floatx: [float64]
288+
python-version: ["3.9"]
282289
test-subset:
283290
- pymc/tests/test_sampling_jax.py
284291
fail-fast: false
@@ -294,12 +301,12 @@ jobs:
294301
- name: Cache conda
295302
uses: actions/cache@v3
296303
env:
297-
# Increase this value to reset cache if environment-test-py39.yml has not changed
304+
# Increase this value to reset cache if environment-test.yml has not changed
298305
CACHE_NUMBER: 0
299306
with:
300307
path: ~/conda_pkgs_dir
301-
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
302-
hashFiles('conda-envs/environment-test-py39.yml') }}
308+
key: ${{ runner.os }}-py${{matrix.python-version}}-conda-${{ env.CACHE_NUMBER }}-${{
309+
hashFiles('conda-envs/environment-test.yml') }}
303310
- name: Cache multiple paths
304311
uses: actions/cache@v3
305312
env:
@@ -317,19 +324,20 @@ jobs:
317324
miniforge-variant: Mambaforge
318325
miniforge-version: latest
319326
mamba-version: "*"
320-
activate-environment: pymc-test-py39
327+
activate-environment: pymc-test
321328
channel-priority: strict
322-
environment-file: conda-envs/environment-test-py39.yml
329+
environment-file: conda-envs/environment-test.yml
330+
python-version: ${{matrix.python-version}}
323331
use-mamba: true
324332
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
325333
- name: Install pymc
326334
run: |
327-
conda activate pymc-test-py39
335+
conda activate pymc-test
328336
pip install -e .
329337
python --version
330338
- name: Install jax specific dependencies
331339
run: |
332-
conda activate pymc-test-py39
340+
conda activate pymc-test
333341
pip install "numpyro>=0.8.0"
334342
pip install git+https://github.com/blackjax-devs/[email protected]
335343
- name: Run tests
@@ -346,6 +354,7 @@ jobs:
346354
matrix:
347355
os: [windows-latest]
348356
floatx: [float32]
357+
python-version: ["3.8"]
349358
test-subset:
350359
- pymc/tests/test_sampling.py pymc/tests/test_ode.py
351360
fail-fast: false
@@ -361,12 +370,12 @@ jobs:
361370
- name: Cache conda
362371
uses: actions/cache@v3
363372
env:
364-
# Increase this value to reset cache if conda-envs/environment-test-py38.yml has not changed
373+
# Increase this value to reset cache if conda-envs/windows-environment-test.yml has not changed
365374
CACHE_NUMBER: 0
366375
with:
367376
path: ~/conda_pkgs_dir
368-
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
369-
hashFiles('conda-envs/windows-environment-test-py38.yml') }}
377+
key: ${{ runner.os }}-py${{matrix.python-version}}-conda-${{ env.CACHE_NUMBER }}-${{
378+
hashFiles('conda-envs/windows-environment-test.yml') }}
370379
- name: Cache multiple paths
371380
uses: actions/cache@v3
372381
env:
@@ -384,22 +393,23 @@ jobs:
384393
miniforge-variant: Mambaforge
385394
miniforge-version: latest
386395
mamba-version: "*"
387-
activate-environment: pymc-test-py38
396+
activate-environment: pymc-test
388397
channel-priority: strict
389-
environment-file: conda-envs/windows-environment-test-py38.yml
398+
environment-file: conda-envs/windows-environment-test.yml
399+
python-verision: ${{matrix.python-version}}
390400
use-mamba: true
391401
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
392402
- name: Install-pymc
393403
run: |
394-
conda activate pymc-test-py38
404+
conda activate pymc-test
395405
pip install -e .
396406
pip install --pre -U polyagamma
397407
python --version
398408
- name: Run tests
399409
# This job uses a cmd shell, therefore the environment variable syntax is different!
400410
# The ">-" in the next line replaces newlines with spaces (see https://stackoverflow.com/a/66809682).
401411
run: >-
402-
conda activate pymc-test-py38 &&
412+
conda activate pymc-test &&
403413
python -m pytest -vv --cov=pymc --cov-report=xml --cov-report term --durations=50 %TEST_SUBSET%
404414
- name: Upload coverage to Codecov
405415
uses: codecov/codecov-action@v2

conda-envs/environment-test-py38.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

conda-envs/environment-test-py39.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

conda-envs/environment-test-py37.yml renamed to conda-envs/environment-test.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# "test" conda envs are used to set up our CI environment in GitHub actions
2-
name: pymc-test-py37
2+
name: pymc-test
33
channels:
44
- conda-forge
55
- defaults
@@ -18,7 +18,6 @@ dependencies:
1818
- mkl-service
1919
- numpy>=1.15.0
2020
- pandas>=0.24.0
21-
- python=3.7
2221
- python-graphviz
2322
- scipy>=1.4.1
2423
- typing-extensions>=3.7.4

conda-envs/windows-environment-test-py38.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.

conda-envs/windows-environment-test-py39.yml renamed to conda-envs/windows-environment-test.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# "test" conda envs are used to set up our CI environment in GitHub actions
2-
name: pymc-test-py39
2+
name: pymc-test
33
channels:
44
- conda-forge
55
- defaults
@@ -20,7 +20,6 @@ dependencies:
2020
- numpy>=1.15.0
2121
- pandas>=0.24.0
2222
- pip
23-
- python=3.9
2423
- python-graphviz
2524
- scipy>=1.4.1
2625
- typing-extensions>=3.7.4

0 commit comments

Comments
 (0)