Repository: PlasmaPy/PlasmaPy

Issue:
Add python 3.8 to testing matrix

Discussion:
codecov[bot]: # [Codecov](https://codecov.io/gh/PlasmaPy/PlasmaPy/pull/712?src=pr&el=h1) Report
> Merging [#712](https://codecov.io/gh/PlasmaPy/PlasmaPy/pull/712?src=pr&el=desc) into [master](https://codecov.io/gh/PlasmaPy/PlasmaPy/commit/ef86757f94f98edc00dcbe01a40431992091be9a?src=pr&el=desc) will **decrease** coverage by `0.08%`.
> The diff coverage is `n/a`.

[![Impacted file tree graph](https://codecov.io/gh/PlasmaPy/PlasmaPy/pull/712/graphs/tree.svg?width=650&token=LzZ5mnXVad&height=150&src=pr)](https://codecov.io/gh/PlasmaPy/PlasmaPy/pull/712?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master     #712      +/-   ##
==========================================
- Coverage   95.02%   94.93%   -0.09%     
==========================================
  Files          57       57              
  Lines        4722     4722              
==========================================
- Hits         4487     4483       -4     
- Misses        235      239       +4
```


| [Impacted Files](https://codecov.io/gh/PlasmaPy/PlasmaPy/pull/712?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [plasmapy/utils/decorators/checks.py](https://codecov.io/gh/PlasmaPy/PlasmaPy/pull/712/diff?src=pr&el=tree#diff-cGxhc21hcHkvdXRpbHMvZGVjb3JhdG9ycy9jaGVja3MucHk=) | `97.5% <0%> (-1.67%)` | :arrow_down: |
| [plasmapy/utils/pytest\_helpers/pytest\_helpers.py](https://codecov.io/gh/PlasmaPy/PlasmaPy/pull/712/diff?src=pr&el=tree#diff-cGxhc21hcHkvdXRpbHMvcHl0ZXN0X2hlbHBlcnMvcHl0ZXN0X2hlbHBlcnMucHk=) | `92.64% <0%> (-0.74%)` | :arrow_down: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/PlasmaPy/PlasmaPy/pull/712?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/PlasmaPy/PlasmaPy/pull/712?src=pr&el=footer). Last update [ef86757...1ae1d4a](https://codecov.io/gh/PlasmaPy/PlasmaPy/pull/712?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

StanczakDominik: The py37-astropydev error is a result of #653 and I'm still not sure how to handle it

I will also add #424 here
StanczakDominik: - [ ] `py36-minimal-conda [linux])` is failing due to calls to `units.quantity.allclose`, which either wasn't there yet or was in another namespace back in Astropy 2.0. But I think simply bumping the minimum to 3.0, or even 3.1 as I seem to remember some breakage, would be more sensible.
- [ ] `py37-astropydev [linux]` is all #653, and I think it could be possible to fix most of it via `atol`s. I'll try it tomorrow or so.

I'm also liking how local access to these envs is more comfortable now.
StanczakDominik: Also, @Cadair, consider this tested and I've got only positive feedback for you :) it seems to be working like a charm.
StanczakDominik: I've decided to bump the minimum required versions of

- Astropy from 2.0 to 3.1 because Seriously, That's One Major Version Ago and Let's Respect Each Other
- Numpy from 1.13 to 1.14 because https://github.com/PlasmaPy/PlasmaPy/issues/229 And That Should Be Enough Said
namurphy: As much as I'll miss broken doctests, bumping the minimum version of NumPy to 1.14 sounds like a good idea to me.  Same for bumping minimum Astropy to 3.1.  Thanks!
StanczakDominik: Turns out the astropydev problem consists of a bunch of different problems and I'd much rather merge this now, then figure out fixes for each...
pep8speaks: Hello @StanczakDominik! Thanks for updating your pull request.

* In the file [`plasmapy/atomic/atomic.py`](https://github.com/PlasmaPy/PlasmaPy/blob/e6be0ca3632475d9c4a7afb7642dafa9c80ce568/plasmapy/atomic/atomic.py):

> [Line 420:100](https://github.com/PlasmaPy/PlasmaPy/blob/e6be0ca3632475d9c4a7afb7642dafa9c80ce568/plasmapy/atomic/atomic.py#L420): [E501](https://duckduckgo.com/?q=pep8%20E501) line too long (174 > 99 characters)




StanczakDominik: ELLIPSIS seems broken within astropy/pytest-doctestplus, I'll try to report that there, but most definitely not tonight.

For now, I'm instead going to get rid of pytest-astropy, as I'm realizing we're not actually using any of its functionality except FLOAT_CMP, and that can be reproduced with `pytest >= 5.1` via the NUMBER flag.

I'm frustrated, so I shall now vent with a witty video:

https://www.youtube.com/watch?v=djZkTnJnLR0
StanczakDominik: https://www.youtube.com/watch?v=AXwGVXD7qEQ

except for 3.8 failing on pip installing hdf5, and astropy-dev is still failing, but that's still PROGRESS!
Cadair: I *think* you might be able to solve your hdf5 issue by installing the hdf5 c lib with apt.
StanczakDominik: I think I'll just take the lazy route and wait for https://github.com/h5py/h5py/issues/1410 :laughing: 
Cadair: That looks like a troublesome bug in the Azure images...

Patch:
diff --git a/azure-pipelines.yml b/azure-pipelines.yml
index 7c298720..c4d33631 100644
--- a/azure-pipelines.yml
+++ b/azure-pipelines.yml
@@ -1,11 +1,18 @@
+name: $(BuildDefinitionName)_$(Date:yyyyMMdd)$(Rev:.rr)
 variables:
   CI_NAME: Azure Pipelines
   CI_BUILD_ID: $(Build.BuildId)
   CI_BUILD_URL: "https://dev.azure.com/plasmapy/plasmapy/_build/results?buildId=$(Build.BuildId)"
   CIBW_BUILD: cp36-* cp37-*
   CIBW_SKIP: "*-win32 *-manylinux1_i686"
-  CIBW_TEST_COMMAND: pytest -p no:warnings --doctest-rst --pyargs plasmapy
-  CIBW_TEST_REQUIRES: sqlalchemy scikit-image glymur beautifulsoup4 drms python-dateutil zeep tqdm asdf hypothesis pytest-astropy pytest-mock
+
+resources:
+  repositories:
+  - repository: OpenAstronomy
+    type: github
+    endpoint: plasmapy
+    name: OpenAstronomy/azure-pipelines-templates
+    ref: master
 
 trigger:
   branches:
@@ -18,44 +25,59 @@ trigger:
     - '*dev*'
     - '*pre*'
     - '*post*'
-pr:
-  branches:
-    include:
-    - '*'
 
 jobs:
-- template: azure-templates.yml
+- template: run-tox-env.yml@OpenAstronomy
   parameters:
-    name: Linux_37_coverage
-    os: linux
-    tox: py37
+    submodules: false
+    coverage: codecov
+    posargs: -n=4
+    envs:
+      - macos: py37
+        name: py37_macos
 
-- template: azure-templates.yml
-  parameters:
-    name: Linux_36
-    os: linux
-    tox: py36
+      - windows: py36
 
-- template: azure-templates.yml
-  parameters:
-    name: Windows_37
-    os: windows
-    tox: py37
+      - linux: py37
+        name: py37_linux
 
-- template: azure-templates.yml
-  parameters:
-    name: Windows_36
-    os: windows
-    tox: py36
+      - linux: py38
+        name: py38_linux
 
-- template: azure-templates.yml
-  parameters:
-    name: macOS_37
-    os: macos
-    tox: py37
+      - linux: py36-conda
+        name: py36_conda
+        libraries: {}
 
-- template: azure-templates.yml
-  parameters:
-    name: macOS_36
-    os: macos
-    tox: py36
+      - linux: py36-astropy31
+        name: py36_astropy31
+
+      - linux: py37-astropydev
+        name: py37_astropydev
+
+      - linux: py37-numpydev
+        name: py37_numpydev
+
+      - linux: py36-minimal-conda
+        name: py36_minimal_conda
+
+# On branches which aren't master, and not Pull Requests, build the wheels but only upload them on tags
+- ${{ if and(ne(variables['Build.Reason'], 'PullRequest'), not(contains(variables['Build.SourceBranch'], 'master'))) }}:
+  - template: publish.yml@OpenAstronomy
+    parameters:
+      # Only Upload to PyPI on tags
+      ${{ if startsWith(variables['Build.SourceBranch'], 'refs/tags/') }}:
+        pypi_connection_name : 'PyPI'
+      test_extras: 'dev'
+      test_command: 'pytest -p no:warnings --doctest-rst -m "not figure" --pyargs plasmapy'
+      submodules: false
+      targets:
+        - wheels_linux
+        - wheels_macos
+        - sdist
+      dependsOn:
+        - py37_offline
+        - py36_offline
+        - py37_online
+        - py36_conda
+        - py38
+        - py36_astropy31
diff --git a/azure-templates.yml b/azure-templates.yml
deleted file mode 100644
index 036bb832..00000000
--- a/azure-templates.yml
+++ /dev/null
@@ -1,48 +0,0 @@
-jobs:
-- job: ${{ format(parameters.name) }}
-  pool:
-    ${{ if eq(parameters.os, 'windows') }}:
-      vmImage: vs2017-win2016
-    ${{ if eq(parameters.os, 'macos') }}:
-      vmImage: macOS 10.14
-    ${{ if eq(parameters.os, 'linux') }}:
-      vmImage: Ubuntu 16.04
-
-  steps:
-  - task: UsePythonVersion@0
-    inputs:
-      versionSpec: '3.6'
-
-  - task: UsePythonVersion@0
-    inputs:
-      versionSpec: '3.7'
-
-  - script: pip install --upgrade tox
-    displayName: install tox
-
-  - ${{ if contains(parameters.tox, 'conda') }}:
-    - script: pip install --upgrade tox-conda
-      displayName: install tox-conda
-
-  - script: tox -e ${{ parameters.tox }} -- --junitxml=junit/test-results.xml --cov-report=xml --cov-report=html
-    displayName: run tox
-
-  - script: |
-      pip install --upgrade codecov
-      codecov --name ${{ format(parameters.name) }}
-    displayName: run codecov
-    condition: succeededOrFailed()
-
-  - task: PublishTestResults@2
-    condition: succeededOrFailed()
-    inputs:
-      testResultsFiles: '**/test-*.xml'
-      testRunTitle: 'Publish test results for ${{ format(parameters.name) }}'
-
-  - ${{ if contains(parameters.tox, 'coverage') }}:
-    - task: PublishCodeCoverageResults@1
-      condition: succeededOrFailed()
-      inputs:
-        codeCoverageTool: Cobertura
-        summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml'
-        reportDirectory: '$(System.DefaultWorkingDirectory)/**/htmlcov'
diff --git a/changelog/712.trivial.rst b/changelog/712.trivial.rst
new file mode 100644
index 00000000..1b241972
--- /dev/null
+++ b/changelog/712.trivial.rst
@@ -0,0 +1,2 @@
+Overhaul and simplify CI, add Python 3.8 to tests, bump minimal required package versions, fix docs.
+
diff --git a/docs/development/release_guide.rst b/docs/development/release_guide.rst
index c41fb517..ce25926f 100644
--- a/docs/development/release_guide.rst
+++ b/docs/development/release_guide.rst
@@ -45,8 +45,8 @@ Pre-release
     relatively new, so check the standard for terms that have changed
     and new terms that may apply
 
-* Make sure that tests pass (``python setup.py test``) and that
-  documentation builds without issue (``python setup.py build_docs -W``)
+* Make sure that tests pass  and that
+  documentation builds without issue (``tox``)
 
 * Commit your changes up until now
 
diff --git a/docs/install.rst b/docs/install.rst
index ea9e8f89..7cdb18a6 100644
--- a/docs/install.rst
+++ b/docs/install.rst
@@ -19,9 +19,9 @@ PlasmaPy requires Python version 3.6 or newer, and is not compatible
 with Python 2.7.  PlasmaPy requires the following packages for
 installation:
 
-- `NumPy <http://www.numpy.org/>`_ 1.13 or newer
+- `NumPy <http://www.numpy.org/>`_ 1.14 or newer
 - `SciPy <https://www.scipy.org/>`_ 0.19 or newer
-- `Astropy <http://www.astropy.org/>`_ 2.0 or newer
+- `Astropy <http://www.astropy.org/>`_ 3.1 or newer
 - `colorama <https://pypi.org/project/colorama/>`_ 0.3 or newer
 
 PlasmaPy also uses the following optional dependencies:
@@ -165,42 +165,6 @@ or
 
    pip install .
 
-Testing a source code build
----------------------------
-
-Testing PlasmaPy requires:
-
-- `pytest <https://docs.pytest.org/>`_
-
-In the top level directory, run
-
-.. code:: bash
-
-   python setup.py test
-
-Building documentation
-----------------------
-
-Building and testing PlasmaPy documentation requires the following
-packages:
-
-- `Sphinx <http://www.sphinx-doc.org/>`_
-- `sphinx-gallery <https://sphinx-gallery.readthedocs.io/>`_
-- `sphinx_rtd_theme <https://sphinx-rtd-theme.readthedocs.io/>`_
-- `sphinx-automodapi <http://sphinx-automodapi.readthedocs.io/>`_
-- `pillow <https://pillow.readthedocs.io/>`_
-- `numpydoc <http://numpydoc.readthedocs.io/>`_
-
-To build the documentation, run the following command in the top level
-directory of the repository:
-
-.. code:: bash
-
-   python setup.py build_docs
-
-The HTML files built by this command will be placed in the
-``docs/_build/html`` subdirectory and can be read using a web browser.
-
 .. _PlasmaPy's GitHub repository: https://github.com/PlasmaPy/PlasmaPy
 .. _set up an SSH key: https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/
 .. _on PyPI: https://pypi.org/project/plasmapy/
diff --git a/plasmapy/atomic/atomic.py b/plasmapy/atomic/atomic.py
index 15e6e3b7..48e02acf 100644
--- a/plasmapy/atomic/atomic.py
+++ b/plasmapy/atomic/atomic.py
@@ -197,9 +197,9 @@ def standard_atomic_weight(element: Particle) -> u.Quantity:
     Examples
     --------
     >>> standard_atomic_weight("H")
-    <Quantity 1.67382335e-27 kg>
+    <Quantity 1.6738233e-27 kg>
     >>> standard_atomic_weight("lead")
-    <Quantity 3.44063689e-25 kg>
+    <Quantity 3.440636e-25 kg>
 
     """
     # TODO: Put in ReST links into above docstring
@@ -417,7 +417,7 @@ def electric_charge(particle: Particle) -> u.Quantity:
     Examples
     --------
     >>> electric_charge('p+')
-    <<class 'astropy.constants.codata2014.EMCODATA2014'> name='Electron charge' value=1.6021766208e-19 uncertainty=9.8e-28 unit='C' reference='CODATA 2014'>
+    <<class 'astropy.constants.codata...'> name='Electron charge' ...>
     >>> electric_charge('H-')
     <Quantity -1.60217662e-19 C>
 
@@ -882,7 +882,7 @@ def reduced_mass(test_particle, target_particle) -> u.Quantity:
     -------
     >>> from astropy import units as u
     >>> reduced_mass('p+', 'e-')
-    <Quantity 9.10442514e-31 kg>
+    <Quantity 9.104425e-31 kg>
     >>> reduced_mass(5.4e-27 * u.kg, 8.6e-27 * u.kg)
     <Quantity 3.31714286e-27 kg>
 
diff --git a/plasmapy/atomic/nuclear.py b/plasmapy/atomic/nuclear.py
index 8045fb16..3bd60550 100644
--- a/plasmapy/atomic/nuclear.py
+++ b/plasmapy/atomic/nuclear.py
@@ -60,16 +60,16 @@ def nuclear_binding_energy(particle: Particle, mass_numb: Optional[int] = None)
     --------
     >>> from astropy import units as u
     >>> nuclear_binding_energy('Fe-56').to(u.MeV)
-    <Quantity 492.25957876 MeV>
+    <Quantity 492.25957 MeV>
     >>> nuclear_binding_energy(26, 56)
-    <Quantity 7.88686788e-11 J>
+    <Quantity 7.8868678e-11 J>
     >>> nuclear_binding_energy('p')  # proton
     <Quantity 0. J>
     >>> from astropy import units as u
     >>> before = nuclear_binding_energy("D") + nuclear_binding_energy("T")
     >>> after = nuclear_binding_energy("alpha")
     >>> (after - before).to(u.MeV)  # released energy from D + T --> alpha + n
-    <Quantity 17.58932778 MeV>
+    <Quantity 17.589 MeV>
 
     """
     return particle.binding_energy.to(u.J)
@@ -109,7 +109,7 @@ def mass_energy(particle: Particle, mass_numb: Optional[int] = None) -> u.Quanti
         If the inputs are not of the correct types.
 
     >>> mass_energy('He-4')
-    <Quantity 5.97191997e-10 J>
+    <Quantity 5.9719e-10 J>
 
     """
     return particle.mass_energy
@@ -172,19 +172,19 @@ def nuclear_reaction_energy(*args, **kwargs):
     >>> from astropy import units as u
 
     >>> nuclear_reaction_energy("D + T --> alpha + n")
-    <Quantity 2.81812097e-12 J>
+    <Quantity 2.8181e-12 J>
 
     >>> triple_alpha1 = '2*He-4 --> Be-8'
     >>> triple_alpha2 = 'Be-8 + alpha --> carbon-12'
     >>> energy_triplealpha1 = nuclear_reaction_energy(triple_alpha1)
     >>> energy_triplealpha2 = nuclear_reaction_energy(triple_alpha2)
     >>> print(energy_triplealpha1, energy_triplealpha2)
-    -1.4714307834388437e-14 J 1.1802573526724632e-12 J
+    -1.471430e-14 J 1.1802573e-12 J
     >>> energy_triplealpha2.to(u.MeV)
-    <Quantity 7.36658704 MeV>
+    <Quantity 7.3665870 MeV>
 
     >>> nuclear_reaction_energy(reactants=['n'], products=['p+', 'e-'])
-    <Quantity 1.25343511e-13 J>
+    <Quantity 1.25343e-13 J>
 
     """
 
diff --git a/plasmapy/formulary/parameters.py b/plasmapy/formulary/parameters.py
index bf87c1e6..700d1f8c 100644
--- a/plasmapy/formulary/parameters.py
+++ b/plasmapy/formulary/parameters.py
@@ -802,7 +802,7 @@ def gyrofrequency(B: u.T, particle='e-', signed=False, Z=None):
     >>> gyrofrequency(0.1*u.T)
     <Quantity 1.75882002e+10 rad / s>
     >>> gyrofrequency(0.1*u.T, to_hz=True)
-    <Quantity 2799249007.6528206 Hz>
+    <Quantity 2.79924901e+09 Hz>
     >>> gyrofrequency(0.1*u.T, signed=True)
     <Quantity -1.75882002e+10 rad / s>
     >>> gyrofrequency(0.01*u.T, 'p')
@@ -812,7 +812,7 @@ def gyrofrequency(B: u.T, particle='e-', signed=False, Z=None):
     >>> gyrofrequency(0.01*u.T, particle='T+')
     <Quantity 319964.54975911 rad / s>
     >>> gyrofrequency(0.01*u.T, particle='T+', to_hz=True)
-    <Quantity 50923.93970833496 Hz>
+    <Quantity 50923.93970833 Hz>
     >>> omega_ce = gyrofrequency(0.1*u.T)
     >>> print(omega_ce)
     17588200236.02124 rad / s
@@ -1046,13 +1046,13 @@ def plasma_frequency(n: u.m**-3, particle='e-', z_mean=None):
     >>> plasma_frequency(1e19*u.m**-3, particle='p')
     <Quantity 4.16329453e+09 rad / s>
     >>> plasma_frequency(1e19*u.m**-3, particle='p', to_hz=True)
-    <Quantity 662608904.1071696 Hz>
+    <Quantity 6.62608904e+08 Hz>
     >>> plasma_frequency(1e19*u.m**-3, particle='D+')
     <Quantity 2.94462452e+09 rad / s>
     >>> plasma_frequency(1e19*u.m**-3)
     <Quantity 1.78398636e+11 rad / s>
     >>> plasma_frequency(1e19*u.m**-3, to_hz=True)
-    <Quantity 28393024835.274036 Hz>
+    <Quantity 2.83930248e+10 Hz>
 
     """
 
@@ -1461,7 +1461,7 @@ def upper_hybrid_frequency(B: u.T, n_e: u.m**-3):
     >>> upper_hybrid_frequency(0.2*u.T, n_e=5e19*u.m**-3)
     <Quantity 4.00459419e+11 rad / s>
     >>> upper_hybrid_frequency(0.2*u.T, n_e=5e19*u.m**-3, to_hz = True)
-    <Quantity 63735096112.815445 Hz>
+    <Quantity 6.37350961e+10 Hz>
 
     """
 
diff --git a/requirements/requirements.txt b/requirements/requirements.txt
index 0bc5913e..0e56cf1f 100644
--- a/requirements/requirements.txt
+++ b/requirements/requirements.txt
@@ -1,6 +1,6 @@
-numpy (>= 1.13)
+numpy (>= 1.14)
 scipy (>= 0.19)
-astropy (>= 2.0)
+astropy (>= 3.1)
 mpmath (>= 1.0.0)
 h5py (>= 2.8)
 lmfit (>= 0.9.7)
diff --git a/setup.cfg b/setup.cfg
index a8bf5604..0c18136c 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -32,9 +32,9 @@ packages = find:
 include_package_data = True
 setup_requires = setuptools_scm
 install_requires =
-  numpy>=1.13
+  numpy>=1.14
   scipy>=0.19
-  astropy>=2.0
+  astropy>=3.1
   colorama>=0.3
 
 [options.extras_require]
@@ -44,8 +44,7 @@ classes =
 diagnostics =
   matplotlib
 tests =
-  pytest
-  pytest_astropy
+  pytest >= 5.1
 theory =
   mpmath
   lmfit
@@ -56,7 +55,6 @@ docs =
   sphinx-automodapi
   sphinx-gallery
   sphinx_rtd_theme
-  sphinx-astropy
   towncrier
 
 [options.package_data]
@@ -70,11 +68,14 @@ build-dir = docs/_build
 all_files = 1
 
 [tool:pytest]
-minversion = 3.0
+minversion = 5.1
 testpaths = "plasmapy" "docs"
 norecursedirs = "build" "docs/_build" "examples" "auto_examples"
-doctest_plus = enabled
-doctest_optionflags = NORMALIZE_WHITESPACE FLOAT_CMP ELLIPSIS
+doctest_optionflags =
+    NORMALIZE_WHITESPACE
+    ELLIPSIS
+    NUMBER
+addopts = --doctest-modules --doctest-continue-on-failure --ignore=docs/conf.py
 
 [ah_bootstrap]
 auto_use = True
diff --git a/tox.ini b/tox.ini
index 36ba764c..37705793 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,5 +1,5 @@
 [tox]
-envlist = py3{6,7}{,-astropydev,-numpydev},build_docs
+envlist = py3{6,7}{,-astropydev,-numpydev,-astropy31},build_docs,py36-conda,py36-minimal-conda
 isolated_build = True
 
 [testenv]
@@ -9,13 +9,15 @@ whitelist_externals=
 changedir = tmp
 setenv =
     MPLBACKEND = agg
-    PYTEST_COMMAND = pytest -vvv --pyargs plasmapy --cov=plasmapy --cov-config={toxinidir}/setup.cfg --durations=25 {toxinidir}/docs -n=auto --dist=loadfile
+    COLUMNS = 180
+    PYTEST_COMMAND = pytest -vvv --pyargs plasmapy --cov=plasmapy --cov-config={toxinidir}/setup.cfg --durations=25 {toxinidir}/docs -n=auto --dist=loadfile --ignore={toxinidir}/docs/conf.py
 extras = all,tests
 deps =
     numpydev: git+https://github.com/numpy/numpy
     astropydev: git+https://github.com/astropy/astropy
     pytest-cov
     pytest-xdist
+    astropy31: astropy<3.2
 commands = {env:PYTEST_COMMAND} {posargs}
 
 [testenv:build_docs]
@@ -25,3 +27,55 @@ extras = dev
 setenv =
     HOME = {envtmpdir}
 commands = sphinx-build docs docs/_build/html -W -b html
+
+# This env requires tox-conda.
+[testenv:py36-conda]
+basepython = python3.6
+extras =
+deps =
+  lmfit
+  sphinx-automodapi
+  sphinx-gallery
+  towncrier
+  pytest-cov
+  pytest-xdist
+conda_deps =
+  numpy>=1.14
+  scipy>=0.19
+  astropy>=3.1
+  colorama>=0.3
+  h5py
+  matplotlib
+  pytest
+  mpmath
+  numpydoc
+  pillow
+  sphinx
+  sphinx_rtd_theme
+commands = {env:PYTEST_COMMAND} {posargs}
+
+# This env requires tox-conda and tests minimal versions of each dependency.
+[testenv:py36-minimal-conda]
+basepython = python3.6
+extras =
+deps =
+  lmfit==0.9.7
+  sphinx-automodapi
+  sphinx-gallery
+  towncrier
+  pytest-cov
+  pytest-xdist
+conda_deps =
+  numpy=1.14
+  scipy=0.19
+  astropy=3.1
+  colorama=0.3
+  h5py=2.8
+  matplotlib=2.0
+  pytest
+  mpmath=1.0
+  numpydoc
+  pillow
+  sphinx
+  sphinx_rtd_theme
+commands = {env:PYTEST_COMMAND} {posargs}


Test patch:
diff --git a/requirements/automated-documentation-tests.txt b/requirements/automated-documentation-tests.txt
index e18dc7f7..e450a0bb 100644
--- a/requirements/automated-documentation-tests.txt
+++ b/requirements/automated-documentation-tests.txt
@@ -6,5 +6,4 @@ sphinx
 sphinx-automodapi
 sphinx-gallery
 sphinx_rtd_theme
-sphinx-astropy
 pytest