Repository: autoreject/autoreject (language: python)

Issue:
Run CI regularly and concurrently, fix deletion of projections
running the circleci build job regularly will ensure that the "dev docs" are always available as circleci build artifacts. Else CircleCi will delete them after some time and they become unavailable, see https://github.com/autoreject/autoreject/issues/246#issuecomment-971534484


There are some unrelated test failures probably due to upstream changes in MNE. I added a change that now also runs the test suite (not just docs build) regularly, so that such issues can be caught earlier.


Discussion / hints:
We have the old problem of CircleCI build timing out after 1 hour of running. The examples just take way too long to run unfortunately. cc @jasmainak @agramfort 
@sappelhoff looks like CircleCI changed their pricing plan/model. I'll look into this

Could we do this in the old fashioned way where we have a dropdown? I fear this CircleCI method is not sustainable or discoverable. Have had the issue where many people didn't realize that the dev docs exist because they didn't go via the readme page
> Could we do this in the old fashioned way where we have a dropdown? I fear this CircleCI method is not sustainable or discoverable. Have had the issue where many people didn't realize that the dev docs exist because they didn't go via the readme page

yeah we should do a dropdown as discussed in #228 and #234 ... but that'd take about one hour and some brain capacity :-)

this PR was 10 minutes and no brain capacity so I thought I quickly contribute it
> @sappelhoff looks like CircleCI changed their pricing plan/model. I'll look into this

Seems like it :|

I found the info here: https://circleci.com/docs/2.0/configuration-reference/#jobs

> Note: Jobs have a maximum runtime of 1 (Free), 3 (Performance), or 5 (Scale) hours depending on pricing plan. If your jobs are timing out, consider upgrading your pricing plan or running some of them concurrently using workflows.

so we need to:

- speed up the examples (e.g., fewer channels, or epochs, ...)
- use circleci "concurrency" in whatever way
- or both

Do you think that could be done in a separate PR? I don't think I have the time to do it here, and this PR at least contains some fixes
Ok, I know I just said above that I can't do it, but I think the way to go is to split up the CircleCI jobs into:

1. setup
2. build example 1
3. build example 2
4. build example N
5. finish

"setup" restores the cache, installs python, downloads data

each of the **"build example N"** "circleci Jobs" run `PATTERN=<REGEX_TO_SELECT_MY_TUTORIAL> make html_dev-pattern` with a specific `REGEX_TO_SELECT_MY_TUTORIAL`

finish then gets all the output from previous jobs and builds the docs --> making use of the already executed examples ... then the artifact is uploaded.

I hope this works ...

See also:

- https://circleci.com/blog/persisting-data-in-workflows-when-to-use-caching-artifacts-and-workspaces/
- https://circleci.com/blog/decrease-your-build-times-by-running-jobs-in-parallel-with-workflows/
@sappelhoff just so I understand correctly, in the "finish" step you have all the artifacts, so theoretically I could take the outputs from this step and push to a dev folder in autoreject.github.io ? Just so I know I don't have to change things too much when I make the PR for that
> just so I understand correctly, in the "finish" step you have all the artifacts, so theoretically I could take the outputs from this step and push to a dev folder in autoreject.github.io ? Just so I know I don't have to change things too much when I make the PR for that

yes :-) from the outside, nothing really changes --> the "finish" step will have the same artifacts that are currently held by the "build" step

all I am doing is computing each example in a separate job, in parallel ... and then stitching them together in the "finish" job.

it's just a small debugging hell, as expected - but I think it will work and speed up circleci by a lot
I can see you are having fun ;-)

also, do we start from a clean slate with each job. I'm worried that if there is a cache from previous job, it might cause debugging issues. I'd rather build every example in every pull request rather than trying to intelligently figure which examples changed (like MNE does). The lower the maintenance burden the better. 
> also, do we start from a clean slate with each job. I'm worried that if there is a cache from previous job, it might cause debugging issues. I'd rather build every example in every pull request rather than trying to intelligently figure which examples changed (like MNE does). The lower the maintenance burden the better.

yes, each circleci run will fully run each example and if one example is broken, I expect the "docbuild-N" job (for the nth example) AND the "final" job to fail. It's just that in "final", no example will be actually run --> "final" will restore caches from the different "docbuild" jobs and then realize there is no need to build something and just stitch it together, producing the artifact
# [Codecov](https://codecov.io/gh/autoreject/autoreject/pull/247?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=autoreject) Report
> Merging [#247](https://codecov.io/gh/autoreject/autoreject/pull/247?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=autoreject) (a73333c) into [master](https://codecov.io/gh/autoreject/autoreject/commit/f8c929ac8f7c68903bdea054a0891928859fa9d7?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=autoreject) (f8c929a) will **not change** coverage.
> The diff coverage is `n/a`.

> :exclamation: Current head a73333c differs from pull request most recent head 88ee983. Consider uploading reports for the commit 88ee983 to get more accurate results
[![Impacted file tree graph](https://codecov.io/gh/autoreject/autoreject/pull/247/graphs/tree.svg?width=650&height=150&src=pr&token=8RrtRhgFdv&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=autoreject)](https://codecov.io/gh/autoreject/autoreject/pull/247?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=autoreject)

```diff
@@           Coverage Diff           @@
##           master     #247   +/-   ##
=======================================
  Coverage   96.51%   96.51%           
=======================================
  Files           5        5           
  Lines         918      918           
=======================================
  Hits          886      886           
  Misses         32       32           
```



------

[Continue to review full report at Codecov](https://codecov.io/gh/autoreject/autoreject/pull/247?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=autoreject).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=autoreject)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/autoreject/autoreject/pull/247?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=autoreject). Last update [ece5657...88ee983](https://codecov.io/gh/autoreject/autoreject/pull/247?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=autoreject). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=autoreject).

This is very nice, thanks @sappelhoff ! :-) Saves me the pain of having to decide which examples need to be shortened
I am happy that it works now :sunglasses: 

Fix patch:
diff --git a/.circleci/config.yml b/.circleci/config.yml
index dc11e5a1..b5e4b8d3 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -1,17 +1,12 @@
-# For an explanation of the workflow here, see:
-# https://github.com/autoreject/autoreject/pull/247#issuecomment-973069510
 version: 2.1
 jobs:
-    setup:
+    build:
         machine:
             image: ubuntu-2004:202111-01
         steps:
             - checkout
             - restore_cache:
                 keys:
-                  # restore cache from last build. Unless __init__.py or setup.py have changed since then
-                  # bump the "X" in the "vX" part from data-cache-vX-* to update cache if needed without
-                  # changing __init__.py or setup.py
                   - data-cache-v0-{{ checksum "./autoreject/__init__.py" }}-{{ checksum "setup.py" }}
             - run:
                 name: Setup python3 environment
@@ -20,7 +15,6 @@ jobs:
                     echo "source /home/circleci/autoreject_env/bin/activate" >> $BASH_ENV
             - run:
                 name: Install packages
-                # setuptools, wheel, psutil not strictly needed
                 command: |
                     python3 -m pip install --progress-bar off --upgrade pip setuptools wheel psutil
                     python3 -m pip install --progress-bar off -e .[full]
@@ -39,211 +33,6 @@ jobs:
                 name: Download MNE sample data
                 command: |
                   python3 -c "import mne; mne.datasets.sample.data_path()"
-            - persist_to_workspace:
-                root: ~/
-                paths:
-                  - autoreject_env
-                  - .mne
-                  - mne_data/MNE-sample-data
-                  - project
-    docbuild1:
-        machine:
-            image: ubuntu-2004:202111-01
-        steps:
-            - attach_workspace:
-                at: ~/
-            - run:
-                name: activate python3 environment
-                command: echo "source /home/circleci/autoreject_env/bin/activate" >> $BASH_ENV
-            - run:
-                name: Build example plot_auto_repair
-                command: |
-                  cd ~/project/doc
-                  PATTERN=plot_auto_repair make html_dev-pattern
-                no_output_timeout: 2h
-            - save_cache:
-                key: docbuild1-{{ .Branch }}-{{ epoch }}
-                paths:
-                  - ~/project/doc/auto_examples/plot_auto_repair.ipynb
-                  - ~/project/doc/auto_examples/plot_auto_repair.py
-                  - ~/project/doc/auto_examples/plot_auto_repair.py.md5
-                  - ~/project/doc/auto_examples/plot_auto_repair_codeobj.pickle
-                  - ~/project/doc/auto_examples/plot_auto_repair.rst
-                  - ~/project/doc/auto_examples/images/
-    docbuild2:
-        machine:
-            image: ubuntu-2004:202111-01
-        steps:
-            - attach_workspace:
-                at: ~/
-            - run:
-                name: activate python3 environment
-                command: echo "source /home/circleci/autoreject_env/bin/activate" >> $BASH_ENV
-            - run:
-                name: Build example plot_autoreject_workflow
-                command: |
-                  cd ~/project/doc
-                  PATTERN=plot_autoreject_workflow make html_dev-pattern
-                no_output_timeout: 2h
-            - save_cache:
-                key: docbuild2-{{ .Branch }}-{{ epoch }}
-                paths:
-                  - ~/project/doc/auto_examples/plot_autoreject_workflow.ipynb
-                  - ~/project/doc/auto_examples/plot_autoreject_workflow.py
-                  - ~/project/doc/auto_examples/plot_autoreject_workflow.py.md5
-                  - ~/project/doc/auto_examples/plot_autoreject_workflow.pickle
-                  - ~/project/doc/auto_examples/plot_autoreject_workflow.rst
-                  - ~/project/doc/auto_examples/images/
-    docbuild3:
-        machine:
-            image: ubuntu-2004:202111-01
-        steps:
-            - attach_workspace:
-                at: ~/
-            - run:
-                name: activate python3 environment
-                command: echo "source /home/circleci/autoreject_env/bin/activate" >> $BASH_ENV
-            - run:
-                name: Build example plot_channel_thresholds
-                command: |
-                  cd ~/project/doc
-                  PATTERN=plot_channel_thresholds make html_dev-pattern
-                no_output_timeout: 2h
-            - save_cache:
-                key: docbuild3-{{ .Branch }}-{{ epoch }}
-                paths:
-                  - ~/project/doc/auto_examples/plot_channel_thresholds.ipynb
-                  - ~/project/doc/auto_examples/plot_channel_thresholds.py
-                  - ~/project/doc/auto_examples/plot_channel_thresholds.py.md5
-                  - ~/project/doc/auto_examples/plot_channel_thresholds.pickle
-                  - ~/project/doc/auto_examples/plot_channel_thresholds.rst
-                  - ~/project/doc/auto_examples/images/
-    docbuild4:
-        machine:
-            image: ubuntu-2004:202111-01
-        steps:
-            - attach_workspace:
-                at: ~/
-            - run:
-                name: activate python3 environment
-                command: echo "source /home/circleci/autoreject_env/bin/activate" >> $BASH_ENV
-            - run:
-                name: Build example plot_estimate_global_reject
-                command: |
-                  cd ~/project/doc
-                  PATTERN=plot_estimate_global_reject make html_dev-pattern
-                no_output_timeout: 2h
-            - save_cache:
-                key: docbuild4-{{ .Branch }}-{{ epoch }}
-                paths:
-                  - ~/project/doc/auto_examples/plot_estimate_global_reject.ipynb
-                  - ~/project/doc/auto_examples/plot_estimate_global_reject.py
-                  - ~/project/doc/auto_examples/plot_estimate_global_reject.py.md5
-                  - ~/project/doc/auto_examples/plot_estimate_global_reject.pickle
-                  - ~/project/doc/auto_examples/plot_estimate_global_reject.rst
-                  - ~/project/doc/auto_examples/images/
-    docbuild5:
-        machine:
-            image: ubuntu-2004:202111-01
-        steps:
-            - attach_workspace:
-                at: ~/
-            - run:
-                name: activate python3 environment
-                command: echo "source /home/circleci/autoreject_env/bin/activate" >> $BASH_ENV
-            - run:
-                name: Build example plot_global_reject
-                command: |
-                  cd ~/project/doc
-                  PATTERN=plot_global_reject make html_dev-pattern
-                no_output_timeout: 2h
-            - save_cache:
-                key: docbuild5-{{ .Branch }}-{{ epoch }}
-                paths:
-                  - ~/project/doc/auto_examples/plot_global_reject.ipynb
-                  - ~/project/doc/auto_examples/plot_global_reject.py
-                  - ~/project/doc/auto_examples/plot_global_reject.py.md5
-                  - ~/project/doc/auto_examples/plot_global_reject.pickle
-                  - ~/project/doc/auto_examples/plot_global_reject.rst
-                  - ~/project/doc/auto_examples/images/
-    docbuild6:
-        machine:
-            image: ubuntu-2004:202111-01
-        steps:
-            - attach_workspace:
-                at: ~/
-            - run:
-                name: activate python3 environment
-                command: echo "source /home/circleci/autoreject_env/bin/activate" >> $BASH_ENV
-            - run:
-                name: Build example plot_ransac
-                command: |
-                  cd ~/project/doc
-                  PATTERN=plot_ransac make html_dev-pattern
-                no_output_timeout: 2h
-            - save_cache:
-                key: docbuild6-{{ .Branch }}-{{ epoch }}
-                paths:
-                  - ~/project/doc/auto_examples/plot_ransac.ipynb
-                  - ~/project/doc/auto_examples/plot_ransac.py
-                  - ~/project/doc/auto_examples/plot_ransac.py.md5
-                  - ~/project/doc/auto_examples/plot_ransac.pickle
-                  - ~/project/doc/auto_examples/plot_ransac.rst
-                  - ~/project/doc/auto_examples/images/
-    docbuild7:
-        machine:
-            image: ubuntu-2004:202111-01
-        steps:
-            - attach_workspace:
-                at: ~/
-            - run:
-                name: activate python3 environment
-                command: echo "source /home/circleci/autoreject_env/bin/activate" >> $BASH_ENV
-            - run:
-                name: Build example plot_visualize_bad_epochs
-                command: |
-                  cd ~/project/doc
-                  PATTERN=plot_visualize_bad_epochs make html_dev-pattern
-                no_output_timeout: 2h
-            - save_cache:
-                key: docbuild7-{{ .Branch }}-{{ epoch }}
-                paths:
-                  - ~/project/doc/auto_examples/plot_visualize_bad_epochs.ipynb
-                  - ~/project/doc/auto_examples/plot_visualize_bad_epochs.py
-                  - ~/project/doc/auto_examples/plot_visualize_bad_epochs.py.md5
-                  - ~/project/doc/auto_examples/plot_visualize_bad_epochs.pickle
-                  - ~/project/doc/auto_examples/plot_visualize_bad_epochs.rst
-                  - ~/project/doc/auto_examples/images/
-    finish:
-        machine:
-            image: ubuntu-2004:202111-01
-        steps:
-            - attach_workspace:
-                at: ~/
-            - run:
-                name: activate python3 environment
-                command: echo "source /home/circleci/autoreject_env/bin/activate" >> $BASH_ENV
-            - restore_cache:
-                keys:
-                  - docbuild1
-            - restore_cache:
-                keys:
-                  - docbuild2
-            - restore_cache:
-                keys:
-                  - docbuild3
-            - restore_cache:
-                keys:
-                  - docbuild4
-            - restore_cache:
-                keys:
-                  - docbuild5
-            - restore_cache:
-                keys:
-                  - docbuild6
-            - restore_cache:
-                keys:
-                  - docbuild7
             - run:
                 name: Build the documentation
                 command: |
@@ -263,74 +52,11 @@ jobs:
 workflows:
   commit:
     jobs:
-      - setup
-      - docbuild1:
-          requires:
-            - setup
-      - docbuild2:
-          requires:
-            - setup
-      - docbuild3:
-          requires:
-            - setup
-      - docbuild4:
-          requires:
-            - setup
-      - docbuild5:
-          requires:
-            - setup
-      - docbuild6:
-          requires:
-            - setup
-      - docbuild7:
-          requires:
-            - setup
-      - finish:
-          requires:
-            - setup
-            - docbuild1
-            - docbuild2
-            - docbuild3
-            - docbuild4
-            - docbuild5
-            - docbuild6
-            - docbuild7
+      - build
 
   weekly:
     jobs:
-      - setup
-      - docbuild1:
-          requires:
-            - setup
-      - docbuild2:
-          requires:
-            - setup
-      - docbuild3:
-          requires:
-            - setup
-      - docbuild4:
-          requires:
-            - setup
-      - docbuild5:
-          requires:
-            - setup
-      - docbuild6:
-          requires:
-            - setup
-      - docbuild7:
-          requires:
-            - setup
-      - finish:
-          requires:
-            - setup
-            - docbuild1
-            - docbuild2
-            - docbuild3
-            - docbuild4
-            - docbuild5
-            - docbuild6
-            - docbuild7
-
+      - build
     triggers:
       - schedule:
           cron: "0 4 * * 0"
diff --git a/.github/workflows/circle-artifacts.yml b/.github/workflows/circle-artifacts.yml
index c56648a0..7443131e 100644
--- a/.github/workflows/circle-artifacts.yml
+++ b/.github/workflows/circle-artifacts.yml
@@ -10,7 +10,7 @@ jobs:
         with:
           repo-token: ${{ secrets.GITHUB_TOKEN }}
           artifact-path: 0/html/index.html
-          circleci-jobs: finish
+          circleci-jobs: build
           job-title: Check the rendered docs here!
       - name: Check the URL
         run: |
diff --git a/README.rst b/README.rst
index 6126a87f..34b9c2c2 100644
--- a/README.rst
+++ b/README.rst
@@ -92,7 +92,7 @@ rejection dictionary, simply do:
 	>>> from autoreject import get_rejection_threshold
 	>>> reject = get_rejection_threshold(epochs)  # doctest: +SKIP
 
-We also implement RANSAC from the PREP pipeline.
+We also implement RANSAC from the `PREP pipeline <https://doi.org/10.3389/fninf.2015.00016>`_.
 The API is the same:
 
 .. code:: python
@@ -107,7 +107,7 @@ For more details check out the example to
 Bug reports
 ===========
 
-Use the `github issue tracker <https://github.com/autoreject/autoreject/issues>`_ to report bugs.
+Please use the `GitHub issue tracker <https://github.com/autoreject/autoreject/issues>`_ to report bugs.
 
 Cite
 ====
diff --git a/doc/conf.py b/doc/conf.py
index aef3fb6a..d3d195ee 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -26,8 +26,13 @@
     'sphinx.ext.viewcode',
     'sphinx_gallery.gen_gallery',
     'numpydoc',
+    'sphinx_copybutton',
 ]
 
+# configure sphinx-copybutton
+copybutton_prompt_text = r">>> |\.\.\. |\$ "
+copybutton_prompt_is_regexp = True
+
 autosummary_generate = True  # generate autosummary even if no references
 
 # configure numpydoc
@@ -46,7 +51,7 @@
 master_doc = 'index'
 
 # General information about the project.
-author = 'Mainak Jas'
+author = 'autoreject developers'
 project = 'autoreject'
 td = date.today()
 copyright = f'2016-{td.year}, {author}. Last updated on {td.isoformat()}'
diff --git a/doc/faq.rst b/doc/faq.rst
index 5217c4fd..239e5bd2 100644
--- a/doc/faq.rst
+++ b/doc/faq.rst
@@ -9,7 +9,7 @@ This section of the documentation provides a *discussion-like* format, answering
 Should I apply ICA first or autoreject first?
 ---------------------------------------------
 
-Please read :ref:`<sphx_glr_auto_examples_plot_autoreject_workflow.py>`_.
+Please read :ref:`plot_autoreject_workflow`.
 
 Is it dangerous to do source estimation with interpolated channels?
 -------------------------------------------------------------------
diff --git a/examples/plot_auto_repair.py b/examples/plot_auto_repair.py
index ad7e4e1a..a732fb6a 100644
--- a/examples/plot_auto_repair.py
+++ b/examples/plot_auto_repair.py
@@ -9,7 +9,7 @@
 
 # Author: Mainak Jas <mainak.jas@telecom-paristech.fr>
 #         Denis A. Engemann <denis.engemann@gmail.com>
-# License: BSD (3-clause)
+# License: BSD-3-Clause
 
 # %%
 # Let us first define the parameters. `n_interpolates` are the :math:`\rho`
diff --git a/examples/plot_autoreject_workflow.py b/examples/plot_autoreject_workflow.py
index 9737978a..d7deea58 100644
--- a/examples/plot_autoreject_workflow.py
+++ b/examples/plot_autoreject_workflow.py
@@ -1,4 +1,7 @@
 """
+
+.. _plot_autoreject_workflow:
+
 ===================================================
 Preprocessing workflow with ``autoreject`` and ICA
 ===================================================
@@ -16,7 +19,7 @@
 #         Mainak Jas <mjas@mgh.harvard.edu>
 #         Apoorva Karekal <apoorvak@uoregon.edu>
 #
-# License: BSD (3-clause)
+# License: BSD-3-Clause
 
 # sphinx_gallery_thumbnail_number = 9
 
diff --git a/examples/plot_channel_thresholds.py b/examples/plot_channel_thresholds.py
index d04f5dfe..4beab70d 100644
--- a/examples/plot_channel_thresholds.py
+++ b/examples/plot_channel_thresholds.py
@@ -8,7 +8,7 @@
 """
 
 # Author: Mainak Jas <mainak.jas@telecom-paristech.fr>
-# License: BSD (3-clause)
+# License: BSD-3-Clause
 
 ###############################################################################
 # Let us first load the `raw` data using :func:`mne.io.read_raw_fif`.
diff --git a/examples/plot_estimate_global_reject.py b/examples/plot_estimate_global_reject.py
index 04a4b7a6..5cc44641 100644
--- a/examples/plot_estimate_global_reject.py
+++ b/examples/plot_estimate_global_reject.py
@@ -8,7 +8,7 @@
 """
 
 # Author: Mainak Jas <mainak.jas@telecom-paristech.fr>
-# License: BSD (3-clause)
+# License: BSD-3-Clause
 
 ###############################################################################
 # Let us import the data using MNE-Python and epoch it.
diff --git a/examples/plot_global_reject.py b/examples/plot_global_reject.py
index f4bb3d65..909842e2 100644
--- a/examples/plot_global_reject.py
+++ b/examples/plot_global_reject.py
@@ -9,7 +9,7 @@
 """
 
 # Author: Mainak Jas <mainak.jas@telecom-paristech.fr>
-# License: BSD (3-clause)
+# License: BSD-3-Clause
 
 ###############################################################################
 # Let us import the data using MNE-Python and epoch it.
diff --git a/examples/plot_ransac.py b/examples/plot_ransac.py
index b11ab15b..3179780e 100644
--- a/examples/plot_ransac.py
+++ b/examples/plot_ransac.py
@@ -19,7 +19,7 @@
 """
 
 # Author: Mainak Jas <mainak.jas@telecom-paristech.fr>
-# License: BSD (3-clause)
+# License: BSD-3-Clause
 
 ###############################################################################
 # For the purposes of this example, we shall use the MNE sample dataset.
diff --git a/examples/plot_visualize_bad_epochs.py b/examples/plot_visualize_bad_epochs.py
index a7f4f20a..a42757e3 100644
--- a/examples/plot_visualize_bad_epochs.py
+++ b/examples/plot_visualize_bad_epochs.py
@@ -9,7 +9,7 @@
 
 # Author: Mainak Jas <mainak.jas@telecom-paristech.fr>
 #         Denis A. Engemann <denis.engemann@gmail.com>
-# License: BSD (3-clause)
+# License: BSD-3-Clause
 
 # sphinx_gallery_thumbnail_number = 2
 
diff --git a/setup.py b/setup.py
index 1c85f9f6..d8d277f6 100644
--- a/setup.py
+++ b/setup.py
@@ -1,6 +1,8 @@
 """Setup autoreject."""
+
 import os
-from setuptools import setup, find_packages
+
+from setuptools import find_packages, setup
 
 # get the version (don't import autoreject here to avoid dependency)
 version = None
@@ -12,13 +14,11 @@
 if version is None:
     raise RuntimeError('Could not determine version')
 
-descr = """Automated rejection and repair of epochs in M/EEG."""
-
 DISTNAME = 'autoreject'
-DESCRIPTION = descr
+DESCRIPTION = 'Automated rejection and repair of epochs in M/EEG.'
 MAINTAINER = 'Mainak Jas'
 MAINTAINER_EMAIL = 'mainakjas@gmail.com'
-LICENSE = 'BSD (3-clause)'
+LICENSE = 'BSD-3-Clause'
 URL = 'http://autoreject.github.io/'
 DOWNLOAD_URL = 'https://github.com/autoreject/autoreject.git'
 VERSION = version
@@ -45,6 +45,7 @@
               'Operating System :: POSIX',
               'Operating System :: Unix',
               'Operating System :: MacOS',
+              'Programming Language :: Python :: 3',
           ],
           platforms='any',
           keywords=('electroencephalography eeg magnetoencephalography '
@@ -75,6 +76,7 @@
                   'sphinx',
                   'sphinx-gallery',
                   'sphinx_bootstrap_theme',
+                  'sphinx-copybutton',
                   'numpydoc',
                   'cython',
                   'pillow',


Test patch:
diff --git a/autoreject/tests/test_autoreject.py b/autoreject/tests/test_autoreject.py
index c1a54f41..5238c059 100644
--- a/autoreject/tests/test_autoreject.py
+++ b/autoreject/tests/test_autoreject.py
@@ -3,7 +3,7 @@
 #         Denis A. Engemann <denis.engemann@gmail.com>
 #         Stefan Appelhoff <stefan.appelhoff@mailbox.org>
 #
-# License: BSD (3-clause)
+# License: BSD-3-Clause
 
 import os.path as op
 import pickle
diff --git a/autoreject/tests/test_ransac.py b/autoreject/tests/test_ransac.py
index b16076d0..bf86effa 100644
--- a/autoreject/tests/test_ransac.py
+++ b/autoreject/tests/test_ransac.py
@@ -1,5 +1,5 @@
 # Author: Mainak Jas <mainak.jas@telecom-paristech.fr>
-# License: BSD (3-clause)
+# License: BSD-3-Clause
 
 import pytest
 
diff --git a/autoreject/tests/test_utils.py b/autoreject/tests/test_utils.py
index 7d24014f..0891cdb9 100644
--- a/autoreject/tests/test_utils.py
+++ b/autoreject/tests/test_utils.py
@@ -1,5 +1,5 @@
 # Author: Mainak Jas <mainak.jas@telecom-paristech.fr>
-# License: BSD (3-clause)
+# License: BSD-3-Clause
 
 from numpy.testing import assert_array_equal, assert_array_almost_equal
 import pytest
diff --git a/autoreject/tests/test_viz.py b/autoreject/tests/test_viz.py
index d3d83094..fa0bc629 100644
--- a/autoreject/tests/test_viz.py
+++ b/autoreject/tests/test_viz.py
@@ -1,5 +1,5 @@
 # Author: Mainak Jas <mainak.jas@telecom-paristech.fr>
-# License: BSD (3-clause)
+# License: BSD-3-Clause
 
 import numpy as np
 import pytest