From 4f17139d9a5f6cebe4c4668a8c6260cafdeff44c Mon Sep 17 00:00:00 2001 From: Ross Markello Date: Fri, 8 Nov 2019 10:54:24 -0500 Subject: [PATCH] [WIP,TEST,DOC] Builds docs in CircleCI (#428) * [REF] Fix up dev vs non-dev requirements.txt * [TEST] Build docs in CircleCI Also modifies the building of the py37 environment a bit since it's shared between so many things --- .circleci/config.yml | 102 ++++++++++++++++++++++++++----------------- dev_requirements.txt | 4 ++ requirements.txt | 4 -- 3 files changed, 66 insertions(+), 44 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e84694f77..6c834a581 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,6 +7,27 @@ orbs: codecov: codecov/codecov@1.0.5 jobs: + makeenv_37: + docker: + - image: continuumio/miniconda3 + working_directory: /tmp/src/tedana + steps: + - checkout + - restore_cache: + key: conda-py37-v1-{{ checksum "dev_requirements.txt" }} + - run: + name: Generate environment + command: | + if [ ! -d /opt/conda/envs/tedana_py37 ]; then + conda create -yq -n tedana_py37 python=3.7 + source activate tedana_py37 + pip install -r dev_requirements.txt + fi + - save_cache: + key: conda-py37-v1-{{ checksum "dev_requirements.txt" }} + paths: + - /opt/conda/envs/tedana_py37 + unittest_35: docker: - image: continuumio/miniconda3 @@ -18,7 +39,7 @@ jobs: - run: name: Generate environment command: | - apt-get install -y make + apt-get install -yqq make if [ ! -d /opt/conda/envs/tedana_py35 ]; then conda create -yq -n tedana_py35 python=3.5 source activate tedana_py35 @@ -51,7 +72,7 @@ jobs: - run: name: Generate environment command: | - apt-get install -y make + apt-get install -yqq make if [ ! -d /opt/conda/envs/tedana_py36 ]; then conda create -yq -n tedana_py36 python=3.6 source activate tedana_py36 @@ -81,26 +102,14 @@ jobs: - checkout - restore_cache: key: conda-py37-v1-{{ checksum "dev_requirements.txt" }} - - run: - name: Generate environment - command: | - apt-get install -y make - if [ ! -d /opt/conda/envs/tedana_py37 ]; then - conda create -yq -n tedana_py37 python=3.7 - source activate tedana_py37 - pip install -r dev_requirements.txt - fi - run: name: Running unit tests command: | - source activate tedana_py37 + apt-get install -y make + source activate tedana_py37 # depends on makeenv_37 make unittest mkdir /tmp/src/coverage mv /tmp/src/tedana/.coverage /tmp/src/coverage/.coverage.py37 - - save_cache: - key: conda-py37-v1-{{ checksum "dev_requirements.txt" }} - paths: - - /opt/conda/envs/tedana_py37 - persist_to_workspace: root: /tmp paths: @@ -114,22 +123,14 @@ jobs: - checkout - restore_cache: key: conda-py37-v1-{{ checksum "dev_requirements.txt" }} - - run: - name: Generate environment - command: | - apt-get install -y make - if [ ! -d /opt/conda/envs/tedana_py37 ]; then - conda create -yq -n tedana_py37 python=3.6 - source activate tedana_py37 - pip install -r dev_requirements.txt - fi - run: name: Style check command: | - source activate tedana_py37 + apt-get install -yqq make + source activate tedana_py37 # depends on makeenv37 make lint - integration: + build_docs: docker: - image: continuumio/miniconda3 working_directory: /tmp/src/tedana @@ -138,19 +139,30 @@ jobs: - restore_cache: key: conda-py37-v1-{{ checksum "dev_requirements.txt" }} - run: - name: Generate environment + name: Build docs command: | - apt-get install -y make - if [ ! -d /opt/conda/envs/tedana_py37 ]; then - conda create -yq -n tedana_py37 python=3.6 - source activate tedana_py37 - pip install -r dev_requirements.txt - fi + apt-get install -yqq make + source activate tedana_py37 # depends on makeenv37 + cd docs && make html doctest + mkdir /tmp/docs + mv /tmp/src/tedana/docs/_build/* /tmp/docs/ + - store_artifacts: + path: /tmp/docs + + integration: + docker: + - image: continuumio/miniconda3 + working_directory: /tmp/src/tedana + steps: + - checkout + - restore_cache: + key: conda-py37-v1-{{ checksum "dev_requirements.txt" }} - run: name: Run integration tests no_output_timeout: 40m command: | - source activate tedana_py37 + apt-get install -yqq make + source activate tedana_py37 # depends on makeenv_37 make integration mkdir /tmp/src/coverage mv /tmp/src/tedana/.coverage /tmp/src/coverage/.coverage.integration @@ -174,8 +186,8 @@ jobs: - run: name: Merge coverage files command: | - apt-get install -y curl - source activate tedana_py37 + apt-get install -yqq curl + source activate tedana_py37 # depends on makeenv37 cd /tmp/src/coverage/ coverage combine coverage xml @@ -188,11 +200,21 @@ workflows: version: 2.1 build_test: jobs: + - makeenv_37 - unittest_35 - unittest_36 - - unittest_37 - - style_check - - integration + - unittest_37: + requires: + - makeenv_37 + - style_check: + requires: + - makeenv_37 + - integration: + requires: + - makeenv_37 + - build_docs: + requires: + - makeenv_37 - merge_coverage: requires: - unittest_35 diff --git a/dev_requirements.txt b/dev_requirements.txt index 0766e720f..608d2780b 100644 --- a/dev_requirements.txt +++ b/dev_requirements.txt @@ -1,6 +1,10 @@ -r requirements.txt sphinx +sphinx-argparse +sphinx_rtd_theme coverage flake8>=3.7 +numpydoc pytest pytest-cov +requests diff --git a/requirements.txt b/requirements.txt index 23345c00b..774e8fd8e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,10 +3,6 @@ matplotlib nibabel>=2.1.0 nilearn numpy>=1.14 -numpydoc pandas -requests scikit-learn scipy -sphinx-argparse -versioneer