Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
65 changes: 30 additions & 35 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@ docs_deploy: &docs
version: 2
jobs:
tests:
machine:
image: circleci/classic:201711-01
docker:
- image: circleci/python:3.7.6
working_directory: /tmp/tests
steps:
- checkout:
path: /tmp/src/templateflow

- restore_cache:
keys:
- deps-v6-{{ checksum "/tmp/src/templateflow/requirements.txt"}}-{{ epoch }}
- deps-v6-{{ checksum "/tmp/src/templateflow/requirements.txt"}}-
- deps-v6-
- deps-v8-{{ checksum "/tmp/src/templateflow/requirements.txt"}}-{{ epoch }}
- deps-v8-{{ checksum "/tmp/src/templateflow/requirements.txt"}}-
- deps-v8-

- run:
name: Get TemplateFlow Zip package
Expand All @@ -49,8 +49,8 @@ jobs:
- run:
name: Prepare environment
command: |
pyenv global 3.5.2
virtualenv venv
python -m venv /tmp/venv
source /tmp/venv/bin/activate
pip install -U pip
pip install -r /tmp/src/templateflow/requirements.txt
pip install "datalad ~= 0.11.8"
Expand All @@ -72,15 +72,16 @@ jobs:
git config --global user.email "email@domain.com"

- save_cache:
key: deps-v6-{{ checksum "/tmp/src/templateflow/requirements.txt"}}-{{ epoch }}
key: deps-v8-{{ checksum "/tmp/src/templateflow/requirements.txt"}}-{{ epoch }}
paths:
- "/opt/circleci/.pyenv/versions/3.5.2"
- "/tmp/data/templateflow"
- "/tmp/cache"
- "/tmp/venv"

- run:
name: Update TemplateFlow skeleton
command: |
source /tmp/venv/bin/activate
datalad install -r -s https://github.com/templateflow/templateflow $HOME/.cache/templateflow
cd $HOME/.cache/templateflow/
find . -type d -not -path "*/\.*" -exec mkdir -p /tmp/skel/{} \;
Expand All @@ -97,42 +98,37 @@ jobs:
- run:
name: Run tests (w/ DataLad)
command: |
pyenv global 3.5.2
virtualenv venv
source /tmp/venv/bin/activate
export TEMPLATEFLOW_USE_DATALAD=on
pytest --junit-xml=/tmp/tests/datalad.xml --cov templateflow --cov-report xml:/tmp/cov_api_dl.xml \
--doctest-modules /tmp/src/templateflow/templateflow/api.py

- run:
name: Submit api test coverage
command: |
source /tmp/venv/bin/activate
codecov --file /tmp/cov_api_dl.xml --root /tmp/src/templateflow \
--flags api,datalad -e CIRCLE_JOB


- run:
name: Run tests (pre-cached full TemplateFlow / no downloads)
environment:
TEMPLATEFLOW_USE_DATALAD: 0
TEMPLATEFLOW_HOME: "/tmp/data/templateflow"
command: |
pyenv global 3.5.2
virtualenv venv
source /tmp/venv/bin/activate
export TEMPLATEFLOW_HOME="/tmp/data/templateflow"
pytest --junit-xml=/tmp/tests/wodatalad.xml --cov templateflow --cov-report xml:/tmp/cov_api_cached.xml \
--doctest-modules /tmp/src/templateflow/templateflow/api.py

- run:
name: Submit api test coverage
command: |
source /tmp/venv/bin/activate
codecov --file /tmp/cov_api_cached.xml --root /tmp/src/templateflow \
--flags api,cached -e CIRCLE_JOB

- run:
name: Run tests (pulling from S3)
command: |
pyenv global 3.5.2
virtualenv venv
source /tmp/venv/bin/activate
export TEMPLATEFLOW_USE_DATALAD=off
export TEMPLATEFLOW_HOME=$HOME/templateflow-s3
pytest --junit-xml=/tmp/tests/s3.xml --cov templateflow --cov-report xml:/tmp/cov_api_s3.xml \
Expand All @@ -141,14 +137,14 @@ jobs:
- run:
name: Submit api test coverage
command: |
source /tmp/venv/bin/activate
codecov --file /tmp/cov_api_s3.xml --root /tmp/src/templateflow \
--flags api,s3 -e CIRCLE_JOB

- run:
name: Run tests (w/ DataLad, bypassed via S3)
command: |
pyenv global 3.5.2
virtualenv venv
source /tmp/venv/bin/activate
export TEMPLATEFLOW_USE_DATALAD=off
export TEMPLATEFLOW_HOME=$HOME/templateflow-clean
datalad install -r -s https://github.com/templateflow/templateflow $TEMPLATEFLOW_HOME
Expand All @@ -158,20 +154,21 @@ jobs:
- run:
name: Submit api test coverage
command: |
source /tmp/venv/bin/activate
codecov --file /tmp/cov_api_dl_s3.xml --root /tmp/src/templateflow \
--flags api,dls3 -e CIRCLE_JOB

- run:
name: Run tests (config, parameterized TEMPLATEFLOW_USE_DATALAD)
command: |
pyenv global 3.5.2
virtualenv venv
source /tmp/venv/bin/activate
pytest --junit-xml=/tmp/tests/conftests.xml --cov templateflow --cov-report xml:/tmp/cov_config.xml \
/tmp/src/templateflow/templateflow/conf/tests/test_conf.py

- run:
name: Submit config test coverage
command: |
source /tmp/venv/bin/activate
codecov --file /tmp/cov_config.xml --root /tmp/src/templateflow \
--flags config -e CIRCLE_JOB

Expand All @@ -181,8 +178,7 @@ jobs:
- run:
name: Test packaging
command: |
pyenv global 3.5.2
virtualenv venv
source /tmp/venv/bin/activate
cd /tmp/src/templateflow
python setup.py sdist
twine check dist/*
Expand Down Expand Up @@ -257,9 +253,9 @@ jobs:

- restore_cache:
keys:
- deps-v6-{{ checksum "/tmp/src/templateflow/requirements.txt"}}-{{ epoch }}
- deps-v6-{{ checksum "/tmp/src/templateflow/requirements.txt"}}-
- deps-v6-
- deps-v8-{{ checksum "/tmp/src/templateflow/requirements.txt"}}-{{ epoch }}
- deps-v8-{{ checksum "/tmp/src/templateflow/requirements.txt"}}-
- deps-v8-

- add_ssh_keys:
fingerprints:
Expand Down Expand Up @@ -300,8 +296,8 @@ jobs:
git push origin HEAD:master

deploy_pypi:
machine:
image: circleci/classic:201711-01
docker:
- image: circleci/python:3.7.6
working_directory: /tmp/src/templateflow
steps:
- attach_workspace:
Expand All @@ -312,15 +308,14 @@ jobs:

- restore_cache:
keys:
- deps-v6-{{ checksum "/tmp/src/templateflow/requirements.txt"}}-{{ epoch }}
- deps-v6-{{ checksum "/tmp/src/templateflow/requirements.txt"}}-
- deps-v6-
- deps-v8-{{ checksum "/tmp/src/templateflow/requirements.txt"}}-{{ epoch }}
- deps-v8-{{ checksum "/tmp/src/templateflow/requirements.txt"}}-
- deps-v8-

- run:
name: Deploy to PyPi
command: |
pyenv global 3.5.2
virtualenv venv
source /tmp/venv/bin/activate
pip install "setuptools>=27.0" twine
python setup.py sdist
twine check dist/*
Expand Down
10 changes: 5 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ cache:
- $HOME/.cache/pip

python:
- 3.5
- 3.6
- 3.7
- 3.8

env:
global:
Expand All @@ -31,16 +31,16 @@ matrix:
- python: 3.7
env: CHECK_TYPE="style"
allow_failures:
- python: 3.5
env: INSTALL_DEPENDS="pip==10.0.1 setuptools==30.3.0"
- python: 3.6
env: INSTALL_DEPENDS="pip==10.0.1 setuptools==30.3.0"
- python: 3.7
env: INSTALL_DEPENDS="pip==10.0.1 setuptools==30.3.0"
- python: 3.8
env: INSTALL_DEPENDS="pip==10.0.1 setuptools==30.3.0"

before_install:
- python -m pip install --upgrade $INSTALL_DEPENDS
- pip install "flake8<3.0" flake8-putty
- pip install -U flake8

install:
- |
Expand All @@ -59,7 +59,7 @@ install:
fi
- |
if [ "$CHECK_TYPE" == "style" ]; then
travis_retry pip install "flake8<3.0" flake8-putty
travis_retry pip install -U flake8
fi

script:
Expand Down
24 changes: 22 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ classifiers =
Intended Audience :: Science/Research
Topic :: Scientific/Engineering :: Image Recognition
License :: OSI Approved :: Apache Software License
Programming Language :: Python :: 3.5
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8

[options]
python_requires = >= 3.5
python_requires = >= 3.6
install_requires =
pybids >= 0.9.2
requests
Expand Down Expand Up @@ -76,3 +76,23 @@ versionfile_source = templateflow/_version.py
versionfile_build = templateflow/_version.py
tag_prefix =
parentdir_prefix =

[flake8]
max-line-length = 99
doctests = False
exclude=*build/
ignore =
W503

[tool:pytest]
norecursedirs = .git
addopts = -svx
doctest_optionflags = ALLOW_UNICODE NORMALIZE_WHITESPACE
env =
PYTHONHASHSEED=0
filterwarnings =
ignore::DeprecationWarning

[coverage:run]
branch = True

16 changes: 0 additions & 16 deletions tox.ini

This file was deleted.