diff --git a/.circleci/config.yml b/.circleci/config.yml index 0850393a..659513af 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -24,8 +24,8 @@ 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: @@ -33,9 +33,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- - run: name: Get TemplateFlow Zip package @@ -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" @@ -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/{} \; @@ -97,8 +98,7 @@ 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 @@ -106,18 +106,14 @@ jobs: - 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 @@ -125,14 +121,14 @@ jobs: - 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 \ @@ -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 @@ -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 @@ -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/* @@ -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: @@ -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: @@ -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/* diff --git a/.travis.yml b/.travis.yml index 78de7e38..4948d50e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,9 +8,9 @@ cache: - $HOME/.cache/pip python: - - 3.5 - 3.6 - 3.7 + - 3.8 env: global: @@ -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: - | @@ -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: diff --git a/setup.cfg b/setup.cfg index 63d11b70..ba48f6fd 100644 --- a/setup.cfg +++ b/setup.cfg @@ -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 @@ -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 + diff --git a/tox.ini b/tox.ini deleted file mode 100644 index fc5dd07d..00000000 --- a/tox.ini +++ /dev/null @@ -1,16 +0,0 @@ -[flake8] -max-line-length = 99 -doctests = False -exclude=*build/ - -[pytest] -norecursedirs = .git -addopts = -svx -doctest_optionflags = ALLOW_UNICODE NORMALIZE_WHITESPACE -env = - PYTHONHASHSEED=0 -filterwarnings = - ignore::DeprecationWarning - -[coverage:run] -branch = True