tox (
https://tox.readthedocs.io/en/latest/) is a popular package that is used by a large number of Python projects as the standard entry point for testing and linting.
In several recent tickets, we have added a tox configuration (src/tox.ini) for the (more typical) use of tox for testing and linting of the Sage library. (See
https://trac.sagemath.org/ticket/30453 and dependencies.)
This provides an entry point for various testing/linting methods that is more idiomatic from the viewpoint of the Python community.
1. The commands "sage -t", "sage -coverage", "sage -coverageall", and "sage -startuptime" are repackaged as "sage --tox" follows:
--tox [options] <files|dirs> -- general entry point for testing
and linting of the Sage library
-e <envlist> -- run specific test environments (default: run all)
doctest -- run the Sage doctester
(same as "sage -t")
coverage -- give information about doctest coverage of files
(same as "sage --coverage[all]")
startuptime -- display how long each component of Sage takes to start up
(same as "sage --startuptime")
2. Three new linting methods are added:
pycodestyle -- check against the Python style conventions of PEP8
relint -- check whether some forbidden patterns appear
(includes all patchbot pattern-exclusion plugins)
codespell -- check for misspelled words in source code
This functionality is available after installing the optional "tox" package using "sage -i tox" (or having tox available in the system).
I propose to make "tox" a standard package of the Sage distribution so that this functionality becomes available by default.
By convention, this requires a vote here on sage-devel.