diff --git a/CHANGES.rst b/CHANGES.rst index 9d5d75f..a794a20 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -4,6 +4,10 @@ Change log 2.2 (unreleased) ---------------- +- Add tox option ``testenv-skip-test-extra``. + Set this to true if your package does not have a ``test`` extra. + Otherwise tests fail with latest ``tox``. + - Remove special treatment for macOS test runners on GitHub - Print out a warning if a ``setuptools`` install time dependency is found diff --git a/docs/narr.rst b/docs/narr.rst index f6b794f..3d2302a 100644 --- a/docs/narr.rst +++ b/docs/narr.rst @@ -458,6 +458,10 @@ testenv-additional-extras Additional entries for the ``extras`` option in ``[testenv]`` of ``tox.ini``. This option has to be a list of strings without indentation. +testenv-skip-test-extra + Don't add the standard ``test`` in the ``extras`` option in ``[testenv]`` + of ``tox.ini``. This option has to be true/false. Default is false. + testenv-commands-pre Replacement for the default ``commands_pre`` option in ``[testenv]`` of ``tox.ini``. This option has to be a list of strings without indentation. diff --git a/src/zope/meta/config_package.py b/src/zope/meta/config_package.py index 027b494..a76ce21 100644 --- a/src/zope/meta/config_package.py +++ b/src/zope/meta/config_package.py @@ -462,6 +462,8 @@ def tox(self): testenv_additional = self.tox_option('testenv-additional') testenv_additional_extras = self.tox_option( 'testenv-additional-extras') + testenv_skip_test_extra = self.tox_option( + 'testenv-skip-test-extra', False) testenv_commands_pre = self.tox_option('testenv-commands-pre') testenv_commands = self.tox_option('testenv-commands') testenv_setenv = self.tox_option('testenv-setenv') @@ -503,6 +505,7 @@ def tox(self): lint_diff_on_failure=lint_diff_on_failure, testenv_additional=testenv_additional, testenv_additional_extras=testenv_additional_extras, + testenv_skip_test_extra=testenv_skip_test_extra, testenv_commands=testenv_commands, testenv_commands_pre=testenv_commands_pre, testenv_deps=testenv_deps, diff --git a/src/zope/meta/default/tox-testenv.j2 b/src/zope/meta/default/tox-testenv.j2 index fa338e9..c3ac3e1 100644 --- a/src/zope/meta/default/tox-testenv.j2 +++ b/src/zope/meta/default/tox-testenv.j2 @@ -42,7 +42,9 @@ commands = sphinx-build -b doctest -d {envdir}/.cache/doctrees docs {envdir}/.cache/doctest {% endif %} extras = + {% if not testenv_skip_test_extra %} test + {% endif %} {% if with_sphinx_doctests %} docs {% endif %}