diff --git a/changelog/13933.contrib.rst b/changelog/13933.contrib.rst new file mode 100644 index 00000000000..feab3e0dc03 --- /dev/null +++ b/changelog/13933.contrib.rst @@ -0,0 +1,4 @@ +The tox configuration has been adjusted to make sure the desired +version string can be passed into its :ref:`package_env` through +the ``SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYTEST`` environment +variable as a part of the release process -- by :user:`webknjaz`. diff --git a/changelog/13933.packaging.rst b/changelog/13933.packaging.rst new file mode 120000 index 00000000000..79139f98eed --- /dev/null +++ b/changelog/13933.packaging.rst @@ -0,0 +1 @@ +13933.contrib.rst \ No newline at end of file diff --git a/tox.ini b/tox.ini index 5c2106ee5b4..2e91ddcb2d6 100644 --- a/tox.ini +++ b/tox.ini @@ -23,6 +23,26 @@ envlist = +[pkgenv] +# NOTE: This section tweaks how Tox manages the PEP 517 build +# NOTE: environment where it assembles wheels (editable and regular) +# NOTE: for further installing them into regular testenvs. +# +# NOTE: `[testenv:.pkg]` does not work due to a regression in tox v4.14.1 +# NOTE: so `[pkgenv]` is being used in place of it. +# Refs: +# * https://github.com/tox-dev/tox/pull/3237 +# * https://github.com/tox-dev/tox/issues/3238 +# * https://github.com/tox-dev/tox/issues/3292 +# * https://hynek.me/articles/turbo-charge-tox/ +# +# NOTE: The `SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYTEST` environment +# NOTE: variable allows enforcing a pre-determined version for use in +# NOTE: the wheel being installed into usual testenvs. +pass_env = + SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYTEST + + [testenv] description = run the tests @@ -49,7 +69,6 @@ passenv = COVERAGE_* PYTEST_ADDOPTS TERM - SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYTEST CI setenv = _PYTEST_TOX_DEFAULT_POSARGS={env:_PYTEST_TOX_POSARGS_DOCTESTING:} {env:_PYTEST_TOX_POSARGS_LSOF:} {env:_PYTEST_TOX_POSARGS_XDIST:} {env:_PYTEST_FILES:} @@ -141,8 +160,6 @@ setenv = description = regenerate documentation examples under `{basepython}` changedir = doc/en -passenv = - SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYTEST deps = PyYAML regendoc>=0.8.1