Skip to content

Commit 34b05d8

Browse files
authored
Test on oldest supported versions during end-to-end CI (#4374)
* test on oldest supported versions during end-to-end CI * less strict pin * try 1.15 pin * try pinning pandas and scipy too * only test betabinom if scipy modern enough * revert sort_conda changes (will do in separate PR) * generate requirements-dev from py37 env
1 parent aabec02 commit 34b05d8

File tree

9 files changed

+34
-24
lines changed

9 files changed

+34
-24
lines changed

.codecov.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
codecov:
22
require_ci_to_pass: no
33
notify:
4-
after_n_builds: 9
4+
after_n_builds: 16
55

66
coverage:
77
precision: 2

.github/workflows/arviz_compat.yml

+7-6
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ jobs:
1212
os: [ubuntu-latest, macos-latest]
1313
floatx: [float64]
1414
test-subset:
15+
- pymc3/tests/test_distributions.py
1516
- pymc3/tests/test_distributions_random.py
1617
- pymc3/tests/test_sampling.py
1718
fail-fast: false
@@ -27,12 +28,12 @@ jobs:
2728
- name: Cache conda
2829
uses: actions/cache@v1
2930
env:
30-
# Increase this value to reset cache if environment-dev-py38.yml has not changed
31+
# Increase this value to reset cache if environment-dev-py39.yml has not changed
3132
CACHE_NUMBER: 0
3233
with:
3334
path: ~/conda_pkgs_dir
3435
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
35-
hashFiles('conda-envs/environment-dev-py38.yml') }}
36+
hashFiles('conda-envs/environment-dev-py39.yml') }}
3637
- name: Cache multiple paths
3738
uses: actions/cache@v2
3839
env:
@@ -47,18 +48,18 @@ jobs:
4748
hashFiles('requirements.txt') }}
4849
- uses: conda-incubator/setup-miniconda@v2
4950
with:
50-
activate-environment: pymc3-dev-py38
51+
activate-environment: pymc3-dev-py39
5152
channel-priority: strict
52-
environment-file: conda-envs/environment-dev-py38.yml
53+
environment-file: conda-envs/environment-dev-py39.yml
5354
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
5455
- name: Install pymc3
5556
run: |
56-
conda activate pymc3-dev-py38
57+
conda activate pymc3-dev-py39
5758
pip install -e .
5859
python --version
5960
- name: Install latest arviz
6061
run: |
61-
conda activate pymc3-dev-py38
62+
conda activate pymc3-dev-py39
6263
pip uninstall arviz -y
6364
pip install git+git://github.com/arviz-devs/arviz.git
6465
- name: Run tests

.github/workflows/pytest.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,12 @@ jobs:
7070
- name: Cache conda
7171
uses: actions/cache@v1
7272
env:
73-
# Increase this value to reset cache if environment-dev-py39.yml has not changed
73+
# Increase this value to reset cache if environment-dev-py37.yml has not changed
7474
CACHE_NUMBER: 0
7575
with:
7676
path: ~/conda_pkgs_dir
7777
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
78-
hashFiles('conda-envs/environment-dev-py39.yml') }}
78+
hashFiles('conda-envs/environment-dev-py37.yml') }}
7979
- name: Cache multiple paths
8080
uses: actions/cache@v2
8181
env:
@@ -90,18 +90,18 @@ jobs:
9090
hashFiles('requirements.txt') }}
9191
- uses: conda-incubator/setup-miniconda@v2
9292
with:
93-
activate-environment: pymc3-dev-py39
93+
activate-environment: pymc3-dev-py37
9494
channel-priority: strict
95-
environment-file: conda-envs/environment-dev-py39.yml
95+
environment-file: conda-envs/environment-dev-py37.yml
9696
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
9797
- name: Install-pymc3
9898
run: |
99-
conda activate pymc3-dev-py39
99+
conda activate pymc3-dev-py37
100100
pip install -e .
101101
python --version
102102
- name: Run tests
103103
run: |
104-
conda activate pymc3-dev-py39
104+
conda activate pymc3-dev-py37
105105
python -m pytest -vv --cov=pymc3 --cov-report=xml --cov-report term --durations=50 $TEST_SUBSET
106106
- name: Upload coverage to Codecov
107107
uses: codecov/codecov-action@v1

.github/workflows/windows.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ jobs:
2626
- name: Cache conda
2727
uses: actions/cache@v1
2828
env:
29-
# Increase this value to reset cache if conda-envs/environment-dev-py37.yml has not changed
29+
# Increase this value to reset cache if conda-envs/environment-dev-py38.yml has not changed
3030
CACHE_NUMBER: 0
3131
with:
3232
path: ~/conda_pkgs_dir
3333
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
34-
hashFiles('conda-envs/environment-dev-py37.yml') }}
34+
hashFiles('conda-envs/environment-dev-py38.yml') }}
3535
- name: Cache multiple paths
3636
uses: actions/cache@v2
3737
env:
@@ -46,15 +46,15 @@ jobs:
4646
hashFiles('requirements.txt') }}
4747
- uses: conda-incubator/setup-miniconda@v2
4848
with:
49-
activate-environment: pymc3-dev-py37
49+
activate-environment: pymc3-dev-py38
5050
channel-priority: strict
51-
environment-file: conda-envs/environment-dev-py37.yml
51+
environment-file: conda-envs/environment-dev-py38.yml
5252
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
5353
- name: Install-pymc3
5454
run: |
55-
conda activate pymc3-dev-py37
55+
conda activate pymc3-dev-py38
5656
pip install -e .
5757
python --version
5858
- run: |
59-
conda activate pymc3-dev-py37
59+
conda activate pymc3-dev-py38
6060
python -m pytest -vv --cov=pymc3 --cov-report=xml --cov-report term --durations=50 $TEST_SUBSET

.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ repos:
4444
- id: conda-env-sort
4545
additional_dependencies: [pyyaml]
4646
entry: python scripts/sort_conda_envs.py
47-
files: ^conda-envs/
47+
files: ^conda-envs/environment-dev-py37\.yml$
4848
language: python
4949
name: Sort dependencies in conda envs
5050
types: [yaml]

conda-envs/environment-dev-py37.yml

+3
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,16 @@ dependencies:
88
- libblas=*=*mkl
99
- mkl-service
1010
- nbsphinx>=0.4
11+
- numpy=1.15
1112
- numpydoc>=0.9
13+
- pandas=0.24
1214
- pre-commit>=2.8.0
1315
- pytest-cov>=2.5
1416
- pytest>=3.0
1517
- python-graphviz
1618
- python=3.7
1719
- recommonmark>=0.4
20+
- scipy=1.2
1821
- sphinx-autobuild>=0.7
1922
- sphinx>=1.5
2023
- watermark

pymc3/tests/test_distributions.py

+7
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525

2626
from numpy import array, exp, inf, log
2727
from numpy.testing import assert_allclose, assert_almost_equal, assert_equal
28+
from packaging.version import parse
29+
from scipy import __version__ as scipy_version
2830
from scipy import integrate
2931
from scipy.special import erf, logit
3032

@@ -97,6 +99,8 @@
9799
from pymc3.theanof import floatX
98100
from pymc3.vartypes import continuous_types
99101

102+
SCIPY_VERSION = parse(scipy_version)
103+
100104

101105
def get_lkj_cases():
102106
"""
@@ -1163,6 +1167,9 @@ def test_binomial(self):
11631167

11641168
# Too lazy to propagate decimal parameter through the whole chain of deps
11651169
@pytest.mark.xfail(condition=(theano.config.floatX == "float32"), reason="Fails on float32")
1170+
@pytest.mark.xfail(
1171+
condition=(SCIPY_VERSION < parse("1.4.0")), reason="betabinom is new in Scipy 1.4.0"
1172+
)
11661173
def test_beta_binomial(self):
11671174
self.checkd(
11681175
BetaBinomial,

requirements.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
arviz>=0.9.0
22
dill
33
fastprogress>=0.2.0
4-
numpy>=1.13.0
5-
pandas>=0.18.0
4+
numpy>=1.15.0
5+
pandas>=0.24.0
66
patsy>=0.5.1
7-
scipy>=0.18.1
7+
scipy>=1.2.0
88
theano-pymc==1.0.14
99
typing-extensions>=3.7.4

setup.py

-1
Original file line numberDiff line numberDiff line change
@@ -85,5 +85,4 @@ def get_version():
8585
python_requires=">=3.7",
8686
install_requires=install_reqs,
8787
tests_require=test_reqs,
88-
test_suite="nose.collector",
8988
)

0 commit comments

Comments
 (0)