From bc0db40cbb4d4dfcd04c0fc65d3075562b9815ed Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Tue, 11 Nov 2025 19:28:23 +0100 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=93=A6=20Pass=20desired=20release=20t?= =?UTF-8?q?o=20PEP=20517=20tox=20env?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch fixes passing the release version string from the release automation script to the tox's PEP 517 frontend, so that the backend machinery bits (namely, `setuptools-scm`) could access the environment variable; as indentified in the attempt to release pytest v9.0.1 [[1]]. The solution uses the `[pkgenv]` section of `tox.ini` that corresponds to the PEP 517 build env tox manages internally. [1]: https://github.com/pytest-dev/pytest/pull/13928/files#r2514197778 --- tox.ini | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) 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 From 7df3b1bfa9d1d083ec9ba124236d0ea21e5cd7c2 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Tue, 11 Nov 2025 19:43:11 +0100 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=93=9D=20Add=20a=20change=20note=20fo?= =?UTF-8?q?r=20PR=20#13933?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- changelog/13933.contrib.rst | 4 ++++ changelog/13933.packaging.rst | 1 + 2 files changed, 5 insertions(+) create mode 100644 changelog/13933.contrib.rst create mode 120000 changelog/13933.packaging.rst 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