You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ostackbrian opened this issue
Jan 6, 2023
· 1 comment
Labels
bug:minordoes not affect many people or has no big impacthelp:wantedIssues that have been acknowledged, a solution determined and a PR might likely be accepted.
I'm not sure if this is a regression, or if I am using a bad pattern that worked by chance in tox3.
I use the base [testenv] to set_env some vars and run unit tests. Then I have a [testenv:functional] that inherits these env vars (most of which are still relevant) but changes the var governing where the tests are located. I use that as an "abstract" testenv to hold the setenv, commands, etc., for python-version-specific testenvs like [testenv:functional-py39], [testenv:functional-py310], etc. In tox3 this worked great, but in tox 4, the changes to set_env in the "abstract" testenv aren't picked up when I call 'tox -e functional-py39'.
Here's a tox.ini for this that works in both tox3 and tox4.
❯ ./tox4 -rvvpy39: 83 W remove tox env folder /home/brosmait/scratch/lang/python/tox/.tox/py39 [tox/tox_env/api.py:321]py39: 103 I find interpreter for spec PythonSpec(major=3, minor=9) [virtualenv/discovery/builtin.py:56]py39: 103 D discover exe for PythonInfo(spec=CPython3.10.9.final.0-64, exe=/home/brosmait/repos/openstack/python-cinderclient/.tox/.tox/bin/python, platform=linux, version='3.10.9 (main, Dec 7 2022, 00:00:00) [GCC 12.2.1 20221121 (Red Hat 12.2.1-4)]', encoding_fs_io=utf-8-utf-8) in /usr [virtualenv/discovery/py_info.py:437]py39: 103 D filesystem is case-sensitive [virtualenv/info.py:24]py39: 103 D got python info of /usr/bin/python3.10 from /home/brosmait/.local/share/virtualenv/py_info/1/8a94588eda9d64d9e9a351ab8144e55b1fabf5113b54e67dd26a8c27df0381b3.json [virtualenv/app_data/via_disk_folder.py:129]py39: 104 I proposed PythonInfo(spec=CPython3.10.9.final.0-64, system=/usr/bin/python3.10, exe=/home/brosmait/repos/openstack/python-cinderclient/.tox/.tox/bin/python, platform=linux, version='3.10.9 (main, Dec 7 2022, 00:00:00) [GCC 12.2.1 20221121 (Red Hat 12.2.1-4)]', encoding_fs_io=utf-8-utf-8) [virtualenv/discovery/builtin.py:63]py39: 104 D discover PATH[0]=/home/brosmait/.pyenv/plugins/pyenv-virtualenv/shims [virtualenv/discovery/builtin.py:108]py39: 104 D discover PATH[1]=/home/brosmait/.pyenv/shims [virtualenv/discovery/builtin.py:108]py39: 104 D got python info of /home/brosmait/.pyenv/shims/python3.9 from /home/brosmait/.local/share/virtualenv/py_info/1/df5750520713fe69cbf62cb311668a6a03aa778e2b7543129d2ab17ce2716c13.json [virtualenv/app_data/via_disk_folder.py:129]py39: 105 D got python info of /home/brosmait/.pyenv/versions/3.9.14/bin/python3.9 from /home/brosmait/.local/share/virtualenv/py_info/1/e9b605bd999ef794c335c758558757307e733b618c62dd3ca2fa6d9c79695fff.json [virtualenv/app_data/via_disk_folder.py:129]py39: 105 I proposed PathPythonInfo(spec=CPython3.9.14.final.0-64, system=/home/brosmait/.pyenv/versions/3.9.14/bin/python3.9, exe=/home/brosmait/.pyenv/shims/python3.9, platform=linux, version='3.9.14 (main, Oct 4 2022, 17:06:42) \n[GCC 12.2.1 20220819 (Red Hat 12.2.1-2)]', encoding_fs_io=utf-8-utf-8) [virtualenv/discovery/builtin.py:63]py39: 105 D accepted PathPythonInfo(spec=CPython3.9.14.final.0-64, system=/home/brosmait/.pyenv/versions/3.9.14/bin/python3.9, exe=/home/brosmait/.pyenv/shims/python3.9, platform=linux, version='3.9.14 (main, Oct 4 2022, 17:06:42) \n[GCC 12.2.1 20220819 (Red Hat 12.2.1-2)]', encoding_fs_io=utf-8-utf-8) [virtualenv/discovery/builtin.py:65]py39: 120 I create virtual environment via CPython3Posix(dest=/home/brosmait/scratch/lang/python/tox/.tox/py39, clear=False, no_vcs_ignore=False, global=False) [virtualenv/run/session.py:48]py39: 120 D create folder /home/brosmait/scratch/lang/python/tox/.tox/py39/bin [virtualenv/util/path/_sync.py:9]py39: 120 D create folder /home/brosmait/scratch/lang/python/tox/.tox/py39/lib/python3.9/site-packages [virtualenv/util/path/_sync.py:9]py39: 120 D write /home/brosmait/scratch/lang/python/tox/.tox/py39/pyvenv.cfg [virtualenv/create/pyenv_cfg.py:30]py39: 120 D home = /home/brosmait/.pyenv/versions/3.9.14/bin [virtualenv/create/pyenv_cfg.py:34]py39: 120 D implementation = CPython [virtualenv/create/pyenv_cfg.py:34]py39: 120 D version_info = 3.9.14.final.0 [virtualenv/create/pyenv_cfg.py:34]py39: 120 D virtualenv = 20.17.1 [virtualenv/create/pyenv_cfg.py:34]py39: 120 D include-system-site-packages = false [virtualenv/create/pyenv_cfg.py:34]py39: 120 D base-prefix = /home/brosmait/.pyenv/versions/3.9.14 [virtualenv/create/pyenv_cfg.py:34]py39: 120 D base-exec-prefix = /home/brosmait/.pyenv/versions/3.9.14 [virtualenv/create/pyenv_cfg.py:34]py39: 120 D base-executable = /home/brosmait/.pyenv/versions/3.9.14/bin/python3.9 [virtualenv/create/pyenv_cfg.py:34]py39: 120 D symlink /home/brosmait/.pyenv/versions/3.9.14/bin/python3.9 to /home/brosmait/scratch/lang/python/tox/.tox/py39/bin/python [virtualenv/util/path/_sync.py:28]py39: 121 D create virtualenv import hook file /home/brosmait/scratch/lang/python/tox/.tox/py39/lib/python3.9/site-packages/_virtualenv.pth [virtualenv/create/via_global_ref/api.py:89]py39: 121 D create /home/brosmait/scratch/lang/python/tox/.tox/py39/lib/python3.9/site-packages/_virtualenv.py [virtualenv/create/via_global_ref/api.py:92]py39: 121 D ============================== target debug ============================== [virtualenv/run/session.py:50]py39: 121 D debug via /home/brosmait/scratch/lang/python/tox/.tox/py39/bin/python /home/brosmait/repos/openstack/python-cinderclient/.tox/.tox/lib/python3.10/site-packages/virtualenv/create/debug.py [virtualenv/create/creator.py:197]py39: 121 D { "sys": { "executable": "/home/brosmait/scratch/lang/python/tox/.tox/py39/bin/python", "_base_executable": "/home/brosmait/scratch/lang/python/tox/.tox/py39/bin/python", "prefix": "/home/brosmait/scratch/lang/python/tox/.tox/py39", "base_prefix": "/home/brosmait/.pyenv/versions/3.9.14", "real_prefix": null, "exec_prefix": "/home/brosmait/scratch/lang/python/tox/.tox/py39", "base_exec_prefix": "/home/brosmait/.pyenv/versions/3.9.14", "path": [ "/home/brosmait/.pyenv/versions/3.9.14/lib/python39.zip", "/home/brosmait/.pyenv/versions/3.9.14/lib/python3.9", "/home/brosmait/.pyenv/versions/3.9.14/lib/python3.9/lib-dynload", "/home/brosmait/scratch/lang/python/tox/.tox/py39/lib/python3.9/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.9.14 (main, Oct 4 2022, 17:06:42) \n[GCC 12.2.1 20220819 (Red Hat 12.2.1-2)]", "makefile_filename": "/home/brosmait/.pyenv/versions/3.9.14/lib/python3.9/config-3.9-x86_64-linux-gnu/Makefile", "os": "<module 'os' from '/home/brosmait/.pyenv/versions/3.9.14/lib/python3.9/os.py'>", "site": "<module 'site' from '/home/brosmait/.pyenv/versions/3.9.14/lib/python3.9/site.py'>", "datetime": "<module 'datetime' from '/home/brosmait/.pyenv/versions/3.9.14/lib/python3.9/datetime.py'>", "math": "<module 'math' from '/home/brosmait/.pyenv/versions/3.9.14/lib/python3.9/lib-dynload/math.cpython-39-x86_64-linux-gnu.so'>", "json": "<module 'json' from '/home/brosmait/.pyenv/versions/3.9.14/lib/python3.9/json/__init__.py'>"} [virtualenv/run/session.py:51]py39: 136 I add seed packages via FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/brosmait/.local/share/virtualenv) [virtualenv/run/session.py:55]py39: 137 D install setuptools from wheel /home/brosmait/repos/openstack/python-cinderclient/.tox/.tox/lib/python3.10/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]py39: 137 D install pip from wheel /home/brosmait/repos/openstack/python-cinderclient/.tox/.tox/lib/python3.10/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]py39: 137 D install wheel from wheel /home/brosmait/repos/openstack/python-cinderclient/.tox/.tox/lib/python3.10/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]py39: 138 D copy /home/brosmait/.local/share/virtualenv/wheel/3.9/image/1/CopyPipInstall/setuptools-65.6.3-py3-none-any/distutils-precedence.pth to /home/brosmait/scratch/lang/python/tox/.tox/py39/lib/python3.9/site-packages/distutils-precedence.pth [virtualenv/util/path/_sync.py:36]py39: 138 D copy directory /home/brosmait/.local/share/virtualenv/wheel/3.9/image/1/CopyPipInstall/wheel-0.38.4-py3-none-any/wheel to /home/brosmait/scratch/lang/python/tox/.tox/py39/lib/python3.9/site-packages/wheel [virtualenv/util/path/_sync.py:36]py39: 138 D copy directory /home/brosmait/.local/share/virtualenv/wheel/3.9/image/1/CopyPipInstall/pip-22.3.1-py3-none-any/pip to /home/brosmait/scratch/lang/python/tox/.tox/py39/lib/python3.9/site-packages/pip [virtualenv/util/path/_sync.py:36]py39: 138 D copy directory /home/brosmait/.local/share/virtualenv/wheel/3.9/image/1/CopyPipInstall/setuptools-65.6.3-py3-none-any/_distutils_hack to /home/brosmait/scratch/lang/python/tox/.tox/py39/lib/python3.9/site-packages/_distutils_hack [virtualenv/util/path/_sync.py:36]py39: 139 D copy directory /home/brosmait/.local/share/virtualenv/wheel/3.9/image/1/CopyPipInstall/setuptools-65.6.3-py3-none-any/pkg_resources to /home/brosmait/scratch/lang/python/tox/.tox/py39/lib/python3.9/site-packages/pkg_resources [virtualenv/util/path/_sync.py:36]py39: 142 D copy directory /home/brosmait/.local/share/virtualenv/wheel/3.9/image/1/CopyPipInstall/wheel-0.38.4-py3-none-any/wheel-0.38.4.dist-info to /home/brosmait/scratch/lang/python/tox/.tox/py39/lib/python3.9/site-packages/wheel-0.38.4.dist-info [virtualenv/util/path/_sync.py:36]py39: 143 D copy /home/brosmait/.local/share/virtualenv/wheel/3.9/image/1/CopyPipInstall/wheel-0.38.4-py3-none-any/wheel-0.38.4.virtualenv to /home/brosmait/scratch/lang/python/tox/.tox/py39/lib/python3.9/site-packages/wheel-0.38.4.virtualenv [virtualenv/util/path/_sync.py:36]py39: 144 D generated console scripts wheel-3.9 wheel wheel3 wheel3.9 [virtualenv/seed/embed/via_app_data/pip_install/base.py:41]py39: 147 D copy directory /home/brosmait/.local/share/virtualenv/wheel/3.9/image/1/CopyPipInstall/setuptools-65.6.3-py3-none-any/setuptools to /home/brosmait/scratch/lang/python/tox/.tox/py39/lib/python3.9/site-packages/setuptools [virtualenv/util/path/_sync.py:36]py39: 165 D copy directory /home/brosmait/.local/share/virtualenv/wheel/3.9/image/1/CopyPipInstall/setuptools-65.6.3-py3-none-any/setuptools-65.6.3.dist-info to /home/brosmait/scratch/lang/python/tox/.tox/py39/lib/python3.9/site-packages/setuptools-65.6.3.dist-info [virtualenv/util/path/_sync.py:36]py39: 166 D copy /home/brosmait/.local/share/virtualenv/wheel/3.9/image/1/CopyPipInstall/setuptools-65.6.3-py3-none-any/setuptools-65.6.3.virtualenv to /home/brosmait/scratch/lang/python/tox/.tox/py39/lib/python3.9/site-packages/setuptools-65.6.3.virtualenv [virtualenv/util/path/_sync.py:36]py39: 166 D generated console scripts [virtualenv/seed/embed/via_app_data/pip_install/base.py:41]py39: 178 D copy directory /home/brosmait/.local/share/virtualenv/wheel/3.9/image/1/CopyPipInstall/pip-22.3.1-py3-none-any/pip-22.3.1.dist-info to /home/brosmait/scratch/lang/python/tox/.tox/py39/lib/python3.9/site-packages/pip-22.3.1.dist-info [virtualenv/util/path/_sync.py:36]py39: 178 D copy /home/brosmait/.local/share/virtualenv/wheel/3.9/image/1/CopyPipInstall/pip-22.3.1-py3-none-any/pip-22.3.1.virtualenv to /home/brosmait/scratch/lang/python/tox/.tox/py39/lib/python3.9/site-packages/pip-22.3.1.virtualenv [virtualenv/util/path/_sync.py:36]py39: 179 D generated console scripts pip3.9 pip pip-3.9 pip3 [virtualenv/seed/embed/via_app_data/pip_install/base.py:41]py39: 179 I add activators for Bash, CShell, Fish, Nushell, PowerShell, Python [virtualenv/run/session.py:61]py39: 180 D write /home/brosmait/scratch/lang/python/tox/.tox/py39/pyvenv.cfg [virtualenv/create/pyenv_cfg.py:30]py39: 180 D home = /home/brosmait/.pyenv/versions/3.9.14/bin [virtualenv/create/pyenv_cfg.py:34]py39: 180 D implementation = CPython [virtualenv/create/pyenv_cfg.py:34]py39: 180 D version_info = 3.9.14.final.0 [virtualenv/create/pyenv_cfg.py:34]py39: 180 D virtualenv = 20.17.1 [virtualenv/create/pyenv_cfg.py:34]py39: 180 D include-system-site-packages = false [virtualenv/create/pyenv_cfg.py:34]py39: 180 D base-prefix = /home/brosmait/.pyenv/versions/3.9.14 [virtualenv/create/pyenv_cfg.py:34]py39: 180 D base-exec-prefix = /home/brosmait/.pyenv/versions/3.9.14 [virtualenv/create/pyenv_cfg.py:34]py39: 180 D base-executable = /home/brosmait/.pyenv/versions/3.9.14/bin/python3.9 [virtualenv/create/pyenv_cfg.py:34]py39: 181 W commands[0]> bash ts.sh testenv [tox/tox_env/api.py:427]py39: 183 I exit 0 (0.00 seconds) /home/brosmait/scratch/lang/python/tox> bash ts.sh testenv pid=315709 [tox/execute/api.py:275]py39: OK ✔ in 0.1 secondsfunctional-py39: 183 W remove tox env folder /home/brosmait/scratch/lang/python/tox/.tox/functional-py39 [tox/tox_env/api.py:321]functional-py39: 201 I find interpreter for spec PythonSpec(major=3, minor=9) [virtualenv/discovery/builtin.py:56]functional-py39: 201 I proposed PythonInfo(spec=CPython3.10.9.final.0-64, system=/usr/bin/python3.10, exe=/home/brosmait/repos/openstack/python-cinderclient/.tox/.tox/bin/python, platform=linux, version='3.10.9 (main, Dec 7 2022, 00:00:00) [GCC 12.2.1 20221121 (Red Hat 12.2.1-4)]', encoding_fs_io=utf-8-utf-8) [virtualenv/discovery/builtin.py:63]functional-py39: 201 D discover PATH[0]=/home/brosmait/.pyenv/plugins/pyenv-virtualenv/shims [virtualenv/discovery/builtin.py:108]functional-py39: 202 D discover PATH[1]=/home/brosmait/.pyenv/shims [virtualenv/discovery/builtin.py:108]functional-py39: 202 I proposed PathPythonInfo(spec=CPython3.9.14.final.0-64, system=/home/brosmait/.pyenv/versions/3.9.14/bin/python3.9, exe=/home/brosmait/.pyenv/shims/python3.9, platform=linux, version='3.9.14 (main, Oct 4 2022, 17:06:42) \n[GCC 12.2.1 20220819 (Red Hat 12.2.1-2)]', encoding_fs_io=utf-8-utf-8) [virtualenv/discovery/builtin.py:63]functional-py39: 202 D accepted PathPythonInfo(spec=CPython3.9.14.final.0-64, system=/home/brosmait/.pyenv/versions/3.9.14/bin/python3.9, exe=/home/brosmait/.pyenv/shims/python3.9, platform=linux, version='3.9.14 (main, Oct 4 2022, 17:06:42) \n[GCC 12.2.1 20220819 (Red Hat 12.2.1-2)]', encoding_fs_io=utf-8-utf-8) [virtualenv/discovery/builtin.py:65]functional-py39: 202 I create virtual environment via CPython3Posix(dest=/home/brosmait/scratch/lang/python/tox/.tox/functional-py39, clear=False, no_vcs_ignore=False, global=False) [virtualenv/run/session.py:48]functional-py39: 203 D create folder /home/brosmait/scratch/lang/python/tox/.tox/functional-py39/bin [virtualenv/util/path/_sync.py:9]functional-py39: 203 D create folder /home/brosmait/scratch/lang/python/tox/.tox/functional-py39/lib/python3.9/site-packages [virtualenv/util/path/_sync.py:9]functional-py39: 203 D write /home/brosmait/scratch/lang/python/tox/.tox/functional-py39/pyvenv.cfg [virtualenv/create/pyenv_cfg.py:30]functional-py39: 203 D home = /home/brosmait/.pyenv/versions/3.9.14/bin [virtualenv/create/pyenv_cfg.py:34]functional-py39: 203 D implementation = CPython [virtualenv/create/pyenv_cfg.py:34]functional-py39: 203 D version_info = 3.9.14.final.0 [virtualenv/create/pyenv_cfg.py:34]functional-py39: 203 D virtualenv = 20.17.1 [virtualenv/create/pyenv_cfg.py:34]functional-py39: 203 D include-system-site-packages = false [virtualenv/create/pyenv_cfg.py:34]functional-py39: 203 D base-prefix = /home/brosmait/.pyenv/versions/3.9.14 [virtualenv/create/pyenv_cfg.py:34]functional-py39: 203 D base-exec-prefix = /home/brosmait/.pyenv/versions/3.9.14 [virtualenv/create/pyenv_cfg.py:34]functional-py39: 203 D base-executable = /home/brosmait/.pyenv/versions/3.9.14/bin/python3.9 [virtualenv/create/pyenv_cfg.py:34]functional-py39: 203 D symlink /home/brosmait/.pyenv/versions/3.9.14/bin/python3.9 to /home/brosmait/scratch/lang/python/tox/.tox/functional-py39/bin/python [virtualenv/util/path/_sync.py:28]functional-py39: 203 D create virtualenv import hook file /home/brosmait/scratch/lang/python/tox/.tox/functional-py39/lib/python3.9/site-packages/_virtualenv.pth [virtualenv/create/via_global_ref/api.py:89]functional-py39: 203 D create /home/brosmait/scratch/lang/python/tox/.tox/functional-py39/lib/python3.9/site-packages/_virtualenv.py [virtualenv/create/via_global_ref/api.py:92]functional-py39: 203 D ============================== target debug ============================== [virtualenv/run/session.py:50]functional-py39: 203 D debug via /home/brosmait/scratch/lang/python/tox/.tox/functional-py39/bin/python /home/brosmait/repos/openstack/python-cinderclient/.tox/.tox/lib/python3.10/site-packages/virtualenv/create/debug.py [virtualenv/create/creator.py:197]functional-py39: 203 D { "sys": { "executable": "/home/brosmait/scratch/lang/python/tox/.tox/functional-py39/bin/python", "_base_executable": "/home/brosmait/scratch/lang/python/tox/.tox/functional-py39/bin/python", "prefix": "/home/brosmait/scratch/lang/python/tox/.tox/functional-py39", "base_prefix": "/home/brosmait/.pyenv/versions/3.9.14", "real_prefix": null, "exec_prefix": "/home/brosmait/scratch/lang/python/tox/.tox/functional-py39", "base_exec_prefix": "/home/brosmait/.pyenv/versions/3.9.14", "path": [ "/home/brosmait/.pyenv/versions/3.9.14/lib/python39.zip", "/home/brosmait/.pyenv/versions/3.9.14/lib/python3.9", "/home/brosmait/.pyenv/versions/3.9.14/lib/python3.9/lib-dynload", "/home/brosmait/scratch/lang/python/tox/.tox/functional-py39/lib/python3.9/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.9.14 (main, Oct 4 2022, 17:06:42) \n[GCC 12.2.1 20220819 (Red Hat 12.2.1-2)]", "makefile_filename": "/home/brosmait/.pyenv/versions/3.9.14/lib/python3.9/config-3.9-x86_64-linux-gnu/Makefile", "os": "<module 'os' from '/home/brosmait/.pyenv/versions/3.9.14/lib/python3.9/os.py'>", "site": "<module 'site' from '/home/brosmait/.pyenv/versions/3.9.14/lib/python3.9/site.py'>", "datetime": "<module 'datetime' from '/home/brosmait/.pyenv/versions/3.9.14/lib/python3.9/datetime.py'>", "math": "<module 'math' from '/home/brosmait/.pyenv/versions/3.9.14/lib/python3.9/lib-dynload/math.cpython-39-x86_64-linux-gnu.so'>", "json": "<module 'json' from '/home/brosmait/.pyenv/versions/3.9.14/lib/python3.9/json/__init__.py'>"} [virtualenv/run/session.py:51]functional-py39: 219 I add seed packages via FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/brosmait/.local/share/virtualenv) [virtualenv/run/session.py:55]functional-py39: 220 D install pip from wheel /home/brosmait/repos/openstack/python-cinderclient/.tox/.tox/lib/python3.10/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]functional-py39: 220 D install setuptools from wheel /home/brosmait/repos/openstack/python-cinderclient/.tox/.tox/lib/python3.10/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]functional-py39: 220 D install wheel from wheel /home/brosmait/repos/openstack/python-cinderclient/.tox/.tox/lib/python3.10/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]functional-py39: 221 D copy directory /home/brosmait/.local/share/virtualenv/wheel/3.9/image/1/CopyPipInstall/wheel-0.38.4-py3-none-any/wheel to /home/brosmait/scratch/lang/python/tox/.tox/functional-py39/lib/python3.9/site-packages/wheel [virtualenv/util/path/_sync.py:36]functional-py39: 221 D copy directory /home/brosmait/.local/share/virtualenv/wheel/3.9/image/1/CopyPipInstall/pip-22.3.1-py3-none-any/pip to /home/brosmait/scratch/lang/python/tox/.tox/functional-py39/lib/python3.9/site-packages/pip [virtualenv/util/path/_sync.py:36]functional-py39: 221 D copy /home/brosmait/.local/share/virtualenv/wheel/3.9/image/1/CopyPipInstall/setuptools-65.6.3-py3-none-any/distutils-precedence.pth to /home/brosmait/scratch/lang/python/tox/.tox/functional-py39/lib/python3.9/site-packages/distutils-precedence.pth [virtualenv/util/path/_sync.py:36]functional-py39: 222 D copy directory /home/brosmait/.local/share/virtualenv/wheel/3.9/image/1/CopyPipInstall/setuptools-65.6.3-py3-none-any/_distutils_hack to /home/brosmait/scratch/lang/python/tox/.tox/functional-py39/lib/python3.9/site-packages/_distutils_hack [virtualenv/util/path/_sync.py:36]functional-py39: 222 D copy directory /home/brosmait/.local/share/virtualenv/wheel/3.9/image/1/CopyPipInstall/setuptools-65.6.3-py3-none-any/pkg_resources to /home/brosmait/scratch/lang/python/tox/.tox/functional-py39/lib/python3.9/site-packages/pkg_resources [virtualenv/util/path/_sync.py:36]functional-py39: 224 D copy directory /home/brosmait/.local/share/virtualenv/wheel/3.9/image/1/CopyPipInstall/wheel-0.38.4-py3-none-any/wheel-0.38.4.dist-info to /home/brosmait/scratch/lang/python/tox/.tox/functional-py39/lib/python3.9/site-packages/wheel-0.38.4.dist-info [virtualenv/util/path/_sync.py:36]functional-py39: 226 D copy /home/brosmait/.local/share/virtualenv/wheel/3.9/image/1/CopyPipInstall/wheel-0.38.4-py3-none-any/wheel-0.38.4.virtualenv to /home/brosmait/scratch/lang/python/tox/.tox/functional-py39/lib/python3.9/site-packages/wheel-0.38.4.virtualenv [virtualenv/util/path/_sync.py:36]functional-py39: 227 D generated console scripts wheel-3.9 wheel wheel3 wheel3.9 [virtualenv/seed/embed/via_app_data/pip_install/base.py:41]functional-py39: 229 D copy directory /home/brosmait/.local/share/virtualenv/wheel/3.9/image/1/CopyPipInstall/setuptools-65.6.3-py3-none-any/setuptools to /home/brosmait/scratch/lang/python/tox/.tox/functional-py39/lib/python3.9/site-packages/setuptools [virtualenv/util/path/_sync.py:36]functional-py39: 249 D copy directory /home/brosmait/.local/share/virtualenv/wheel/3.9/image/1/CopyPipInstall/setuptools-65.6.3-py3-none-any/setuptools-65.6.3.dist-info to /home/brosmait/scratch/lang/python/tox/.tox/functional-py39/lib/python3.9/site-packages/setuptools-65.6.3.dist-info [virtualenv/util/path/_sync.py:36]functional-py39: 250 D copy /home/brosmait/.local/share/virtualenv/wheel/3.9/image/1/CopyPipInstall/setuptools-65.6.3-py3-none-any/setuptools-65.6.3.virtualenv to /home/brosmait/scratch/lang/python/tox/.tox/functional-py39/lib/python3.9/site-packages/setuptools-65.6.3.virtualenv [virtualenv/util/path/_sync.py:36]functional-py39: 250 D generated console scripts [virtualenv/seed/embed/via_app_data/pip_install/base.py:41]functional-py39: 261 D copy directory /home/brosmait/.local/share/virtualenv/wheel/3.9/image/1/CopyPipInstall/pip-22.3.1-py3-none-any/pip-22.3.1.dist-info to /home/brosmait/scratch/lang/python/tox/.tox/functional-py39/lib/python3.9/site-packages/pip-22.3.1.dist-info [virtualenv/util/path/_sync.py:36]functional-py39: 262 D copy /home/brosmait/.local/share/virtualenv/wheel/3.9/image/1/CopyPipInstall/pip-22.3.1-py3-none-any/pip-22.3.1.virtualenv to /home/brosmait/scratch/lang/python/tox/.tox/functional-py39/lib/python3.9/site-packages/pip-22.3.1.virtualenv [virtualenv/util/path/_sync.py:36]functional-py39: 262 D generated console scripts pip3 pip3.9 pip pip-3.9 [virtualenv/seed/embed/via_app_data/pip_install/base.py:41]functional-py39: 262 I add activators for Bash, CShell, Fish, Nushell, PowerShell, Python [virtualenv/run/session.py:61]functional-py39: 263 D write /home/brosmait/scratch/lang/python/tox/.tox/functional-py39/pyvenv.cfg [virtualenv/create/pyenv_cfg.py:30]functional-py39: 263 D home = /home/brosmait/.pyenv/versions/3.9.14/bin [virtualenv/create/pyenv_cfg.py:34]functional-py39: 263 D implementation = CPython [virtualenv/create/pyenv_cfg.py:34]functional-py39: 263 D version_info = 3.9.14.final.0 [virtualenv/create/pyenv_cfg.py:34]functional-py39: 263 D virtualenv = 20.17.1 [virtualenv/create/pyenv_cfg.py:34]functional-py39: 263 D include-system-site-packages = false [virtualenv/create/pyenv_cfg.py:34]functional-py39: 263 D base-prefix = /home/brosmait/.pyenv/versions/3.9.14 [virtualenv/create/pyenv_cfg.py:34]functional-py39: 263 D base-exec-prefix = /home/brosmait/.pyenv/versions/3.9.14 [virtualenv/create/pyenv_cfg.py:34]functional-py39: 263 D base-executable = /home/brosmait/.pyenv/versions/3.9.14/bin/python3.9 [virtualenv/create/pyenv_cfg.py:34]functional-py39: 264 W commands[0]> bash ts.sh functional [tox/tox_env/api.py:427]functional-py39: 266 I exit 0 (0.00 seconds) /home/brosmait/scratch/lang/python/tox> bash ts.sh functional pid=315721 [tox/execute/api.py:275] py39: OK (0.10=setup[0.10]+cmd[0.00] seconds) functional-py39: OK (0.08=setup[0.08]+cmd[0.00] seconds) congratulations :) (0.21 seconds)
❯ cat tmpfiletestenv: ./cinderclient/tests/unitfunctional: ./cinderclient/tests/unit
Minimal example
If possible, provide a minimal reproducer for the issue:
(see file above)
Observations
The "abstract" testenv is necessary, that is, the bug isn't reproducible if you just have 2 testenvs.
I think this may have something to do with lazy loading of environments in tox4, because the bug doesn't occur if we use that intermediate "abstract" environment:
❯ ./tox4 -e py39,functional,functional-py39py39: commands[0]> bash ts.sh testenvpy39: OK ✔ in 0.02 secondsfunctional: commands[0]> bash ts.sh functionalfunctional: OK ✔ in 0 secondsfunctional-py39: commands[0]> bash ts.sh functional py39: OK (0.02=setup[0.02]+cmd[0.00] seconds) functional: OK (0.00=setup[0.00]+cmd[0.00] seconds) functional-py39: OK (0.00=setup[0.00]+cmd[0.00] seconds) congratulations :) (0.05 seconds)
❯ cat tmpfiletestenv: ./cinderclient/tests/unitfunctional: ./cinderclient/tests/functionalfunctional: ./cinderclient/tests/functional
... though, of course, the whole point of the "abstract" testenv is that you normally don't use it directly.
The output for 'tox c' doesn't include the change to the env var:
This seems kind of bad to me, because people not using the "abstract" testenv will still see misleading results from the 'tox c' output. In other words, if you only had [testenv] and [testenv:functional] defined (forget about the "abstract" business), 'tox c' does not show the value that tox is actually using for OS_TEST_PATH when you call 'tox -e functional', which makes debugging the config file difficult.
If the pattern I'm using to have an "abstract" job is stupid, please let me know what a better way to do this is and I'll be happy to use it. But if it's a reasonable thing to do, I imagine I'm not the only one doing it, and it's going to cause difficulties upgrading from tox3 to tox4. (I mean, the workaround is easy enough, just violate the DRY principle and explicitly set all the env vars, but you have to know to do it.)
The text was updated successfully, but these errors were encountered:
There's no such thing as abstract env (in either tox 3 or 4) 🤔 is this some concept you've come up with on your own? PR to fix it is welcome. Perhaps factor filters express better what you want:
gaborbernat
added
bug:minor
does not affect many people or has no big impact
help:wanted
Issues that have been acknowledged, a solution determined and a PR might likely be accepted.
labels
Jan 6, 2023
bug:minordoes not affect many people or has no big impacthelp:wantedIssues that have been acknowledged, a solution determined and a PR might likely be accepted.
Issue
I'm not sure if this is a regression, or if I am using a bad pattern that worked by chance in tox3.
I use the base [testenv] to set_env some vars and run unit tests. Then I have a [testenv:functional] that inherits these env vars (most of which are still relevant) but changes the var governing where the tests are located. I use that as an "abstract" testenv to hold the setenv, commands, etc., for python-version-specific testenvs like [testenv:functional-py39], [testenv:functional-py310], etc. In tox3 this worked great, but in tox 4, the changes to set_env in the "abstract" testenv aren't picked up when I call 'tox -e functional-py39'.
Here's a
tox.ini
for this that works in both tox3 and tox4.All
ts.sh
does is echo the value of the env var of interest to a file:Using the
tox.ini
with both tox3 and tox4:Looking at the created file:
You can see that tox3 uses the correct value for the env var for the functional tests, but tox4 is using the original value.
Environment
Provide at least:
pip list
of the host Python wheretox
is installed:Output of running tox
Provide the output of
tox -rvv
:Minimal example
If possible, provide a minimal reproducer for the issue:
(see file above)
Observations
The "abstract" testenv is necessary, that is, the bug isn't reproducible if you just have 2 testenvs.
I think this may have something to do with lazy loading of environments in tox4, because the bug doesn't occur if we use that intermediate "abstract" environment:
... though, of course, the whole point of the "abstract" testenv is that you normally don't use it directly.
This seems kind of bad to me, because people not using the "abstract" testenv will still see misleading results from the 'tox c' output. In other words, if you only had [testenv] and [testenv:functional] defined (forget about the "abstract" business), 'tox c' does not show the value that tox is actually using for OS_TEST_PATH when you call 'tox -e functional', which makes debugging the config file difficult.
The text was updated successfully, but these errors were encountered: