From a9931d430e227df28d92996647bf97f7aa4a13d8 Mon Sep 17 00:00:00 2001 From: Daniel Fremont Date: Sat, 24 Feb 2024 14:51:35 -0800 Subject: [PATCH] upgrade to Tox 4; document how to use it --- docs/developing.rst | 15 +++++++++++++++ pyproject.toml | 2 +- tox.ini | 3 ++- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/docs/developing.rst b/docs/developing.rst index 044f88ced..97bdfe8e0 100644 --- a/docs/developing.rst +++ b/docs/developing.rst @@ -58,6 +58,21 @@ If you're running the test suite on a headless server or just want to stop windo popping up during testing, use the :command:`--no-graphics` option to skip graphical tests. +Prior to finalizing a PR or other substantial changes, it's a good idea to run the test suite under all major versions of Python that Scenic supports, in fresh virtual environments. +You can do this automatically with the command :command:`tox`, which by default will test all supported major versions both with and without optional dependencies (this will take a long time). +Some variations: + +* :command:`tox -p` will run the various combinations in parallel. + +* :command:`tox -m basic` skips testing installations with the optional dependencies. + +* :command:`tox -- --fast` only runs the "fast" tests. In general, any arguments after the :command:`--` will get passed to ``pytest``. For example, + +* :command:`tox -- tests/syntax/test_specifiers.py` only runs the tests in the given file. + +See the `Tox `_ website for more information about the available options and how to configure Tox. + + .. _debugging: Debugging diff --git a/pyproject.toml b/pyproject.toml index 796b96bd9..23ed55d81 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -79,7 +79,7 @@ dev = [ "isort ~= 5.11", "pre-commit ~= 3.0", "pytest-cov >= 3.0.0", - "tox ~= 3.14", + "tox ~= 4.0", ] [project.urls] diff --git a/tox.ini b/tox.ini index 365ce524a..e08482b81 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,7 @@ [tox] -isolated_build = true envlist = py{38,39,310,311,312}{,-extras} +labels = + basic = py{38,39,310,311,312} [testenv] extras =