Open masenf opened 1 year ago
a workaround is prefixing each line with the specific factor
[tox]
envlist = foo,bar
minversion = 4.4.4
[testenv]
commands:
foo: python -c "\
foo: print('foo')"
python -c "print('bar')"
Hmm, I would have been surprised if 1 worked; I would have recommended people use option 2. 🤔 Though guess can swap the order of filter and line collapse to allow 1 to work too.
Issue
Additional lines of a factor-specific multiline command are not removed when the factor is not present.
Environment
Provide at least:
pip list
of the host Python wheretox
is installed:Output of running tox
☝️ Notice how the continuation line from the
foo:
specific command was executed inbar
's environment. Would have expected thebar
environment to only executepython -c "print('bar')"
Provide the output of `tox -rvv`:
```console ROOT: 1319 W will run in automatically provisioned tox, host /home/mfurer/.pytools/bin/python is missing [requires (has)]: tox>=4.4.4 (4.4.3) [tox/provision.py:125] ROOT: 1381 I find interpreter for spec PythonSpec(path=/home/mfurer/.pytools/bin/python) [virtualenv/discovery/builtin.py:56] ROOT: 1381 D discover exe for PythonInfo(spec=CPython3.8.10.final.0-64, exe=/home/mfurer/.pytools/bin/python, platform=linux, version='3.8.10 (default, Nov 14 2022, 12:59:47) \n[GCC 9.4.0]', encoding_fs_io=utf-8-utf-8) in /usr [virtualenv/discovery/py_info.py:437] ROOT: 1383 D filesystem is case-sensitive [virtualenv/info.py:24] ROOT: 1386 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] ROOT: 1980 I proposed PythonInfo(spec=CPython3.8.10.final.0-64, system=/usr/bin/python3.8, exe=/home/mfurer/.pytools/bin/python, platform=linux, version='3.8.10 (default, Nov 14 2022, 12:59:47) \n[GCC 9.4.0]', encoding_fs_io=utf-8-utf-8) [virtualenv/discovery/builtin.py:63] ROOT: 1980 D accepted PythonInfo(spec=CPython3.8.10.final.0-64, system=/usr/bin/python3.8, exe=/home/mfurer/.pytools/bin/python, platform=linux, version='3.8.10 (default, Nov 14 2022, 12:59:47) \n[GCC 9.4.0]', encoding_fs_io=utf-8-utf-8) [virtualenv/discovery/builtin.py:65] ROOT: 2029 I will run in a automatically provisioned python environment under /git/repro/tox-list-label/.tox/.tox/bin/python [tox/provision.py:146] ROOT: 2040 I create virtual environment via CPython3Posix(dest=/git/repro/tox-list-label/.tox/.tox, clear=False, no_vcs_ignore=False, global=False) [virtualenv/run/session.py:48] ROOT: 2040 D create folder /git/repro/tox-list-label/.tox/.tox/bin [virtualenv/util/path/_sync.py:9] ROOT: 2041 D create folder /git/repro/tox-list-label/.tox/.tox/lib/python3.8/site-packages [virtualenv/util/path/_sync.py:9] ROOT: 2041 D write /git/repro/tox-list-label/.tox/.tox/pyvenv.cfg [virtualenv/create/pyenv_cfg.py:30] ROOT: 2041 D home = /usr/bin [virtualenv/create/pyenv_cfg.py:34] ROOT: 2041 D implementation = CPython [virtualenv/create/pyenv_cfg.py:34] ROOT: 2042 D version_info = 3.8.10.final.0 [virtualenv/create/pyenv_cfg.py:34] ROOT: 2042 D virtualenv = 20.17.1 [virtualenv/create/pyenv_cfg.py:34] ROOT: 2042 D include-system-site-packages = false [virtualenv/create/pyenv_cfg.py:34] ROOT: 2042 D base-prefix = /usr [virtualenv/create/pyenv_cfg.py:34] ROOT: 2042 D base-exec-prefix = /usr [virtualenv/create/pyenv_cfg.py:34] ROOT: 2042 D base-executable = /usr/bin/python3.8 [virtualenv/create/pyenv_cfg.py:34] ROOT: 2045 D symlink /usr/bin/python3.8 to /git/repro/tox-list-label/.tox/.tox/bin/python [virtualenv/util/path/_sync.py:28] ROOT: 2047 D create virtualenv import hook file /git/repro/tox-list-label/.tox/.tox/lib/python3.8/site-packages/_virtualenv.pth [virtualenv/create/via_global_ref/api.py:89] ROOT: 2047 D create /git/repro/tox-list-label/.tox/.tox/lib/python3.8/site-packages/_virtualenv.py [virtualenv/create/via_global_ref/api.py:92] ROOT: 2049 D ============================== target debug ============================== [virtualenv/run/session.py:50] ROOT: 2049 D debug via /git/repro/tox-list-label/.tox/.tox/bin/python /home/mfurer/.pytools/lib/python3.8/site-packages/virtualenv/create/debug.py [virtualenv/create/creator.py:197] ROOT: 2049 D { "sys": { "executable": "/git/repro/tox-list-label/.tox/.tox/bin/python", "_base_executable": "/git/repro/tox-list-label/.tox/.tox/bin/python", "prefix": "/git/repro/tox-list-label/.tox/.tox", "base_prefix": "/usr", "real_prefix": null, "exec_prefix": "/git/repro/tox-list-label/.tox/.tox", "base_exec_prefix": "/usr", "path": [ "/usr/lib/python38.zip", "/usr/lib/python3.8", "/usr/lib/python3.8/lib-dynload", "/git/repro/tox-list-label/.tox/.tox/lib/python3.8/site-packages" ], "meta_path": [ "Minimal example
If possible, provide a minimal reproducer for the issue: