Skip to content

Commit e0a2bdf

Browse files
authored
Automate pytests with tox (#106)
Automate tests, and other tasks using tox. Requirements: conda, tox, and tox-conda installed. Tox is used to automate tasks by just executing the tox command, without the need to set up the right development environment or downloading the pysteps-data beforehand. From any environment with tox installed, the tests can be run just executing the tox command from the project root (where the new tox.ini file is located). This will create a virtual environment with all the necessary dependencies to test pysteps and also download the pysteps data automatically. The tox-conda plugin was added to create the environments using conda. This was necessary to install basemaps and cartopy without major complications. tox environments: - default (testenv): Run the pysteps's test suite - install: Test the installation of the package in an environment with the minimal dependencies (run with -r option) - pypi: Test the installation of the package from the PyPI in a clean environment (run with -r option) - pypi_test: Test the installation of the package from the test-PyPI in a clean environment (run with -r option) - pypi_test_full: Test the installation of the package from the test-PyPI in an environment with all the dependencies (run with -r option) - black: run black tests - docs: Build the html documentation using sphinx - install: Test the installation of the package in an environment with the minimal dependencies - pypi: Test the installation of the package from the PyPI in a clean environment - pypi_test: Test the installation of the package from the test-PyPI in a clean environment The environments can be run with tox -e <environment_name>. By default, the environment are created only when the specifications in the tox.ini file changes. To force the recreation of the environment, add -r (recommended for some testing environments). The documentation was updated to include the tox usage.
1 parent 8073de8 commit e0a2bdf

File tree

11 files changed

+433
-158
lines changed

11 files changed

+433
-158
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ __pycache__/
99

1010
# Distribution / packaging
1111
.Python
12+
.tox
1213
build/
1314
develop-eggs/
1415
dist/

.readthedocs.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
11
# Read the Docs configuration file
22
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
33

4-
# Required
54
version: 2
65

7-
# Build documentation in the docs/ directory with Sphinx
86
sphinx:
97
configuration: doc/source/conf.py
108

11-
# Optionally build your docs in additional formats such as PDF and ePub
129
formats: all
1310

14-
# Optionally set the version of Python and
15-
# requirements required to build your docs
1611
python:
1712
version: 3.7
1813
install:
14+
- requirements: requirements.txt
1915
- requirements: doc/requirements.txt
2016
- method: pip
2117
path: .

0 commit comments

Comments
 (0)