Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

passenv regression when multiple variables are named on the same line #2615

Closed
masenf opened this issue Dec 7, 2022 · 6 comments · Fixed by #2621
Closed

passenv regression when multiple variables are named on the same line #2615

masenf opened this issue Dec 7, 2022 · 6 comments · Fixed by #2621
Labels
area:documentation help:wanted Issues that have been acknowledged, a solution determined and a PR might likely be accepted.

Comments

@masenf
Copy link
Collaborator

masenf commented Dec 7, 2022

Issue

In tox 4, space-separated variables specified for passenv are not passed into the container.

[testenv:inline]
passenv = FOO BAR

☝️ doesn't work on tox 4

[testenv:separate-lines]
passenv =
    FOO
    BAR

☝️ works fine on tox3 and tox4

Environment

Provide at least:

  • OS: ubuntu 20.04
  • pip list of the host Python where tox is installed:
% ./tox4/bin/pip list
Package       Version
------------- -------
cachetools    5.2.0
chardet       5.1.0
colorama      0.4.6
distlib       0.3.6
filelock      3.8.2
packaging     21.3
pip           20.0.2
pkg-resources 0.0.0
platformdirs  2.6.0
pluggy        1.0.0
pyparsing     3.0.9
pyproject-api 1.2.1
setuptools    44.0.0
tomli         2.0.1
tox           4.0.0
virtualenv    20.17.1

Output of running tox

Provide the output of tox -rvv:

inline: 235 W remove tox env folder /git/tox-passenv/.tox/inline [tox/tox_env/api.py:292]
inline: 292 I find interpreter for spec PythonSpec(path=/git/tox-passenv/tox4/bin/python3) [virtualenv/discovery/builtin.py:56]
inline: 292 D discover exe for PythonInfo(spec=CPython3.8.10.final.0-64, exe=/git/tox-passenv/tox4/bin/python3, platform=linux, version='3.8.10 (default, Jun 22 2022, 20:18:18) \n[GCC 9.4.0]', encoding_fs_io=utf-8-utf-8) in /usr [virtualenv/discovery/py_info.py:437]
inline: 293 D filesystem is case-sensitive [virtualenv/info.py:24]
inline: 294 D Attempting to acquire lock 139846177643632 on /home/mfurer/.local/share/virtualenv/py_info/1/df0893f56f349688326838aaeea0de204df53a132722cbd565e54b24a8fec5f6.lock [filelock/_api.py:172]
inline: 294 D Lock 139846177643632 acquired on /home/mfurer/.local/share/virtualenv/py_info/1/df0893f56f349688326838aaeea0de204df53a132722cbd565e54b24a8fec5f6.lock [filelock/_api.py:176]
inline: 294 D got python info of /usr/bin/python3.8 from /home/mfurer/.local/share/virtualenv/py_info/1/df0893f56f349688326838aaeea0de204df53a132722cbd565e54b24a8fec5f6.json [virtualenv/app_data/via_disk_folder.py:129]
inline: 295 D Attempting to release lock 139846177643632 on /home/mfurer/.local/share/virtualenv/py_info/1/df0893f56f349688326838aaeea0de204df53a132722cbd565e54b24a8fec5f6.lock [filelock/_api.py:209]
inline: 295 D Lock 139846177643632 released on /home/mfurer/.local/share/virtualenv/py_info/1/df0893f56f349688326838aaeea0de204df53a132722cbd565e54b24a8fec5f6.lock [filelock/_api.py:212]
inline: 295 I proposed PythonInfo(spec=CPython3.8.10.final.0-64, system=/usr/bin/python3.8, exe=/git/tox-passenv/tox4/bin/python3, platform=linux, version='3.8.10 (default, Jun 22 2022, 20:18:18) \n[GCC 9.4.0]', encoding_fs_io=utf-8-utf-8) [virtualenv/discovery/builtin.py:63]
inline: 295 D accepted PythonInfo(spec=CPython3.8.10.final.0-64, system=/usr/bin/python3.8, exe=/git/tox-passenv/tox4/bin/python3, platform=linux, version='3.8.10 (default, Jun 22 2022, 20:18:18) \n[GCC 9.4.0]', encoding_fs_io=utf-8-utf-8) [virtualenv/discovery/builtin.py:65]
inline: 327 I create virtual environment via CPython3Posix(dest=/git/tox-passenv/.tox/inline, clear=False, no_vcs_ignore=False, global=False) [virtualenv/run/session.py:48]
inline: 327 D create folder /git/tox-passenv/.tox/inline/bin [virtualenv/util/path/_sync.py:9]
inline: 327 D create folder /git/tox-passenv/.tox/inline/lib/python3.8/site-packages [virtualenv/util/path/_sync.py:9]
inline: 328 D write /git/tox-passenv/.tox/inline/pyvenv.cfg [virtualenv/create/pyenv_cfg.py:30]
inline: 328 D   home = /usr/bin [virtualenv/create/pyenv_cfg.py:34]
inline: 328 D   implementation = CPython [virtualenv/create/pyenv_cfg.py:34]
inline: 328 D   version_info = 3.8.10.final.0 [virtualenv/create/pyenv_cfg.py:34]
inline: 328 D   virtualenv = 20.17.1 [virtualenv/create/pyenv_cfg.py:34]
inline: 328 D   include-system-site-packages = false [virtualenv/create/pyenv_cfg.py:34]
inline: 328 D   base-prefix = /usr [virtualenv/create/pyenv_cfg.py:34]
inline: 328 D   base-exec-prefix = /usr [virtualenv/create/pyenv_cfg.py:34]
inline: 328 D   base-executable = /usr/bin/python3.8 [virtualenv/create/pyenv_cfg.py:34]
inline: 328 D symlink /usr/bin/python3.8 to /git/tox-passenv/.tox/inline/bin/python [virtualenv/util/path/_sync.py:28]
inline: 329 D create virtualenv import hook file /git/tox-passenv/.tox/inline/lib/python3.8/site-packages/_virtualenv.pth [virtualenv/create/via_global_ref/api.py:89]
inline: 329 D create /git/tox-passenv/.tox/inline/lib/python3.8/site-packages/_virtualenv.py [virtualenv/create/via_global_ref/api.py:92]
inline: 329 D ============================== target debug ============================== [virtualenv/run/session.py:50]
inline: 330 D debug via /git/tox-passenv/.tox/inline/bin/python /git/tox-passenv/tox4/lib/python3.8/site-packages/virtualenv/create/debug.py [virtualenv/create/creator.py:197]
inline: 329 D {
  "sys": {
    "executable": "/git/tox-passenv/.tox/inline/bin/python",
    "_base_executable": "/git/tox-passenv/.tox/inline/bin/python",
    "prefix": "/git/tox-passenv/.tox/inline",
    "base_prefix": "/usr",
    "real_prefix": null,
    "exec_prefix": "/git/tox-passenv/.tox/inline",
    "base_exec_prefix": "/usr",
    "path": [
      "/usr/lib/python38.zip",
      "/usr/lib/python3.8",
      "/usr/lib/python3.8/lib-dynload",
      "/git/tox-passenv/.tox/inline/lib/python3.8/site-packages"
    ],
    "meta_path": [
      "<class '_virtualenv._Finder'>",
      "<class '_frozen_importlib.BuiltinImporter'>",
      "<class '_frozen_importlib.FrozenImporter'>",
      "<class '_frozen_importlib_external.PathFinder'>"
    ],
    "fs_encoding": "utf-8",
    "io_encoding": "utf-8"
  },
  "version": "3.8.10 (default, Jun 22 2022, 20:18:18) \n[GCC 9.4.0]",
  "makefile_filename": "/usr/lib/python3.8/config-3.8-x86_64-linux-gnu/Makefile",
  "os": "<module 'os' from '/usr/lib/python3.8/os.py'>",
  "site": "<module 'site' from '/usr/lib/python3.8/site.py'>",
  "datetime": "<module 'datetime' from '/usr/lib/python3.8/datetime.py'>",
  "math": "<module 'math' (built-in)>",
  "json": "<module 'json' from '/usr/lib/python3.8/json/__init__.py'>"
} [virtualenv/run/session.py:51]
inline: 367 I add seed packages via FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/mfurer/.local/share/virtualenv) [virtualenv/run/session.py:55]
inline: 371 D got embed update of distribution pip from /home/mfurer/.local/share/virtualenv/wheel/3.8/embed/3/pip.json [virtualenv/app_data/via_disk_folder.py:129]
inline: 372 D got embed update of distribution wheel from /home/mfurer/.local/share/virtualenv/wheel/3.8/embed/3/wheel.json [virtualenv/app_data/via_disk_folder.py:129]
inline: 376 D got embed update of distribution setuptools from /home/mfurer/.local/share/virtualenv/wheel/3.8/embed/3/setuptools.json [virtualenv/app_data/via_disk_folder.py:129]
inline: 377 D install pip from wheel /git/tox-passenv/tox4/lib/python3.8/site-packages/virtualenv/seed/wheels/embed/pip-22.3.1-py3-none-any.whl via CopyPipInstall [virtualenv/seed/embed/via_app_data/via_app_data.py:47]
inline: 378 D install wheel from wheel /git/tox-passenv/tox4/lib/python3.8/site-packages/virtualenv/seed/wheels/embed/wheel-0.38.4-py3-none-any.whl via CopyPipInstall [virtualenv/seed/embed/via_app_data/via_app_data.py:47]
inline: 378 D install setuptools from wheel /git/tox-passenv/tox4/lib/python3.8/site-packages/virtualenv/seed/wheels/embed/setuptools-65.6.3-py3-none-any.whl via CopyPipInstall [virtualenv/seed/embed/via_app_data/via_app_data.py:47]
inline: 379 D Attempting to acquire lock 139846176406832 on /home/mfurer/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/pip-22.3.1-py3-none-any.lock [filelock/_api.py:172]
inline: 379 D Attempting to acquire lock 139846176406208 on /home/mfurer/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/wheel-0.38.4-py3-none-any.lock [filelock/_api.py:172]
inline: 379 D Lock 139846176406832 acquired on /home/mfurer/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/pip-22.3.1-py3-none-any.lock [filelock/_api.py:176]
inline: 380 D Lock 139846176406208 acquired on /home/mfurer/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/wheel-0.38.4-py3-none-any.lock [filelock/_api.py:176]
inline: 380 D Attempting to acquire lock 139846176405680 on /home/mfurer/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/setuptools-65.6.3-py3-none-any.lock [filelock/_api.py:172]
inline: 380 D Attempting to release lock 139846176406832 on /home/mfurer/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/pip-22.3.1-py3-none-any.lock [filelock/_api.py:209]
inline: 380 D Lock 139846176405680 acquired on /home/mfurer/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/setuptools-65.6.3-py3-none-any.lock [filelock/_api.py:176]
inline: 381 D Lock 139846176406832 released on /home/mfurer/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/pip-22.3.1-py3-none-any.lock [filelock/_api.py:212]
inline: 381 D Attempting to release lock 139846176406208 on /home/mfurer/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/wheel-0.38.4-py3-none-any.lock [filelock/_api.py:209]
inline: 381 D Lock 139846176406208 released on /home/mfurer/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/wheel-0.38.4-py3-none-any.lock [filelock/_api.py:212]
inline: 381 D Attempting to release lock 139846176405680 on /home/mfurer/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/setuptools-65.6.3-py3-none-any.lock [filelock/_api.py:209]
inline: 381 D Lock 139846176405680 released on /home/mfurer/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/setuptools-65.6.3-py3-none-any.lock [filelock/_api.py:212]
inline: 382 D copy /home/mfurer/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/pip-22.3.1-py3-none-any/pip-22.3.1.virtualenv to /git/tox-passenv/.tox/inline/lib/python3.8/site-packages/pip-22.3.1.virtualenv [virtualenv/util/path/_sync.py:36]
inline: 383 D copy directory /home/mfurer/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/wheel-0.38.4-py3-none-any/wheel-0.38.4.dist-info to /git/tox-passenv/.tox/inline/lib/python3.8/site-packages/wheel-0.38.4.dist-info [virtualenv/util/path/_sync.py:36]
inline: 383 D copy directory /home/mfurer/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/pip-22.3.1-py3-none-any/pip-22.3.1.dist-info to /git/tox-passenv/.tox/inline/lib/python3.8/site-packages/pip-22.3.1.dist-info [virtualenv/util/path/_sync.py:36]
inline: 384 D copy /home/mfurer/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/setuptools-65.6.3-py3-none-any/distutils-precedence.pth to /git/tox-passenv/.tox/inline/lib/python3.8/site-packages/distutils-precedence.pth [virtualenv/util/path/_sync.py:36]
inline: 385 D copy directory /home/mfurer/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/setuptools-65.6.3-py3-none-any/pkg_resources to /git/tox-passenv/.tox/inline/lib/python3.8/site-packages/pkg_resources [virtualenv/util/path/_sync.py:36]
inline: 390 D copy directory /home/mfurer/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/pip-22.3.1-py3-none-any/pip to /git/tox-passenv/.tox/inline/lib/python3.8/site-packages/pip [virtualenv/util/path/_sync.py:36]
inline: 390 D copy /home/mfurer/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/wheel-0.38.4-py3-none-any/wheel-0.38.4.virtualenv to /git/tox-passenv/.tox/inline/lib/python3.8/site-packages/wheel-0.38.4.virtualenv [virtualenv/util/path/_sync.py:36]
inline: 391 D copy directory /home/mfurer/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/wheel-0.38.4-py3-none-any/wheel to /git/tox-passenv/.tox/inline/lib/python3.8/site-packages/wheel [virtualenv/util/path/_sync.py:36]
inline: 409 D changing mode of /git/tox-passenv/.tox/inline/bin/wheel3.8 to 775 [distlib/util.py:572]
inline: 410 D changing mode of /git/tox-passenv/.tox/inline/bin/wheel-3.8 to 775 [distlib/util.py:572]
inline: 410 D changing mode of /git/tox-passenv/.tox/inline/bin/wheel to 775 [distlib/util.py:572]
inline: 411 D changing mode of /git/tox-passenv/.tox/inline/bin/wheel3 to 775 [distlib/util.py:572]
inline: 411 D generated console scripts wheel3.8 wheel-3.8 wheel wheel3 [virtualenv/seed/embed/via_app_data/pip_install/base.py:41]
inline: 420 D copy directory /home/mfurer/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/setuptools-65.6.3-py3-none-any/_distutils_hack to /git/tox-passenv/.tox/inline/lib/python3.8/site-packages/_distutils_hack [virtualenv/util/path/_sync.py:36]
inline: 421 D copy directory /home/mfurer/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/setuptools-65.6.3-py3-none-any/setuptools to /git/tox-passenv/.tox/inline/lib/python3.8/site-packages/setuptools [virtualenv/util/path/_sync.py:36]
inline: 496 D copy /home/mfurer/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/setuptools-65.6.3-py3-none-any/setuptools-65.6.3.virtualenv to /git/tox-passenv/.tox/inline/lib/python3.8/site-packages/setuptools-65.6.3.virtualenv [virtualenv/util/path/_sync.py:36]
inline: 497 D copy directory /home/mfurer/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/setuptools-65.6.3-py3-none-any/setuptools-65.6.3.dist-info to /git/tox-passenv/.tox/inline/lib/python3.8/site-packages/setuptools-65.6.3.dist-info [virtualenv/util/path/_sync.py:36]
inline: 500 D generated console scripts  [virtualenv/seed/embed/via_app_data/pip_install/base.py:41]
inline: 551 D changing mode of /git/tox-passenv/.tox/inline/bin/pip3 to 775 [distlib/util.py:572]
inline: 552 D changing mode of /git/tox-passenv/.tox/inline/bin/pip3.8 to 775 [distlib/util.py:572]
inline: 552 D changing mode of /git/tox-passenv/.tox/inline/bin/pip-3.8 to 775 [distlib/util.py:572]
inline: 552 D changing mode of /git/tox-passenv/.tox/inline/bin/pip to 775 [distlib/util.py:572]
inline: 552 D generated console scripts pip3 pip-3.8 pip pip3.8 [virtualenv/seed/embed/via_app_data/pip_install/base.py:41]
inline: 553 I add activators for Bash, CShell, Fish, Nushell, PowerShell, Python [virtualenv/run/session.py:61]
inline: 554 D write /git/tox-passenv/.tox/inline/pyvenv.cfg [virtualenv/create/pyenv_cfg.py:30]
inline: 554 D   home = /usr/bin [virtualenv/create/pyenv_cfg.py:34]
inline: 554 D   implementation = CPython [virtualenv/create/pyenv_cfg.py:34]
inline: 554 D   version_info = 3.8.10.final.0 [virtualenv/create/pyenv_cfg.py:34]
inline: 554 D   virtualenv = 20.17.1 [virtualenv/create/pyenv_cfg.py:34]
inline: 554 D   include-system-site-packages = false [virtualenv/create/pyenv_cfg.py:34]
inline: 555 D   base-prefix = /usr [virtualenv/create/pyenv_cfg.py:34]
inline: 555 D   base-exec-prefix = /usr [virtualenv/create/pyenv_cfg.py:34]
inline: 555 D   base-executable = /usr/bin/python3.8 [virtualenv/create/pyenv_cfg.py:34]
inline: 557 W commands[0]> python -c 'import os; print(os.environ["FOO"], os.environ["BAR"])' [tox/tox_env/api.py:398]
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3.8/os.py", line 675, in __getitem__
    raise KeyError(key) from None
KeyError: 'FOO'
inline: 584 C exit 1 (0.03 seconds) /git/tox-passenv> python -c 'import os; print(os.environ["FOO"], os.environ["BAR"])' pid=490272 [tox/execute/api.py:275]
separate-lines: 585 W remove tox env folder /git/tox-passenv/.tox/separate-lines [tox/tox_env/api.py:292]
inline: FAIL ✖ in 0.35 seconds
separate-lines: 635 I find interpreter for spec PythonSpec(path=/git/tox-passenv/tox4/bin/python3) [virtualenv/discovery/builtin.py:56]
separate-lines: 636 D discover exe from cache /usr - exact False: PythonInfo({'architecture': 64, 'base_exec_prefix': '/usr', 'base_prefix': '/usr', 'distutils_install': {'data': '', 'headers': 'include/python3.8/UNKNOWN', 'platlib': 'lib/python3.8/site-packages', 'purelib': 'lib/python3.8/site-packages', 'scripts': 'bin'}, 'exec_prefix': '/usr', 'executable': '/git/tox-passenv/tox4/bin/python3', 'file_system_encoding': 'utf-8', 'has_venv': True, 'implementation': 'CPython', 'max_size': 9223372036854775807, 'original_executable': '/usr/bin/python3.8', 'os': 'posix', 'path': ['/home/mfurer/.pytools/lib/python3.8/site-packages/virtualenv/discovery', '/usr/lib/python38.zip', '/usr/lib/python3.8', '/usr/lib/python3.8/lib-dynload', '/usr/local/lib/python3.8/dist-packages', '/usr/lib/python3/dist-packages'], 'platform': 'linux', 'prefix': '/usr', 'real_prefix': None, 'stdout_encoding': 'utf-8', 'sysconfig': {'makefile_filename': '/usr/lib/python3.8/config-3.8-x86_64-linux-gnu/Makefile'}, 'sysconfig_paths': {'data': '{base}', 'include': '{installed_base}/include/python{py_version_short}{abiflags}', 'platlib': '{platbase}/lib/python{py_version_short}/site-packages', 'platstdlib': '{platbase}/lib/python{py_version_short}', 'purelib': '{base}/lib/python{py_version_short}/site-packages', 'scripts': '{base}/bin', 'stdlib': '{installed_base}/lib/python{py_version_short}'}, 'sysconfig_scheme': None, 'sysconfig_vars': {'PYTHONFRAMEWORK': '', 'abiflags': '', 'base': '/usr', 'installed_base': '/usr', 'platbase': '/usr', 'py_version_short': '3.8'}, 'system_executable': '/usr/bin/python3.8', 'system_stdlib': '/usr/lib/python3.8', 'system_stdlib_platform': '/usr/lib/python3.8', 'version': '3.8.10 (default, Jun 22 2022, 20:18:18) \n[GCC 9.4.0]', 'version_info': VersionInfo(major=3, minor=8, micro=10, releaselevel='final', serial=0)}) [virtualenv/discovery/py_info.py:435]
separate-lines: 636 I proposed PythonInfo(spec=CPython3.8.10.final.0-64, system=/usr/bin/python3.8, exe=/git/tox-passenv/tox4/bin/python3, platform=linux, version='3.8.10 (default, Jun 22 2022, 20:18:18) \n[GCC 9.4.0]', encoding_fs_io=utf-8-utf-8) [virtualenv/discovery/builtin.py:63]
separate-lines: 636 D accepted PythonInfo(spec=CPython3.8.10.final.0-64, system=/usr/bin/python3.8, exe=/git/tox-passenv/tox4/bin/python3, platform=linux, version='3.8.10 (default, Jun 22 2022, 20:18:18) \n[GCC 9.4.0]', encoding_fs_io=utf-8-utf-8) [virtualenv/discovery/builtin.py:65]
separate-lines: 638 I create virtual environment via CPython3Posix(dest=/git/tox-passenv/.tox/separate-lines, clear=False, no_vcs_ignore=False, global=False) [virtualenv/run/session.py:48]
separate-lines: 639 D create folder /git/tox-passenv/.tox/separate-lines/bin [virtualenv/util/path/_sync.py:9]
separate-lines: 639 D create folder /git/tox-passenv/.tox/separate-lines/lib/python3.8/site-packages [virtualenv/util/path/_sync.py:9]
separate-lines: 639 D write /git/tox-passenv/.tox/separate-lines/pyvenv.cfg [virtualenv/create/pyenv_cfg.py:30]
separate-lines: 639 D   home = /usr/bin [virtualenv/create/pyenv_cfg.py:34]
separate-lines: 640 D   implementation = CPython [virtualenv/create/pyenv_cfg.py:34]
separate-lines: 640 D   version_info = 3.8.10.final.0 [virtualenv/create/pyenv_cfg.py:34]
separate-lines: 640 D   virtualenv = 20.17.1 [virtualenv/create/pyenv_cfg.py:34]
separate-lines: 640 D   include-system-site-packages = false [virtualenv/create/pyenv_cfg.py:34]
separate-lines: 640 D   base-prefix = /usr [virtualenv/create/pyenv_cfg.py:34]
separate-lines: 641 D   base-exec-prefix = /usr [virtualenv/create/pyenv_cfg.py:34]
separate-lines: 641 D   base-executable = /usr/bin/python3.8 [virtualenv/create/pyenv_cfg.py:34]
separate-lines: 641 D symlink /usr/bin/python3.8 to /git/tox-passenv/.tox/separate-lines/bin/python [virtualenv/util/path/_sync.py:28]
separate-lines: 642 D create virtualenv import hook file /git/tox-passenv/.tox/separate-lines/lib/python3.8/site-packages/_virtualenv.pth [virtualenv/create/via_global_ref/api.py:89]
separate-lines: 642 D create /git/tox-passenv/.tox/separate-lines/lib/python3.8/site-packages/_virtualenv.py [virtualenv/create/via_global_ref/api.py:92]
separate-lines: 642 D ============================== target debug ============================== [virtualenv/run/session.py:50]
separate-lines: 643 D debug via /git/tox-passenv/.tox/separate-lines/bin/python /git/tox-passenv/tox4/lib/python3.8/site-packages/virtualenv/create/debug.py [virtualenv/create/creator.py:197]
separate-lines: 642 D {
  "sys": {
    "executable": "/git/tox-passenv/.tox/separate-lines/bin/python",
    "_base_executable": "/git/tox-passenv/.tox/separate-lines/bin/python",
    "prefix": "/git/tox-passenv/.tox/separate-lines",
    "base_prefix": "/usr",
    "real_prefix": null,
    "exec_prefix": "/git/tox-passenv/.tox/separate-lines",
    "base_exec_prefix": "/usr",
    "path": [
      "/usr/lib/python38.zip",
      "/usr/lib/python3.8",
      "/usr/lib/python3.8/lib-dynload",
      "/git/tox-passenv/.tox/separate-lines/lib/python3.8/site-packages"
    ],
    "meta_path": [
      "<class '_virtualenv._Finder'>",
      "<class '_frozen_importlib.BuiltinImporter'>",
      "<class '_frozen_importlib.FrozenImporter'>",
      "<class '_frozen_importlib_external.PathFinder'>"
    ],
    "fs_encoding": "utf-8",
    "io_encoding": "utf-8"
  },
  "version": "3.8.10 (default, Jun 22 2022, 20:18:18) \n[GCC 9.4.0]",
  "makefile_filename": "/usr/lib/python3.8/config-3.8-x86_64-linux-gnu/Makefile",
  "os": "<module 'os' from '/usr/lib/python3.8/os.py'>",
  "site": "<module 'site' from '/usr/lib/python3.8/site.py'>",
  "datetime": "<module 'datetime' from '/usr/lib/python3.8/datetime.py'>",
  "math": "<module 'math' (built-in)>",
  "json": "<module 'json' from '/usr/lib/python3.8/json/__init__.py'>"
} [virtualenv/run/session.py:51]
separate-lines: 681 I add seed packages via FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/mfurer/.local/share/virtualenv) [virtualenv/run/session.py:55]
separate-lines: 685 D got embed update of distribution setuptools from /home/mfurer/.local/share/virtualenv/wheel/3.8/embed/3/setuptools.json [virtualenv/app_data/via_disk_folder.py:129]
separate-lines: 688 D got embed update of distribution pip from /home/mfurer/.local/share/virtualenv/wheel/3.8/embed/3/pip.json [virtualenv/app_data/via_disk_folder.py:129]
separate-lines: 689 D got embed update of distribution wheel from /home/mfurer/.local/share/virtualenv/wheel/3.8/embed/3/wheel.json [virtualenv/app_data/via_disk_folder.py:129]
separate-lines: 689 D install setuptools from wheel /git/tox-passenv/tox4/lib/python3.8/site-packages/virtualenv/seed/wheels/embed/setuptools-65.6.3-py3-none-any.whl via CopyPipInstall [virtualenv/seed/embed/via_app_data/via_app_data.py:47]
separate-lines: 689 D install pip from wheel /git/tox-passenv/tox4/lib/python3.8/site-packages/virtualenv/seed/wheels/embed/pip-22.3.1-py3-none-any.whl via CopyPipInstall [virtualenv/seed/embed/via_app_data/via_app_data.py:47]
separate-lines: 690 D install wheel from wheel /git/tox-passenv/tox4/lib/python3.8/site-packages/virtualenv/seed/wheels/embed/wheel-0.38.4-py3-none-any.whl via CopyPipInstall [virtualenv/seed/embed/via_app_data/via_app_data.py:47]
separate-lines: 690 D Attempting to acquire lock 139846150917712 on /home/mfurer/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/setuptools-65.6.3-py3-none-any.lock [filelock/_api.py:172]
separate-lines: 691 D Attempting to acquire lock 139846150868032 on /home/mfurer/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/wheel-0.38.4-py3-none-any.lock [filelock/_api.py:172]
separate-lines: 691 D Lock 139846150917712 acquired on /home/mfurer/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/setuptools-65.6.3-py3-none-any.lock [filelock/_api.py:176]
separate-lines: 691 D Attempting to acquire lock 139846150867216 on /home/mfurer/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/pip-22.3.1-py3-none-any.lock [filelock/_api.py:172]
separate-lines: 691 D Lock 139846150868032 acquired on /home/mfurer/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/wheel-0.38.4-py3-none-any.lock [filelock/_api.py:176]
separate-lines: 692 D Attempting to release lock 139846150917712 on /home/mfurer/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/setuptools-65.6.3-py3-none-any.lock [filelock/_api.py:209]
separate-lines: 692 D Lock 139846150867216 acquired on /home/mfurer/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/pip-22.3.1-py3-none-any.lock [filelock/_api.py:176]
separate-lines: 692 D Lock 139846150917712 released on /home/mfurer/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/setuptools-65.6.3-py3-none-any.lock [filelock/_api.py:212]
separate-lines: 692 D Attempting to release lock 139846150868032 on /home/mfurer/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/wheel-0.38.4-py3-none-any.lock [filelock/_api.py:209]
separate-lines: 693 D Attempting to release lock 139846150867216 on /home/mfurer/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/pip-22.3.1-py3-none-any.lock [filelock/_api.py:209]
separate-lines: 693 D Lock 139846150868032 released on /home/mfurer/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/wheel-0.38.4-py3-none-any.lock [filelock/_api.py:212]
separate-lines: 693 D Lock 139846150867216 released on /home/mfurer/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/pip-22.3.1-py3-none-any.lock [filelock/_api.py:212]
separate-lines: 694 D copy /home/mfurer/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/setuptools-65.6.3-py3-none-any/distutils-precedence.pth to /git/tox-passenv/.tox/separate-lines/lib/python3.8/site-packages/distutils-precedence.pth [virtualenv/util/path/_sync.py:36]
separate-lines: 694 D copy directory /home/mfurer/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/wheel-0.38.4-py3-none-any/wheel-0.38.4.dist-info to /git/tox-passenv/.tox/separate-lines/lib/python3.8/site-packages/wheel-0.38.4.dist-info [virtualenv/util/path/_sync.py:36]
separate-lines: 695 D copy /home/mfurer/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/pip-22.3.1-py3-none-any/pip-22.3.1.virtualenv to /git/tox-passenv/.tox/separate-lines/lib/python3.8/site-packages/pip-22.3.1.virtualenv [virtualenv/util/path/_sync.py:36]
separate-lines: 695 D copy directory /home/mfurer/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/setuptools-65.6.3-py3-none-any/pkg_resources to /git/tox-passenv/.tox/separate-lines/lib/python3.8/site-packages/pkg_resources [virtualenv/util/path/_sync.py:36]
separate-lines: 696 D copy directory /home/mfurer/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/pip-22.3.1-py3-none-any/pip-22.3.1.dist-info to /git/tox-passenv/.tox/separate-lines/lib/python3.8/site-packages/pip-22.3.1.dist-info [virtualenv/util/path/_sync.py:36]
separate-lines: 701 D copy /home/mfurer/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/wheel-0.38.4-py3-none-any/wheel-0.38.4.virtualenv to /git/tox-passenv/.tox/separate-lines/lib/python3.8/site-packages/wheel-0.38.4.virtualenv [virtualenv/util/path/_sync.py:36]
separate-lines: 702 D copy directory /home/mfurer/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/wheel-0.38.4-py3-none-any/wheel to /git/tox-passenv/.tox/separate-lines/lib/python3.8/site-packages/wheel [virtualenv/util/path/_sync.py:36]
separate-lines: 704 D copy directory /home/mfurer/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/pip-22.3.1-py3-none-any/pip to /git/tox-passenv/.tox/separate-lines/lib/python3.8/site-packages/pip [virtualenv/util/path/_sync.py:36]
separate-lines: 719 D changing mode of /git/tox-passenv/.tox/separate-lines/bin/wheel3.8 to 775 [distlib/util.py:572]
separate-lines: 720 D changing mode of /git/tox-passenv/.tox/separate-lines/bin/wheel-3.8 to 775 [distlib/util.py:572]
separate-lines: 720 D changing mode of /git/tox-passenv/.tox/separate-lines/bin/wheel to 775 [distlib/util.py:572]
separate-lines: 721 D changing mode of /git/tox-passenv/.tox/separate-lines/bin/wheel3 to 775 [distlib/util.py:572]
separate-lines: 721 D generated console scripts wheel wheel3 wheel3.8 wheel-3.8 [virtualenv/seed/embed/via_app_data/pip_install/base.py:41]
separate-lines: 729 D copy directory /home/mfurer/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/setuptools-65.6.3-py3-none-any/_distutils_hack to /git/tox-passenv/.tox/separate-lines/lib/python3.8/site-packages/_distutils_hack [virtualenv/util/path/_sync.py:36]
separate-lines: 730 D copy directory /home/mfurer/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/setuptools-65.6.3-py3-none-any/setuptools to /git/tox-passenv/.tox/separate-lines/lib/python3.8/site-packages/setuptools [virtualenv/util/path/_sync.py:36]
separate-lines: 799 D copy /home/mfurer/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/setuptools-65.6.3-py3-none-any/setuptools-65.6.3.virtualenv to /git/tox-passenv/.tox/separate-lines/lib/python3.8/site-packages/setuptools-65.6.3.virtualenv [virtualenv/util/path/_sync.py:36]
separate-lines: 800 D copy directory /home/mfurer/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/setuptools-65.6.3-py3-none-any/setuptools-65.6.3.dist-info to /git/tox-passenv/.tox/separate-lines/lib/python3.8/site-packages/setuptools-65.6.3.dist-info [virtualenv/util/path/_sync.py:36]
separate-lines: 805 D generated console scripts  [virtualenv/seed/embed/via_app_data/pip_install/base.py:41]
separate-lines: 859 D changing mode of /git/tox-passenv/.tox/separate-lines/bin/pip3 to 775 [distlib/util.py:572]
separate-lines: 859 D changing mode of /git/tox-passenv/.tox/separate-lines/bin/pip3.8 to 775 [distlib/util.py:572]
separate-lines: 859 D changing mode of /git/tox-passenv/.tox/separate-lines/bin/pip-3.8 to 775 [distlib/util.py:572]
separate-lines: 859 D changing mode of /git/tox-passenv/.tox/separate-lines/bin/pip to 775 [distlib/util.py:572]
separate-lines: 860 D generated console scripts pip3.8 pip pip3 pip-3.8 [virtualenv/seed/embed/via_app_data/pip_install/base.py:41]
separate-lines: 860 I add activators for Bash, CShell, Fish, Nushell, PowerShell, Python [virtualenv/run/session.py:61]
separate-lines: 862 D write /git/tox-passenv/.tox/separate-lines/pyvenv.cfg [virtualenv/create/pyenv_cfg.py:30]
separate-lines: 862 D   home = /usr/bin [virtualenv/create/pyenv_cfg.py:34]
separate-lines: 862 D   implementation = CPython [virtualenv/create/pyenv_cfg.py:34]
separate-lines: 862 D   version_info = 3.8.10.final.0 [virtualenv/create/pyenv_cfg.py:34]
separate-lines: 862 D   virtualenv = 20.17.1 [virtualenv/create/pyenv_cfg.py:34]
separate-lines: 863 D   include-system-site-packages = false [virtualenv/create/pyenv_cfg.py:34]
separate-lines: 863 D   base-prefix = /usr [virtualenv/create/pyenv_cfg.py:34]
separate-lines: 863 D   base-exec-prefix = /usr [virtualenv/create/pyenv_cfg.py:34]
separate-lines: 863 D   base-executable = /usr/bin/python3.8 [virtualenv/create/pyenv_cfg.py:34]
separate-lines: 866 W commands[0]> python -c 'import os; print(os.environ["FOO"], os.environ["BAR"])' [tox/tox_env/api.py:398]
foo bar
separate-lines: 892 I exit 0 (0.02 seconds) /git/tox-passenv> python -c 'import os; print(os.environ["FOO"], os.environ["BAR"])' pid=490285 [tox/execute/api.py:275]
  inline: FAIL code 1 (0.35=setup[0.32]+cmd[0.03] seconds)
  separate-lines: OK (0.31=setup[0.28]+cmd[0.02] seconds)
  evaluation failed :( (0.73 seconds)

Minimal example

[tox]
skipsdist = true
envlist =
    inline, separate-lines

[testenv]
commands =
    python -c 'import os; print(os.environ["FOO"], os.environ["BAR"])'

[testenv:inline]
passenv = FOO BAR

[testenv:separate-lines]
passenv =
    FOO
    BAR
#!/usr/bin/env sh

set -x

export FOO=foo
export BAR=bar

python3 -m venv tox3 && ./tox3/bin/pip install 'tox < 4'
./tox3/bin/tox
python3 -m venv tox4 && ./tox4/bin/pip install 'tox >= 4'
./tox4/bin/tox
@gaborbernat
Copy link
Member

gaborbernat commented Dec 7, 2022

I'll need to see if we can support this, or we'll mark this as a known breaking change 🤔 in the meantime can spread it over multiple lines as a workaround. If you have time PR is welcome.

@gaborbernat gaborbernat added the bug:normal affects many people or has quite an impact label Dec 7, 2022
@gaborbernat gaborbernat added this to the 4.0.x milestone Dec 7, 2022
@zsimic
Copy link

zsimic commented Dec 7, 2022

Please make it work with spaces :) otherwise hundreds of projects will have to change, and some of mine will need to list a dozen lines... would be awesome if this was not a breaking change

@gaborbernat
Copy link
Member

Well, asking is easy, making it much harder and might have other ramifications in other places 🤷 sensible PRs welcome.

@gaborbernat
Copy link
Member

gaborbernat commented Dec 8, 2022

For what is worth while separating the variables with space does not work, you can still put these in one line by using instead the , separator:

[testenv:inline]
passenv = FOO, BAR

instead of

[testenv:inline]
passenv = FOO BAR

Took a look at the codebase, and there's no easy way to support space without significant problems in other areas, so we'll just have to document this as breaking change with the here described workaround (use , instead of if you want to have these in one line).

@gaborbernat gaborbernat added area:documentation and removed bug:normal affects many people or has quite an impact labels Dec 8, 2022
@hynek
Copy link

hynek commented Dec 8, 2022

May I suggest to add this to the upgrade FAQ?

@jugmac00
Copy link
Member

jugmac00 commented Dec 8, 2022

May I suggest to add this to the upgrade FAQ?

That is an excellent suggestion. I will create a PR once I have a chance.

@gaborbernat gaborbernat added the help:wanted Issues that have been acknowledged, a solution determined and a PR might likely be accepted. label Dec 8, 2022
masenf added a commit to masenf/coveralls-python that referenced this issue Dec 11, 2022
tox4 no longer allows space-separated `passenv`
tox-dev/tox#2615

however tox3 doesn't support `VAR, ` either

so to support both versions of tox, use this funky space + comma separated
syntax, which really does work.
pmderodat added a commit to pmderodat/e3-testsuite that referenced this issue Jan 11, 2023
pmderodat added a commit to AdaCore/e3-testsuite that referenced this issue Jan 11, 2023
michael-the1 added a commit to PicnicSupermarket/diepvries that referenced this issue Mar 1, 2023
Due to a regression in tox, passenv now needs a comma separated list.

This is necessary for our CI to upload to PyPI automagically. See tox-dev/tox#2615 for more info.
TheKevJames pushed a commit to TheKevJames/coveralls-python that referenced this issue Apr 26, 2024
tox4 no longer allows space-separated `passenv`:
tox-dev/tox#2615

however tox3 doesn't support `VAR, `

so to support both versions of tox, use this funky space + comma 
separated syntax, which really does work.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:documentation help:wanted Issues that have been acknowledged, a solution determined and a PR might likely be accepted.
Projects
None yet
5 participants