Repository: nilearn/nilearn

Issue:
restore flake8 and remove unused ci scripts; merge tools and continuous_integration



Discussion:
also make sure the doctests are run (`test-doc` target in the Makefile)

Resolving patch:
diff --git a/.circleci/clean-cache.py b/.circleci/clean-cache.py
deleted file mode 100755
--- a/.circleci/clean-cache.py
+++ /dev/null
@@ -1,26 +0,0 @@
-#! /usr/bin/env python
-"""
-Flushes the cached docs for next CircleCI build.
-"""
-import os
-from datetime import datetime as dt
-
-
-def update_cache_timestamp(timestamp_filename):
-    """ Updates the contents of the docs-cache-timestamp file
-    with current timestamp.
-
-    Returns
-    -------
-    None
-    """
-    timestamp_dirpath = os.path.dirname(__file__)
-    timestamp_filepath = os.path.join(timestamp_dirpath, timestamp_filename)
-    utc_now_timestamp = dt.utcnow()
-    with open(timestamp_filepath, 'w') as write_obj:
-        write_obj.write(str(utc_now_timestamp))
-
-
-if __name__ == '__main__':
-    update_cache_timestamp('docs-cache-timestamp')
-    update_cache_timestamp('packages-cache-timestamp')
diff --git a/continuous_integration/show-python-packages-versions.py b/maint_tools/show-python-packages-versions.py
similarity index 100%
rename from continuous_integration/show-python-packages-versions.py
rename to maint_tools/show-python-packages-versions.py


Test patch:
diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml
--- a/.github/workflows/testing.yml
+++ b/.github/workflows/testing.yml
@@ -33,6 +33,8 @@ jobs:
         shell: bash
     env:
         MIN_REQUIREMENTS: true
+        FLAKE8: true
+        TEST_DOC: false
     steps:
       - uses: actions/checkout@v2
       - uses: actions/setup-python@v2
@@ -43,13 +45,13 @@ jobs:
         name: 'Display Python version'
         run: python -c "import sys; print(sys.version)"
       - shell: bash -l {0}
-        run: ./tools/github_actions_dependencies.sh
+        run: ./build_tools/github/dependencies.sh
         name: 'Install dependencies'
       - shell: bash -l {0}
-        run: ./tools/github_actions_install.sh
+        run: ./build_tools/github/install.sh
         name: 'Install nilearn'
       - shell: bash -l {0}
-        run: ./tools/github_actions_test.sh
+        run: ./build_tools/github/test.sh
         name: 'Run tests'
       - uses: codecov/codecov-action@v1
         if: success()
@@ -68,6 +70,8 @@ jobs:
     defaults:
       run:
         shell: bash
+    env:
+        TEST_DOC: true
     steps:
       - uses: actions/checkout@v2
       - uses: actions/setup-python@v2
@@ -78,13 +82,13 @@ jobs:
         name: 'Display Python version'
         run: python -c "import sys; print(sys.version)"
       - shell: bash {0}
-        run: ./tools/github_actions_dependencies.sh
+        run: ./build_tools/github/dependencies.sh
         name: 'Install dependencies'
       - shell: bash {0}
-        run: ./tools/github_actions_install.sh
+        run: ./build_tools/github/install.sh
         name: 'Install nilearn'
       - shell: bash {0}
-        run: ./tools/github_actions_test.sh
+        run: ./build_tools/github/test.sh
         name: 'Run tests'
       - uses: codecov/codecov-action@v1
         if: success()
diff --git a/build_tools/github/test.sh b/build_tools/github/test.sh
new file mode 100755
--- /dev/null
+++ b/build_tools/github/test.sh
@@ -0,0 +1,13 @@
+#!/bin/bash -x
+
+if [[ -n "$FLAKE8" ]]; then
+    echo "Running flake8 diff script...";
+    source build_tools/flake8_diff.sh
+fi
+
+python -m pytest --pyargs nilearn --cov=nilearn
+
+if [[ $TEST_DOC == true ]]; then
+    echo "Running make test-doc...";
+    make test-doc
+fi
diff --git a/continuous_integration/test_script.sh b/build_tools/travis/test_script.sh
similarity index 100%
rename from continuous_integration/test_script.sh
rename to build_tools/travis/test_script.sh
diff --git a/tools/github_actions_test.sh b/tools/github_actions_test.sh
deleted file mode 100755
--- a/tools/github_actions_test.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/bash -x
-
-python -m pytest --pyargs nilearn --cov=nilearn