Skip to content

Test on oldest supported versions during end-to-end CI #4374

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Jan 5, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/arviz_compat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ jobs:
- name: Cache conda
uses: actions/cache@v1
env:
# Increase this value to reset cache if environment-dev-py38.yml has not changed
# Increase this value to reset cache if environment-dev-py39.yml has not changed
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
hashFiles('conda-envs/environment-dev-py38.yml') }}
hashFiles('conda-envs/environment-dev-py39.yml') }}
- name: Cache multiple paths
uses: actions/cache@v2
env:
Expand All @@ -47,18 +47,18 @@ jobs:
hashFiles('requirements.txt') }}
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: pymc3-dev-py38
activate-environment: pymc3-dev-py39
channel-priority: strict
environment-file: conda-envs/environment-dev-py38.yml
environment-file: conda-envs/environment-dev-py39.yml
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
- name: Install pymc3
run: |
conda activate pymc3-dev-py38
conda activate pymc3-dev-py39
pip install -e .
python --version
- name: Install latest arviz
run: |
conda activate pymc3-dev-py38
conda activate pymc3-dev-py39
pip uninstall arviz -y
pip install git+git://github.com/arviz-devs/arviz.git
- name: Run tests
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,12 @@ jobs:
- name: Cache conda
uses: actions/cache@v1
env:
# Increase this value to reset cache if environment-dev-py39.yml has not changed
# Increase this value to reset cache if environment-dev-py37.yml has not changed
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
hashFiles('conda-envs/environment-dev-py39.yml') }}
hashFiles('conda-envs/environment-dev-py37.yml') }}
- name: Cache multiple paths
uses: actions/cache@v2
env:
Expand All @@ -90,18 +90,18 @@ jobs:
hashFiles('requirements.txt') }}
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: pymc3-dev-py39
activate-environment: pymc3-dev-py37
channel-priority: strict
environment-file: conda-envs/environment-dev-py39.yml
environment-file: conda-envs/environment-dev-py37.yml
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
- name: Install-pymc3
run: |
conda activate pymc3-dev-py39
conda activate pymc3-dev-py37
pip install -e .
python --version
- name: Run tests
run: |
conda activate pymc3-dev-py39
conda activate pymc3-dev-py37
python -m pytest -vv --cov=pymc3 --cov-report=xml --cov-report term --durations=50 $TEST_SUBSET
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ jobs:
- name: Cache conda
uses: actions/cache@v1
env:
# Increase this value to reset cache if conda-envs/environment-dev-py37.yml has not changed
# Increase this value to reset cache if conda-envs/environment-dev-py38.yml has not changed
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
hashFiles('conda-envs/environment-dev-py37.yml') }}
hashFiles('conda-envs/environment-dev-py38.yml') }}
- name: Cache multiple paths
uses: actions/cache@v2
env:
Expand All @@ -46,15 +46,15 @@ jobs:
hashFiles('requirements.txt') }}
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: pymc3-dev-py37
activate-environment: pymc3-dev-py38
channel-priority: strict
environment-file: conda-envs/environment-dev-py37.yml
environment-file: conda-envs/environment-dev-py38.yml
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
- name: Install-pymc3
run: |
conda activate pymc3-dev-py37
conda activate pymc3-dev-py38
pip install -e .
python --version
- run: |
conda activate pymc3-dev-py37
conda activate pymc3-dev-py38
python -m pytest -vv --cov=pymc3 --cov-report=xml --cov-report term --durations=50 $TEST_SUBSET
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ repos:
name: Check no tests are ignored
pass_filenames: false
- id: conda-env-sort
additional_dependencies: [pyyaml]
additional_dependencies: [ruamel.yaml]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ruamel.yaml preserves comments (which pyyaml destroys) so switching to that

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will do this in a separate PR

entry: python scripts/sort_conda_envs.py
files: ^conda-envs/
language: python
Expand All @@ -51,7 +51,7 @@ repos:
- id: pip-from-conda
additional_dependencies: [pyyaml]
entry: python scripts/generate_pip_deps_from_conda.py
files: ^conda-envs/
files: ^conda-envs/environment-dev-py37\.yml$
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's probably a good idea to have some CI jobs run with different versions of packages, to check PyMC3 works both with the oldest and with the newest versions of its dependencies. So, requirements-dev.txt now has to be generated from just one yml file

language: python
name: Generate pip dependency from conda
- id: no-relative-imports
Expand Down
1 change: 1 addition & 0 deletions conda-envs/environment-dev-py37.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ dependencies:
- libblas=*=*mkl
- mkl-service
- nbsphinx>=0.4
- numpy=1.13.0
- numpydoc>=0.9
- pre-commit>=2.8.0
- pytest-cov>=2.5
Expand Down
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
h5py>=2.7
ipython>=7.16
nbsphinx>=0.4
numpy==1.13.0
numpydoc>=0.9
pre-commit>=2.8.0
pytest-cov>=2.5
Expand Down
29 changes: 19 additions & 10 deletions scripts/sort_conda_envs.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,24 @@

import argparse

import yaml
from pathlib import Path
from typing import Optional, Sequence

if __name__ == "__main__":
import ruamel.yaml

yaml = ruamel.yaml.YAML()


def main(argv: Optional[Sequence[str]] = None) -> None:
"""Sort dependencies in conda environment files."""
parser = argparse.ArgumentParser()
parser.add_argument("files", nargs="*")
args = parser.parse_args()
for file_ in args.files:
with open(file_) as fd:
doc = yaml.safe_load(fd)
doc["dependencies"].sort()
with open(file_, "w") as fd:
yaml.dump(doc, fd, sort_keys=False)
parser.add_argument("paths", nargs="*", type=Path)
args = parser.parse_args(argv)
for path in args.paths:
doc = yaml.load(path)
doc["dependencies"].sort()
yaml.dump(doc, path)


if __name__ == "__main__":
main()
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,5 +85,4 @@ def get_version():
python_requires=">=3.7",
install_requires=install_reqs,
tests_require=test_reqs,
test_suite="nose.collector",
)