Skip to content

Commit

Permalink
[TST] Test minimum versions of dependencies (#567)
Browse files Browse the repository at this point in the history
* Pin best-guess minimum versions.

* Restructure test config and add minimum reqs job.

* Be a bit more lax about minimum versions.

* Update info.py

* Add steps back in. Bad merge.

* Add matplotlib. Tests _should_ pass now.

* Somehow some of the jobs got dropped from the workflow.

* Update config.
  • Loading branch information
tsalo authored Oct 5, 2021
1 parent de0b253 commit e8814c2
Show file tree
Hide file tree
Showing 2 changed files with 98 additions and 73 deletions.
160 changes: 87 additions & 73 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
echo "Restoring environment from cache"
source activate py36_env
else
conda create -n py36_env python=3.6 numpy -yq
conda create -n py36_env python=3.6 -yq
source activate py36_env
pip install -e .[tests,doc,peaks2maps-cpu]
fi
Expand All @@ -36,7 +36,7 @@ jobs:
paths:
- "/opt/conda/envs/py36_env"

test_py38:
test_py36_minimum:
working_directory: /tmp/src/NiMARE
docker:
- image: continuumio/miniconda3
Expand All @@ -49,24 +49,41 @@ jobs:
- run: # will overwrite NiMARE installation each time
name: Generate environment
command: |
if [[ -e /opt/conda/envs/py38_env ]]; then
echo "Restoring environment from cache"
source activate py38_env
else
conda create -n py38_env python=3.8 numpy -yq
source activate py38_env
pip install pip -U
pip install -e .[tests,doc,peaks2maps-cpu]
fi
conda create -n py36_min_env python=3.6 -yq
source activate py36_min_env
pip install -e .[minimum,tests,peaks2maps-cpu]
python setup.py install --user
- run:
name: Run tests
command: |
apt-get update
apt-get install -yqq make
source activate py38_env
source activate py36_min_env
make unittest
test_py36:
working_directory: /tmp/src/NiMARE
docker:
- image: continuumio/miniconda3
steps:
- attach_workspace: # get NiMARE
at: /tmp
- restore_cache: # load environment
key: deps9-{{ checksum "nimare/info.py" }}-{{ checksum "setup.py" }}
- run:
name: Run tests
command: |
apt-get update
apt-get install -yqq make
source activate py36_env
make unittest
mkdir /tmp/src/coverage
mv /tmp/src/NiMARE/.coverage /tmp/src/coverage/.coverage.py36
- persist_to_workspace:
root: /tmp
paths:
- src/coverage/.coverage.py36

test_py37:
working_directory: /tmp/src/NiMARE
docker:
Expand All @@ -80,14 +97,9 @@ jobs:
- run: # will overwrite NiMARE installation each time
name: Generate environment
command: |
if [[ -e /opt/conda/envs/py37_env ]]; then
echo "Restoring environment from cache"
source activate py37_env
else
conda create -n py37_env python=3.7 numpy -yq
source activate py37_env
pip install -e .[tests,doc,peaks2maps-cpu]
fi
conda create -n py37_env python=3.7 -yq
source activate py37_env
pip install -e .[tests,peaks2maps-cpu]
python setup.py install --user
- run:
name: Run tests
Expand All @@ -97,66 +109,31 @@ jobs:
source activate py37_env
make unittest
build_docs:
working_directory: /tmp/src/NiMARE
docker:
- image: continuumio/miniconda3
steps:
- attach_workspace: # get NiMARE
at: /tmp
- restore_cache: # load environment
key: deps9-{{ checksum "nimare/info.py" }}-{{ checksum "setup.py" }}
- run:
name: Build documentation
command: |
source activate py36_env
apt-get update
apt-get install -yqq make
make -C docs html
no_output_timeout: 30m
- store_artifacts:
path: /tmp/src/NiMARE/docs/_build/html

style_check:
test_py38:
working_directory: /tmp/src/NiMARE
docker:
- image: continuumio/miniconda3
steps:
- attach_workspace: # get NiMARE
at: /tmp
- restore_cache: # load environment
key: deps9-{{ checksum "nimare/info.py" }}-{{ checksum "setup.py" }}
- run:
name: Linting
- checkout
- persist_to_workspace:
root: /tmp
paths:
- src/NiMARE
- run: # will overwrite NiMARE installation each time
name: Generate environment
command: |
source activate py36_env
flake8 /tmp/src/NiMARE/nimare
- store_artifacts:
path: /tmp/data/lint

test_py36:
working_directory: /tmp/src/NiMARE
docker:
- image: continuumio/miniconda3
steps:
- attach_workspace: # get NiMARE
at: /tmp
- restore_cache: # load environment
key: deps9-{{ checksum "nimare/info.py" }}-{{ checksum "setup.py" }}
conda create -n py38_env python=3.8 -yq
source activate py38_env
pip install pip -U
pip install -e .[tests,peaks2maps-cpu]
python setup.py install --user
- run:
name: Run tests
command: |
apt-get update
apt-get install -yqq make
apt-get install -yqq curl
source activate py36_env
source activate py38_env
make unittest
mkdir /tmp/src/coverage
mv /tmp/src/NiMARE/.coverage /tmp/src/coverage/.coverage.py36
- persist_to_workspace:
root: /tmp
paths:
- src/coverage/.coverage.py36
test_performance_estimators:
working_directory: /tmp/src/NiMARE
Expand All @@ -168,8 +145,7 @@ jobs:
- restore_cache: # load environment
key: deps9-{{ checksum "nimare/info.py" }}-{{ checksum "setup.py" }}
- run:
name: Test reasonable output for combinations of estimators/kernels/correctors
no_output_timeout: 30m
name: Linting
command: |
apt-get update
apt-get install -yqq make
Expand Down Expand Up @@ -254,14 +230,54 @@ jobs:
- codecov/upload:
file: /tmp/src/coverage/coverage.xml

build_docs:
working_directory: /tmp/src/NiMARE
docker:
- image: continuumio/miniconda3
steps:
- attach_workspace: # get NiMARE
at: /tmp
- restore_cache: # load environment
key: deps9-{{ checksum "nimare/info.py" }}-{{ checksum "setup.py" }}
- run:
name: Build documentation
command: |
source activate py36_env
apt-get update
apt-get install -yqq make
make -C docs html
no_output_timeout: 30m
- store_artifacts:
path: /tmp/src/NiMARE/docs/_build/html

style_check:
working_directory: /tmp/src/NiMARE
docker:
- image: continuumio/miniconda3
steps:
- attach_workspace: # get NiMARE
at: /tmp
- restore_cache: # load environment
key: deps9-{{ checksum "nimare/info.py" }}-{{ checksum "setup.py" }}
- run:
name: Linting
command: |
source activate py36_env
flake8 /tmp/src/NiMARE/nimare
- store_artifacts:
path: /tmp/data/lint

workflows:
version: 2.1
run_tests:
jobs:
- make_py36_env
- test_py36_minimum
- test_py36:
requires:
- make_py36_env
- test_py37
- test_py38
- test_performance_estimators:
requires:
- make_py36_env
Expand All @@ -271,8 +287,6 @@ workflows:
- test_performance_smoke:
requires:
- make_py36_env
- test_py37
- test_py38
- build_docs:
requires:
- make_py36_env
Expand Down
11 changes: 11 additions & 0 deletions nimare/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"cognitiveatlas",
"fuzzywuzzy",
"indexed_gzip>=1.4.0",
"matplotlib", # this is for nilearn, which doesn't include it in its reqs
"nibabel>=3.0.0",
"nilearn>=0.7.1,<0.8.0",
"numpy",
Expand Down Expand Up @@ -90,6 +91,16 @@
],
"tests": TESTS_REQUIRES,
"duecredit": ["duecredit"],
"minimum": [
"indexed_gzip==1.4",
"nibabel==3.0",
"nilearn==0.7.1",
"numpy==1.18",
"pandas==1.1",
"pymare==0.0.2",
"scikit-learn==0.22",
"scipy==1.5", # 1.6 drops Python 3.6 support
]
}

# Enable a handle to install all extra dependencies at once
Expand Down

0 comments on commit e8814c2

Please sign in to comment.