Fix the use of package envs in tox
@@ -25,8 +25,7 @@ commands =
ignore = E501
[testenv:docs]
-setenv =
- PYLZ4_EXPERIMENTAL = 1
+package_env = .pkg-experimental
passenv = *
usedevelop = True
allowlist_externals = make
@@ -34,20 +33,18 @@ extras = docs
commands =
make -C docs doctest html
-[testenv:.pkg]
-# This section is needed to pass PYLZ4_EXPERIMENTAL into the
-# environment used to build the lz4 package ahead of creating the tox
-# virtual environment. Ideally we would like to be able to set this
-# only for docs building, but at the moment (tox 4.0.18) tox does not
-# allow that. See: https://github.com/tox-dev/tox/issues/2784
+[testenv:.pkg-experimental]
+# This environment is used when building the lz4 package (wheel) that
+# is subsequently installed into the tox environment for any
+# environment referencing this one via package_env.
+# https://tox.wiki/en/latest/config.html#package_env-env
setenv =
PYLZ4_EXPERIMENTAL = 1
[testenv:experimental]
extras = tests
passenv = *
-setenv =
- PYLZ4_EXPERIMENTAL = 1
+package_env = .pkg-experimental
# PYTHONMALLOC = pymalloc
# PYTHONMALLOCSTATS = 'yes'
usedevelop = True
