[tox]
envlist =
py{37,38,39}{,-online,-sunpy}
build_docs
codestyle
isolated_build = true
requires =
setuptools >= 30.3.0
pip >= 19.3.1
tox-pypi-filter >= 0.12
[testenv]
pypi_filter = https://raw.githubusercontent.com/sunpy/sunpy/main/.test_package_pins.txt
# Run the tests in a temporary directory to make sure that we don't import
# drms from the source tree
changedir = .tmp/{envname}
# tox environments are constructed with so-called 'factors' (or terms)
# separated by hyphens, e.g. test-devdeps-cov. Lines below starting with factor:
# will only take effect if that factor is included in the environment name. To
# see a list of example environments that can be run, along with a description,
# run:
#
# tox -l -v
#
description =
run tests
online: that require remote data
sunpy: run the sunpy jsoc tests to ensure we dont break them
setenv =
MPLBACKEND = agg
COLUMNS = 180
PYTEST_COMMAND = pytest -vvv -s -ra --pyargs drms --cov-report=xml --cov=drms --cov-config={toxinidir}/setup.cfg {toxinidir}/docs
build_docs,online: HOME = {envtmpdir}
passenv =
HTTP_PROXY
HTTPS_PROXY
NO_PROXY
CIRCLECI
deps =
# These are specific online extras we use to run the online tests.
online: pytest-rerunfailures
online: pytest-timeout
sunpy: git+https://github.com/sunpy/sunpy
# These are specific extras we use to run the sunpy tests.
sunpy: beautifulsoup4
sunpy: pytest-mock
sunpy: python-dateutil
sunpy: scipy
sunpy: tqdm
sunpy: zeep
# The following indicates which extras_require from setup.cfg will be installed
# dev is special in that it installs everything
extras =
dev
commands =
sunpy: pytest -vvv -s -ra --pyargs sunpy.net.jsoc --remote-data=any {posargs}
!online: {env:PYTEST_COMMAND} {posargs}
online: {env:PYTEST_COMMAND} --reruns 2 --reruns-delay 60 --timeout=300 --remote-data=any --email jsoc@cadair.com {posargs}
[testenv:build_docs]
changedir = docs
description = Invoke sphinx-build to build the HTML docs
extras = dev
commands =
sphinx-build -j auto --color -W --keep-going -b html -d _build/.doctrees . _build/html {posargs}
python -c 'import pathlib; print("Documentation available under file://\{0\}".format(pathlib.Path(r"{toxinidir}") / "docs" / "_build" / "index.html"))'
[testenv:codestyle]
pypi_filter =
skip_install = true
description = Run all style and file checks with pre-commit
deps =
pre-commit
commands =
pre-commit install-hooks
pre-commit run --verbose --all-files --show-diff-on-failure