Skip to content

Commit 4bd63a0

Browse files
authored
Merge pull request #13935 from pytest-dev/patchback/backports/9.0.x/ce8b8a7b4b360ac5f3953b8c3b8b59e6bb420f37/pr-13933
[PR #13933/ce8b8a7b backport][9.0.x] 📦 Pass desired release to PEP 517 tox env
2 parents 0fa11ae + 15f93b3 commit 4bd63a0

File tree

3 files changed

+25
-3
lines changed

3 files changed

+25
-3
lines changed

changelog/13933.contrib.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
The tox configuration has been adjusted to make sure the desired
2+
version string can be passed into its :ref:`package_env` through
3+
the ``SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYTEST`` environment
4+
variable as a part of the release process -- by :user:`webknjaz`.

changelog/13933.packaging.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
13933.contrib.rst

tox.ini

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,26 @@ envlist =
2323

2424

2525

26+
[pkgenv]
27+
# NOTE: This section tweaks how Tox manages the PEP 517 build
28+
# NOTE: environment where it assembles wheels (editable and regular)
29+
# NOTE: for further installing them into regular testenvs.
30+
#
31+
# NOTE: `[testenv:.pkg]` does not work due to a regression in tox v4.14.1
32+
# NOTE: so `[pkgenv]` is being used in place of it.
33+
# Refs:
34+
# * https://github.com/tox-dev/tox/pull/3237
35+
# * https://github.com/tox-dev/tox/issues/3238
36+
# * https://github.com/tox-dev/tox/issues/3292
37+
# * https://hynek.me/articles/turbo-charge-tox/
38+
#
39+
# NOTE: The `SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYTEST` environment
40+
# NOTE: variable allows enforcing a pre-determined version for use in
41+
# NOTE: the wheel being installed into usual testenvs.
42+
pass_env =
43+
SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYTEST
44+
45+
2646
[testenv]
2747
description =
2848
run the tests
@@ -49,7 +69,6 @@ passenv =
4969
COVERAGE_*
5070
PYTEST_ADDOPTS
5171
TERM
52-
SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYTEST
5372
CI
5473
setenv =
5574
_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 =
141160
description =
142161
regenerate documentation examples under `{basepython}`
143162
changedir = doc/en
144-
passenv =
145-
SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYTEST
146163
deps =
147164
PyYAML
148165
regendoc>=0.8.1

0 commit comments

Comments
 (0)