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

Regression / behaviour change: install_command with empty evaluated value #2695

Closed
jayaddison opened this issue Dec 13, 2022 · 18 comments
Closed
Labels
area:documentation help:wanted Issues that have been acknowledged, a solution determined and a PR might likely be accepted.

Comments

@jayaddison
Copy link
Contributor

Issue

Somewhere between tox versions 3.21.4 and 4.0.8, running tox began raising an IndexError exception when using the tox.ini file provided as a minimal repro case.

Environment

  • Linux
  • Python 3.9
  • Tox version 4.0.8
$ 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     22.0
pip           22.0.4
platformdirs  2.6.0
pluggy        1.0.0
pyproject_api 1.2.1
setuptools    58.1.0
tomli         2.0.1
tox           4.0.8
virtualenv    20.17.1

Output of running tox

Provide the output of tox -rvv:

$ tox -rvv
.pkg: 805 W remove tox env folder /home/example/.tox/.pkg [tox/tox_env/api.py:302]
py: 816 D created app data folder /home/example/.local/share/virtualenv [virtualenv/app_data/__init__.py:40]
py: 834 I find interpreter for spec PythonSpec() [virtualenv/discovery/builtin.py:56]
py: 835 D discover exe for PythonInfo(spec=CPython3.9.16.final.0-64, exe=/home/example/.venv/bin/python3, platform=linux, version='3.9.16 (main, Dec  8 2022, 02:40:11) \n[GCC 10.2.1 20210110]', encoding_fs_io=utf-8-utf-8) in /usr/local [virtualenv/discovery/py_info.py:437]
py: 836 D filesystem is case-sensitive [virtualenv/info.py:24]
py: 840 D get interpreter info via cmd: /usr/local/bin/python3.9 /home/example/.venv/lib/python3.9/site-packages/virtualenv/discovery/py_info.py hGkkxtAd5MRNpzZcdmPHiFw51mGktBhg i6FWZ97EDRPJiSbLdkIvfQH1Ffsg7orx [virtualenv/discovery/cached_py_info.py:108]
py: 1101 D wrote python info of /usr/local/bin/python3.9 at /home/example/.local/share/virtualenv/py_info/1/397704579725e15f5c7cb49fe5f0341eb7531c82d19f2c29d197e8b64ab5776b.json [virtualenv/app_data/via_disk_folder.py:155]
py: 1103 I proposed PythonInfo(spec=CPython3.9.16.final.0-64, system=/usr/local/bin/python3.9, exe=/home/example/.venv/bin/python3, platform=linux, version='3.9.16 (main, Dec  8 2022, 02:40:11) \n[GCC 10.2.1 20210110]', encoding_fs_io=utf-8-utf-8) [virtualenv/discovery/builtin.py:63]
py: 1105 D accepted PythonInfo(spec=CPython3.9.16.final.0-64, system=/usr/local/bin/python3.9, exe=/home/example/.venv/bin/python3, platform=linux, version='3.9.16 (main, Dec  8 2022, 02:40:11) \n[GCC 10.2.1 20210110]', encoding_fs_io=utf-8-utf-8) [virtualenv/discovery/builtin.py:65]
py: 1288 I create virtual environment via CPython3Posix(dest=/home/example/.tox/py, clear=False, no_vcs_ignore=False, global=False) [virtualenv/run/session.py:48]
py: 1289 D create folder /home/example/.tox/py/bin [virtualenv/util/path/_sync.py:9]
py: 1290 D create folder /home/example/.tox/py/lib/python3.9/site-packages [virtualenv/util/path/_sync.py:9]
py: 1291 D write /home/example/.tox/py/pyvenv.cfg [virtualenv/create/pyenv_cfg.py:30]
py: 1291 D 	home = /usr/local/bin [virtualenv/create/pyenv_cfg.py:34]
py: 1291 D 	implementation = CPython [virtualenv/create/pyenv_cfg.py:34]
py: 1291 D 	version_info = 3.9.16.final.0 [virtualenv/create/pyenv_cfg.py:34]
py: 1291 D 	virtualenv = 20.17.1 [virtualenv/create/pyenv_cfg.py:34]
py: 1292 D 	include-system-site-packages = false [virtualenv/create/pyenv_cfg.py:34]
py: 1292 D 	base-prefix = /usr/local [virtualenv/create/pyenv_cfg.py:34]
py: 1292 D 	base-exec-prefix = /usr/local [virtualenv/create/pyenv_cfg.py:34]
py: 1292 D 	base-executable = /usr/local/bin/python3.9 [virtualenv/create/pyenv_cfg.py:34]
py: 1293 D symlink /usr/local/bin/python3.9 to /home/example/.tox/py/bin/python [virtualenv/util/path/_sync.py:28]
py: 1294 D create virtualenv import hook file /home/example/.tox/py/lib/python3.9/site-packages/_virtualenv.pth [virtualenv/create/via_global_ref/api.py:89]
py: 1295 D create /home/example/.tox/py/lib/python3.9/site-packages/_virtualenv.py [virtualenv/create/via_global_ref/api.py:92]
py: 1295 D ============================== target debug ============================== [virtualenv/run/session.py:50]
py: 1296 D debug via /home/example/.tox/py/bin/python /home/example/.venv/lib/python3.9/site-packages/virtualenv/create/debug.py [virtualenv/create/creator.py:197]
py: 1296 D {
  "sys": {
    "executable": "/home/example/.tox/py/bin/python",
    "_base_executable": "/home/example/.tox/py/bin/python",
    "prefix": "/home/example/.tox/py",
    "base_prefix": "/usr/local",
    "real_prefix": null,
    "exec_prefix": "/home/example/.tox/py",
    "base_exec_prefix": "/usr/local",
    "path": [
      "/usr/local/lib/python39.zip",
      "/usr/local/lib/python3.9",
      "/usr/local/lib/python3.9/lib-dynload",
      "/home/example/.tox/py/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.16 (main, Dec  8 2022, 02:40:11) \n[GCC 10.2.1 20210110]",
  "makefile_filename": "/usr/local/lib/python3.9/config-3.9-x86_64-linux-gnu/Makefile",
  "os": "<module 'os' from '/usr/local/lib/python3.9/os.py'>",
  "site": "<module 'site' from '/usr/local/lib/python3.9/site.py'>",
  "datetime": "<module 'datetime' from '/usr/local/lib/python3.9/datetime.py'>",
  "math": "<module 'math' from '/usr/local/lib/python3.9/lib-dynload/math.cpython-39-x86_64-linux-gnu.so'>",
  "json": "<module 'json' from '/usr/local/lib/python3.9/json/__init__.py'>"
} [virtualenv/run/session.py:51]
py: 1410 I add seed packages via FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/example/.local/share/virtualenv) [virtualenv/run/session.py:55]
py: 1418 D install pip from wheel /home/example/.venv/lib/python3.9/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]
py: 1418 D install setuptools from wheel /home/example/.venv/lib/python3.9/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]
py: 1424 D build install image for setuptools-65.6.3-py3-none-any.whl to /home/example/.local/share/virtualenv/wheel/3.9/image/1/CopyPipInstall/setuptools-65.6.3-py3-none-any [virtualenv/seed/embed/via_app_data/pip_install/base.py:45]
py: 1422 D build install image for pip-22.3.1-py3-none-any.whl to /home/example/.local/share/virtualenv/wheel/3.9/image/1/CopyPipInstall/pip-22.3.1-py3-none-any [virtualenv/seed/embed/via_app_data/pip_install/base.py:45]
py: 1420 D install wheel from wheel /home/example/.venv/lib/python3.9/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]
py: 1462 D build install image for wheel-0.38.4-py3-none-any.whl to /home/example/.local/share/virtualenv/wheel/3.9/image/1/CopyPipInstall/wheel-0.38.4-py3-none-any [virtualenv/seed/embed/via_app_data/pip_install/base.py:45]
py: 1542 D copy directory /home/example/.local/share/virtualenv/wheel/3.9/image/1/CopyPipInstall/wheel-0.38.4-py3-none-any/wheel-0.38.4.dist-info to /home/example/.tox/py/lib/python3.9/site-packages/wheel-0.38.4.dist-info [virtualenv/util/path/_sync.py:36]
py: 1565 D copy directory /home/example/.local/share/virtualenv/wheel/3.9/image/1/CopyPipInstall/wheel-0.38.4-py3-none-any/wheel to /home/example/.tox/py/lib/python3.9/site-packages/wheel [virtualenv/util/path/_sync.py:36]
py: 1580 D copy /home/example/.local/share/virtualenv/wheel/3.9/image/1/CopyPipInstall/wheel-0.38.4-py3-none-any/wheel-0.38.4.virtualenv to /home/example/.tox/py/lib/python3.9/site-packages/wheel-0.38.4.virtualenv [virtualenv/util/path/_sync.py:36]
py: 1595 D generated console scripts wheel wheel-3.9 wheel3 wheel3.9 [virtualenv/seed/embed/via_app_data/pip_install/base.py:41]
py: 1890 D copy /home/example/.local/share/virtualenv/wheel/3.9/image/1/CopyPipInstall/setuptools-65.6.3-py3-none-any/setuptools-65.6.3.virtualenv to /home/example/.tox/py/lib/python3.9/site-packages/setuptools-65.6.3.virtualenv [virtualenv/util/path/_sync.py:36]
py: 1892 D copy /home/example/.local/share/virtualenv/wheel/3.9/image/1/CopyPipInstall/setuptools-65.6.3-py3-none-any/distutils-precedence.pth to /home/example/.tox/py/lib/python3.9/site-packages/distutils-precedence.pth [virtualenv/util/path/_sync.py:36]
py: 1893 D copy directory /home/example/.local/share/virtualenv/wheel/3.9/image/1/CopyPipInstall/setuptools-65.6.3-py3-none-any/setuptools to /home/example/.tox/py/lib/python3.9/site-packages/setuptools [virtualenv/util/path/_sync.py:36]
py: 2080 D copy directory /home/example/.local/share/virtualenv/wheel/3.9/image/1/CopyPipInstall/setuptools-65.6.3-py3-none-any/setuptools-65.6.3.dist-info to /home/example/.tox/py/lib/python3.9/site-packages/setuptools-65.6.3.dist-info [virtualenv/util/path/_sync.py:36]
py: 2084 D copy directory /home/example/.local/share/virtualenv/wheel/3.9/image/1/CopyPipInstall/setuptools-65.6.3-py3-none-any/pkg_resources to /home/example/.tox/py/lib/python3.9/site-packages/pkg_resources [virtualenv/util/path/_sync.py:36]
py: 2148 D copy directory /home/example/.local/share/virtualenv/wheel/3.9/image/1/CopyPipInstall/setuptools-65.6.3-py3-none-any/_distutils_hack to /home/example/.tox/py/lib/python3.9/site-packages/_distutils_hack [virtualenv/util/path/_sync.py:36]
py: 2150 D generated console scripts  [virtualenv/seed/embed/via_app_data/pip_install/base.py:41]
py: 2252 D copy directory /home/example/.local/share/virtualenv/wheel/3.9/image/1/CopyPipInstall/pip-22.3.1-py3-none-any/pip to /home/example/.tox/py/lib/python3.9/site-packages/pip [virtualenv/util/path/_sync.py:36]
py: 2471 D copy directory /home/example/.local/share/virtualenv/wheel/3.9/image/1/CopyPipInstall/pip-22.3.1-py3-none-any/pip-22.3.1.dist-info to /home/example/.tox/py/lib/python3.9/site-packages/pip-22.3.1.dist-info [virtualenv/util/path/_sync.py:36]
py: 2475 D copy /home/example/.local/share/virtualenv/wheel/3.9/image/1/CopyPipInstall/pip-22.3.1-py3-none-any/pip-22.3.1.virtualenv to /home/example/.tox/py/lib/python3.9/site-packages/pip-22.3.1.virtualenv [virtualenv/util/path/_sync.py:36]
py: 2477 D generated console scripts pip pip-3.9 pip3 pip3.9 [virtualenv/seed/embed/via_app_data/pip_install/base.py:41]
py: 2478 I add activators for Bash, CShell, Fish, Nushell, PowerShell, Python [virtualenv/run/session.py:61]
py: 2483 D write /home/example/.tox/py/pyvenv.cfg [virtualenv/create/pyenv_cfg.py:30]
py: 2489 D 	home = /usr/local/bin [virtualenv/create/pyenv_cfg.py:34]
py: 2490 D 	implementation = CPython [virtualenv/create/pyenv_cfg.py:34]
py: 2491 D 	version_info = 3.9.16.final.0 [virtualenv/create/pyenv_cfg.py:34]
py: 2492 D 	virtualenv = 20.17.1 [virtualenv/create/pyenv_cfg.py:34]
py: 2493 D 	include-system-site-packages = false [virtualenv/create/pyenv_cfg.py:34]
py: 2494 D 	base-prefix = /usr/local [virtualenv/create/pyenv_cfg.py:34]
py: 2494 D 	base-exec-prefix = /usr/local [virtualenv/create/pyenv_cfg.py:34]
py: 2494 D 	base-executable = /usr/local/bin/python3.9 [virtualenv/create/pyenv_cfg.py:34]
.pkg: 2508 I find interpreter for spec PythonSpec(path=/home/example/.venv/bin/python3) [virtualenv/discovery/builtin.py:56]
.pkg: 2509 D discover exe from cache /usr/local - exact False: PythonInfo({'platform': 'linux', 'implementation': 'CPython', 'version_info': VersionInfo(major=3, minor=9, micro=16, releaselevel='final', serial=0), 'architecture': 64, 'version_nodot': '39', 'version': '3.9.16 (main, Dec  8 2022, 02:40:11) \n[GCC 10.2.1 20210110]', 'os': 'posix', 'prefix': '/usr/local', 'base_prefix': '/usr/local', 'real_prefix': None, 'base_exec_prefix': '/usr/local', 'exec_prefix': '/usr/local', 'executable': '/home/example/.venv/bin/python3', 'original_executable': '/usr/local/bin/python3.9', 'system_executable': '/usr/local/bin/python3.9', 'has_venv': True, 'path': ['/home/example/.venv/lib/python3.9/site-packages/virtualenv/discovery', '/usr/local/lib/python39.zip', '/usr/local/lib/python3.9', '/usr/local/lib/python3.9/lib-dynload', '/usr/local/lib/python3.9/site-packages'], 'file_system_encoding': 'utf-8', 'stdout_encoding': 'utf-8', 'sysconfig_scheme': None, 'sysconfig_paths': {'stdlib': '{installed_base}/{platlibdir}/python{py_version_short}', 'platstdlib': '{platbase}/{platlibdir}/python{py_version_short}', 'purelib': '{base}/lib/python{py_version_short}/site-packages', 'platlib': '{platbase}/{platlibdir}/python{py_version_short}/site-packages', 'include': '{installed_base}/include/python{py_version_short}{abiflags}', 'scripts': '{base}/bin', 'data': '{base}'}, 'distutils_install': {'purelib': 'lib/python3.9/site-packages', 'platlib': 'lib/python3.9/site-packages', 'headers': 'include/python3.9/UNKNOWN', 'scripts': 'bin', 'data': ''}, 'sysconfig': {'makefile_filename': '/usr/local/lib/python3.9/config-3.9-x86_64-linux-gnu/Makefile'}, 'sysconfig_vars': {'installed_base': '/usr/local', 'base': '/usr/local', 'platlibdir': 'lib', 'platbase': '/usr/local', 'abiflags': '', 'PYTHONFRAMEWORK': '', 'py_version_short': '3.9'}, 'system_stdlib': '/usr/local/lib/python3.9', 'system_stdlib_platform': '/usr/local/lib/python3.9', 'max_size': 9223372036854775807}) [virtualenv/discovery/py_info.py:435]
.pkg: 2509 I proposed PythonInfo(spec=CPython3.9.16.final.0-64, system=/usr/local/bin/python3.9, exe=/home/example/.venv/bin/python3, platform=linux, version='3.9.16 (main, Dec  8 2022, 02:40:11) \n[GCC 10.2.1 20210110]', encoding_fs_io=utf-8-utf-8) [virtualenv/discovery/builtin.py:63]
.pkg: 2510 D accepted PythonInfo(spec=CPython3.9.16.final.0-64, system=/usr/local/bin/python3.9, exe=/home/example/.venv/bin/python3, platform=linux, version='3.9.16 (main, Dec  8 2022, 02:40:11) \n[GCC 10.2.1 20210110]', encoding_fs_io=utf-8-utf-8) [virtualenv/discovery/builtin.py:65]
.pkg: 2515 I create virtual environment via CPython3Posix(dest=/home/example/.tox/.pkg, clear=False, no_vcs_ignore=False, global=False) [virtualenv/run/session.py:48]
.pkg: 2516 D create folder /home/example/.tox/.pkg/bin [virtualenv/util/path/_sync.py:9]
.pkg: 2517 D create folder /home/example/.tox/.pkg/lib/python3.9/site-packages [virtualenv/util/path/_sync.py:9]
.pkg: 2517 D write /home/example/.tox/.pkg/pyvenv.cfg [virtualenv/create/pyenv_cfg.py:30]
.pkg: 2518 D 	home = /usr/local/bin [virtualenv/create/pyenv_cfg.py:34]
.pkg: 2518 D 	implementation = CPython [virtualenv/create/pyenv_cfg.py:34]
.pkg: 2518 D 	version_info = 3.9.16.final.0 [virtualenv/create/pyenv_cfg.py:34]
.pkg: 2518 D 	virtualenv = 20.17.1 [virtualenv/create/pyenv_cfg.py:34]
.pkg: 2518 D 	include-system-site-packages = false [virtualenv/create/pyenv_cfg.py:34]
.pkg: 2518 D 	base-prefix = /usr/local [virtualenv/create/pyenv_cfg.py:34]
.pkg: 2519 D 	base-exec-prefix = /usr/local [virtualenv/create/pyenv_cfg.py:34]
.pkg: 2519 D 	base-executable = /usr/local/bin/python3.9 [virtualenv/create/pyenv_cfg.py:34]
.pkg: 2519 D symlink /usr/local/bin/python3.9 to /home/example/.tox/.pkg/bin/python [virtualenv/util/path/_sync.py:28]
.pkg: 2520 D create virtualenv import hook file /home/example/.tox/.pkg/lib/python3.9/site-packages/_virtualenv.pth [virtualenv/create/via_global_ref/api.py:89]
.pkg: 2521 D create /home/example/.tox/.pkg/lib/python3.9/site-packages/_virtualenv.py [virtualenv/create/via_global_ref/api.py:92]
.pkg: 2522 D ============================== target debug ============================== [virtualenv/run/session.py:50]
.pkg: 2522 D debug via /home/example/.tox/.pkg/bin/python /home/example/.venv/lib/python3.9/site-packages/virtualenv/create/debug.py [virtualenv/create/creator.py:197]
.pkg: 2522 D {
  "sys": {
    "executable": "/home/example/.tox/.pkg/bin/python",
    "_base_executable": "/home/example/.tox/.pkg/bin/python",
    "prefix": "/home/example/.tox/.pkg",
    "base_prefix": "/usr/local",
    "real_prefix": null,
    "exec_prefix": "/home/example/.tox/.pkg",
    "base_exec_prefix": "/usr/local",
    "path": [
      "/usr/local/lib/python39.zip",
      "/usr/local/lib/python3.9",
      "/usr/local/lib/python3.9/lib-dynload",
      "/home/example/.tox/.pkg/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.16 (main, Dec  8 2022, 02:40:11) \n[GCC 10.2.1 20210110]",
  "makefile_filename": "/usr/local/lib/python3.9/config-3.9-x86_64-linux-gnu/Makefile",
  "os": "<module 'os' from '/usr/local/lib/python3.9/os.py'>",
  "site": "<module 'site' from '/usr/local/lib/python3.9/site.py'>",
  "datetime": "<module 'datetime' from '/usr/local/lib/python3.9/datetime.py'>",
  "math": "<module 'math' from '/usr/local/lib/python3.9/lib-dynload/math.cpython-39-x86_64-linux-gnu.so'>",
  "json": "<module 'json' from '/usr/local/lib/python3.9/json/__init__.py'>"
} [virtualenv/run/session.py:51]
.pkg: 2635 I add seed packages via FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/example/.local/share/virtualenv) [virtualenv/run/session.py:55]
.pkg: 2651 D install setuptools from wheel /home/example/.venv/lib/python3.9/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]
.pkg: 2654 D install wheel from wheel /home/example/.venv/lib/python3.9/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]
.pkg: 2655 D copy /home/example/.local/share/virtualenv/wheel/3.9/image/1/CopyPipInstall/setuptools-65.6.3-py3-none-any/setuptools-65.6.3.virtualenv to /home/example/.tox/.pkg/lib/python3.9/site-packages/setuptools-65.6.3.virtualenv [virtualenv/util/path/_sync.py:36]
.pkg: 2655 D install pip from wheel /home/example/.venv/lib/python3.9/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]
.pkg: 2661 D copy directory /home/example/.local/share/virtualenv/wheel/3.9/image/1/CopyPipInstall/pip-22.3.1-py3-none-any/pip to /home/example/.tox/.pkg/lib/python3.9/site-packages/pip [virtualenv/util/path/_sync.py:36]
.pkg: 2659 D copy /home/example/.local/share/virtualenv/wheel/3.9/image/1/CopyPipInstall/setuptools-65.6.3-py3-none-any/distutils-precedence.pth to /home/example/.tox/.pkg/lib/python3.9/site-packages/distutils-precedence.pth [virtualenv/util/path/_sync.py:36]
.pkg: 2667 D copy directory /home/example/.local/share/virtualenv/wheel/3.9/image/1/CopyPipInstall/setuptools-65.6.3-py3-none-any/setuptools to /home/example/.tox/.pkg/lib/python3.9/site-packages/setuptools [virtualenv/util/path/_sync.py:36]
.pkg: 2675 D copy directory /home/example/.local/share/virtualenv/wheel/3.9/image/1/CopyPipInstall/wheel-0.38.4-py3-none-any/wheel-0.38.4.dist-info to /home/example/.tox/.pkg/lib/python3.9/site-packages/wheel-0.38.4.dist-info [virtualenv/util/path/_sync.py:36]
.pkg: 2684 D copy directory /home/example/.local/share/virtualenv/wheel/3.9/image/1/CopyPipInstall/wheel-0.38.4-py3-none-any/wheel to /home/example/.tox/.pkg/lib/python3.9/site-packages/wheel [virtualenv/util/path/_sync.py:36]
.pkg: 2721 D copy /home/example/.local/share/virtualenv/wheel/3.9/image/1/CopyPipInstall/wheel-0.38.4-py3-none-any/wheel-0.38.4.virtualenv to /home/example/.tox/.pkg/lib/python3.9/site-packages/wheel-0.38.4.virtualenv [virtualenv/util/path/_sync.py:36]
.pkg: 2730 D generated console scripts wheel-3.9 wheel3 wheel3.9 wheel [virtualenv/seed/embed/via_app_data/pip_install/base.py:41]
.pkg: 2897 D copy directory /home/example/.local/share/virtualenv/wheel/3.9/image/1/CopyPipInstall/setuptools-65.6.3-py3-none-any/setuptools-65.6.3.dist-info to /home/example/.tox/.pkg/lib/python3.9/site-packages/setuptools-65.6.3.dist-info [virtualenv/util/path/_sync.py:36]
.pkg: 2905 D copy directory /home/example/.local/share/virtualenv/wheel/3.9/image/1/CopyPipInstall/setuptools-65.6.3-py3-none-any/pkg_resources to /home/example/.tox/.pkg/lib/python3.9/site-packages/pkg_resources [virtualenv/util/path/_sync.py:36]
.pkg: 2936 D copy directory /home/example/.local/share/virtualenv/wheel/3.9/image/1/CopyPipInstall/setuptools-65.6.3-py3-none-any/_distutils_hack to /home/example/.tox/.pkg/lib/python3.9/site-packages/_distutils_hack [virtualenv/util/path/_sync.py:36]
.pkg: 2941 D generated console scripts  [virtualenv/seed/embed/via_app_data/pip_install/base.py:41]
.pkg: 3069 D copy directory /home/example/.local/share/virtualenv/wheel/3.9/image/1/CopyPipInstall/pip-22.3.1-py3-none-any/pip-22.3.1.dist-info to /home/example/.tox/.pkg/lib/python3.9/site-packages/pip-22.3.1.dist-info [virtualenv/util/path/_sync.py:36]
.pkg: 3073 D copy /home/example/.local/share/virtualenv/wheel/3.9/image/1/CopyPipInstall/pip-22.3.1-py3-none-any/pip-22.3.1.virtualenv to /home/example/.tox/.pkg/lib/python3.9/site-packages/pip-22.3.1.virtualenv [virtualenv/util/path/_sync.py:36]
.pkg: 3076 D generated console scripts pip pip-3.9 pip3 pip3.9 [virtualenv/seed/embed/via_app_data/pip_install/base.py:41]
.pkg: 3076 I add activators for Bash, CShell, Fish, Nushell, PowerShell, Python [virtualenv/run/session.py:61]
.pkg: 3081 D write /home/example/.tox/.pkg/pyvenv.cfg [virtualenv/create/pyenv_cfg.py:30]
.pkg: 3081 D 	home = /usr/local/bin [virtualenv/create/pyenv_cfg.py:34]
.pkg: 3082 D 	implementation = CPython [virtualenv/create/pyenv_cfg.py:34]
.pkg: 3083 D 	version_info = 3.9.16.final.0 [virtualenv/create/pyenv_cfg.py:34]
.pkg: 3083 D 	virtualenv = 20.17.1 [virtualenv/create/pyenv_cfg.py:34]
.pkg: 3083 D 	include-system-site-packages = false [virtualenv/create/pyenv_cfg.py:34]
.pkg: 3084 D 	base-prefix = /usr/local [virtualenv/create/pyenv_cfg.py:34]
.pkg: 3084 D 	base-exec-prefix = /usr/local [virtualenv/create/pyenv_cfg.py:34]
.pkg: 3085 D 	base-executable = /usr/local/bin/python3.9 [virtualenv/create/pyenv_cfg.py:34]
.pkg: 3090 W install_requires> python -I -m pip install setuptools [tox/tox_env/api.py:408]
Requirement already satisfied: setuptools in ./.tox/.pkg/lib/python3.9/site-packages (65.6.3)
.pkg: 7266 I exit 0 (4.17 seconds) /home/example> python -I -m pip install setuptools pid=477 [tox/execute/api.py:275]
.pkg: 7269 W _optional_hooks> python /home/example/.venv/lib/python3.9/site-packages/pyproject_api/_backend.py True setuptools.build_meta [tox/tox_env/api.py:408]
Backend: run command _optional_hooks with args {}
Backend: Wrote response {'return': {'get_requires_for_build_sdist': True, 'prepare_metadata_for_build_wheel': True, 'get_requires_for_build_wheel': True, 'build_editable': True, 'get_requires_for_build_editable': True, 'prepare_metadata_for_build_editable': True}} to /tmp/pep517__optional_hooks-5rldeusq.json
.pkg: 8943 I exit None (1.67 seconds) /home/example> python /home/example/.venv/lib/python3.9/site-packages/pyproject_api/_backend.py True setuptools.build_meta pid=485 [tox/execute/api.py:275]
.pkg: 8946 W get_requires_for_build_sdist> python /home/example/.venv/lib/python3.9/site-packages/pyproject_api/_backend.py True setuptools.build_meta [tox/tox_env/api.py:408]
Backend: run command get_requires_for_build_sdist with args {'config_settings': None}
running egg_info
creating UNKNOWN.egg-info
writing UNKNOWN.egg-info/PKG-INFO
writing dependency_links to UNKNOWN.egg-info/dependency_links.txt
writing top-level names to UNKNOWN.egg-info/top_level.txt
writing manifest file 'UNKNOWN.egg-info/SOURCES.txt'
reading manifest file 'UNKNOWN.egg-info/SOURCES.txt'
writing manifest file 'UNKNOWN.egg-info/SOURCES.txt'
Backend: Wrote response {'return': []} to /tmp/pep517_get_requires_for_build_sdist-b4kog6hw.json
.pkg: 9098 I exit None (0.15 seconds) /home/example> python /home/example/.venv/lib/python3.9/site-packages/pyproject_api/_backend.py True setuptools.build_meta pid=485 [tox/execute/api.py:275]
.pkg: 9102 W prepare_metadata_for_build_wheel> python /home/example/.venv/lib/python3.9/site-packages/pyproject_api/_backend.py True setuptools.build_meta [tox/tox_env/api.py:408]
Backend: run command prepare_metadata_for_build_wheel with args {'metadata_directory': '/home/example/.tox/.pkg/.meta', 'config_settings': {'--build-option': []}}
running dist_info
creating /home/example/.tox/.pkg/.meta/UNKNOWN.egg-info
writing /home/example/.tox/.pkg/.meta/UNKNOWN.egg-info/PKG-INFO
writing dependency_links to /home/example/.tox/.pkg/.meta/UNKNOWN.egg-info/dependency_links.txt
writing top-level names to /home/example/.tox/.pkg/.meta/UNKNOWN.egg-info/top_level.txt
writing manifest file '/home/example/.tox/.pkg/.meta/UNKNOWN.egg-info/SOURCES.txt'
reading manifest file '/home/example/.tox/.pkg/.meta/UNKNOWN.egg-info/SOURCES.txt'
writing manifest file '/home/example/.tox/.pkg/.meta/UNKNOWN.egg-info/SOURCES.txt'
creating '/home/example/.tox/.pkg/.meta/UNKNOWN-0.0.0.dist-info'
Backend: Wrote response {'return': 'UNKNOWN-0.0.0.dist-info'} to /tmp/pep517_prepare_metadata_for_build_wheel-li5bj951.json
.pkg: 9314 I exit None (0.21 seconds) /home/example> python /home/example/.venv/lib/python3.9/site-packages/pyproject_api/_backend.py True setuptools.build_meta pid=485 [tox/execute/api.py:275]
.pkg: 9319 W build_sdist> python /home/example/.venv/lib/python3.9/site-packages/pyproject_api/_backend.py True setuptools.build_meta [tox/tox_env/api.py:408]
Backend: run command build_sdist with args {'sdist_directory': '/home/example/.tox/.pkg/dist', 'config_settings': None}
running sdist
running egg_info
writing UNKNOWN.egg-info/PKG-INFO
writing dependency_links to UNKNOWN.egg-info/dependency_links.txt
writing top-level names to UNKNOWN.egg-info/top_level.txt
reading manifest file 'UNKNOWN.egg-info/SOURCES.txt'
writing manifest file 'UNKNOWN.egg-info/SOURCES.txt'
warning: sdist: standard file not found: should have one of README, README.rst, README.txt, README.md

running check
warning: check: missing required meta-data: name

creating UNKNOWN-0.0.0
creating UNKNOWN-0.0.0/UNKNOWN.egg-info
copying files to UNKNOWN-0.0.0...
copying pyproject.toml -> UNKNOWN-0.0.0
copying UNKNOWN.egg-info/PKG-INFO -> UNKNOWN-0.0.0/UNKNOWN.egg-info
copying UNKNOWN.egg-info/SOURCES.txt -> UNKNOWN-0.0.0/UNKNOWN.egg-info
copying UNKNOWN.egg-info/dependency_links.txt -> UNKNOWN-0.0.0/UNKNOWN.egg-info
copying UNKNOWN.egg-info/top_level.txt -> UNKNOWN-0.0.0/UNKNOWN.egg-info
Writing UNKNOWN-0.0.0/setup.cfg
Creating tar archive
removing 'UNKNOWN-0.0.0' (and everything under it)
Backend: Wrote response {'return': 'UNKNOWN-0.0.0.tar.gz'} to /tmp/pep517_build_sdist-7nqesrzb.json
.pkg: 9455 I exit None (0.13 seconds) /home/example> python /home/example/.venv/lib/python3.9/site-packages/pyproject_api/_backend.py True setuptools.build_meta pid=485 [tox/execute/api.py:275]
.pkg: 9457 D package .tmp/package/1/UNKNOWN-0.0.0.tar.gz links to .pkg/dist/UNKNOWN-0.0.0.tar.gz (/home/example/.tox) [tox/util/file_view.py:36]
py: 9460 E internal error [tox/session/cmd/run/single.py:57]
Traceback (most recent call last):
  File "/home/example/.venv/lib/python3.9/site-packages/tox/session/cmd/run/single.py", line 45, in _evaluate
    tox_env.setup()
  File "/home/example/.venv/lib/python3.9/site-packages/tox/tox_env/api.py", line 237, in setup
    self._setup_with_env()
  File "/home/example/.venv/lib/python3.9/site-packages/tox/tox_env/runner.py", line 149, in _setup_with_env
    self._setup_pkg()
  File "/home/example/.venv/lib/python3.9/site-packages/tox/tox_env/runner.py", line 173, in _setup_pkg
    self.installer.install(self._packages, RunToxEnv.__name__, "package")
  File "/home/example/.venv/lib/python3.9/site-packages/tox/tox_env/python/pip/pip_install.py", line 85, in install
    self._install_list_of_deps(arguments, section, of_type)
  File "/home/example/.venv/lib/python3.9/site-packages/tox/tox_env/python/pip/pip_install.py", line 157, in _install_list_of_deps
    self._execute_installer(install_args + groups["pkg"], of_type)
  File "/home/example/.venv/lib/python3.9/site-packages/tox/tox_env/python/pip/pip_install.py", line 164, in _execute_installer
    cmd = self.build_install_cmd(deps)
  File "/home/example/.venv/lib/python3.9/site-packages/tox/tox_env/python/pip/pip_install.py", line 169, in build_install_cmd
    cmd: Command = self._env.conf["install_command"]
  File "/home/example/.venv/lib/python3.9/site-packages/tox/config/sets.py", line 114, in __getitem__
    return self.load(item)
  File "/home/example/.venv/lib/python3.9/site-packages/tox/config/sets.py", line 125, in load
    return config_definition.__call__(self._conf, self.loaders, ConfigLoadArgs(chain, self.name, self.env_name))
  File "/home/example/.venv/lib/python3.9/site-packages/tox/config/of_type.py", line 102, in __call__
    value = loader.load(key, self.of_type, self.factory, conf, args)
  File "/home/example/.venv/lib/python3.9/site-packages/tox/config/loader/api.py", line 127, in load
    converted = self.to(prepared, of_type, factory)
  File "/home/example/.venv/lib/python3.9/site-packages/tox/config/loader/convert.py", line 44, in to
    return self.to_command(raw)  # type: ignore[return-value]
  File "/home/example/.venv/lib/python3.9/site-packages/tox/config/loader/str_convert.py", line 66, in to_command
    if args[0] != "-" and args[0].startswith("-"):
IndexError: list index out of range
.pkg: 9467 W _exit> python /home/example/.venv/lib/python3.9/site-packages/pyproject_api/_backend.py True setuptools.build_meta [tox/tox_env/api.py:408]
Backend: run command _exit with args {}
Backend: Wrote response {'return': 0} to /tmp/pep517__exit-mluwuv97.json
.pkg: 9485 I exit None (0.02 seconds) /home/example> python /home/example/.venv/lib/python3.9/site-packages/pyproject_api/_backend.py True setuptools.build_meta pid=485 [tox/execute/api.py:275]
.pkg: 9595 D delete package /home/example/.tox/.tmp/package/1/UNKNOWN-0.0.0.tar.gz [tox/tox_env/python/virtual_env/package/pyproject.py:171]
  py: FAIL code 2 (8.79 seconds)
  evaluation failed :( (9.12 seconds)

Minimal example

If possible, provide a minimal reproducer for the issue:

tox.ini

[tox]
isolated_build = true

[testenv]
install_command =
    foo: true

(note: a valid pyproject.toml / setup.py file is required alongside this -- I've been using the example pyproject.toml provided below)

pyproject.toml

[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
@gaborbernat 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 Dec 13, 2022
@gaborbernat
Copy link
Member

Feel free to put in a PR to fix this 👍

@gaborbernat gaborbernat added this to the 4.0.x milestone Dec 13, 2022
@jayaddison
Copy link
Contributor Author

A couple of clarifying questions for a pull request (either myself or anyone else helping out before I do):

  • Is there an intended behaviour when a configuration key (like install_command) exists, but no filter patterns match? (in this case, it seems that the previous behaviour in v3.21.4 was to fallback to the default value without raising an error)

  • If multiple platform-specific patterns - say py: ... and py-beos: ... exist for an environment's configuration entry, what should we do?

(I couldn't determine answers to these from the documentation, but it's possible that I missed something)

@gaborbernat
Copy link
Member

gaborbernat commented Dec 13, 2022

  • Is there an intended behaviour when a configuration key (like install_command) exists, but no filter patterns match? (in this case, it seems that the previous behaviour in v3.21.4 was to fallback to the default value without raising an error)

We no longer have custom parsing logic per key, so this custom logic from v3 is no longer supported. In the case, you mention, the install_command will be set to None. So breaking change, but intended. This is to support:

pass_env = 
    A
    c: D

Generates A, D on C, and A otherwise.

  • If multiple platform-specific patterns - say py: ... and py-beos: ... exist for an environment's configuration entry, what should we do?

All would match, and all would be inserted. This is a breaking change we should probably document, to be fair.

@jayaddison
Copy link
Contributor Author

In the case, you mention, the install_command will be set to None. So breaking change, but intended.

Thanks, that makes sense.

One more question: would it seem reasonable to add a {default_install_command} pattern replacement (perhaps with a more concise pattern name) at the same time, or as a follow-up pull request?

The use case (as kinda-but-not-really-demonstrated by foo: ... in the minimal repro example) is to extend/customize behaviour for a single platform, while leaving other platforms using the tox default install command.

If so, a configuration like this could be the result (not valid currently):

[tox]
isolated_build = true

[testenv]
platform =
    beos: beos
install_command =
    {default_install_command}
    beos: --require-hashes

@gaborbernat
Copy link
Member

That wouldn't work because that would imply two separate commands because of the new line 🤔 We don't join lines for install_command...

@gaborbernat
Copy link
Member

gaborbernat commented Dec 14, 2022

That being said if all you want is to include require-hashes for pip for beos you can just do:

set_env = 
    beos: PIP_REQUIRE_HASHES=1

And that's our recommendation going ahead rather than overwriting install_command.

@jayaddison
Copy link
Contributor Author

jayaddison commented Dec 14, 2022

Development begun for a fix for the args access IndexError.

Note that this can also occur at:

self.ignore_exit_code: bool = args[0] == "-" #: a flag indicating if the exit code should be ignored
(discovered after temporarily reverting f4b43b5.)

@jayaddison
Copy link
Contributor Author

The fix I'm considering is to raise a TypeError -- hopefully with some guidance in the output -- if a command parses to an empty set of components/arguments (in other words, args == [] when this line is reached).

@jayaddison
Copy link
Contributor Author

That being said if all you want is to include require-hashes for pip

Not really, that was an attempt at a small example case, and maybe not a good one 😄

In practice: at the moment there's a bug with compiled-from-source lxml 4.9.1 on darwin platforms that means that installing from a binary wheel (pip install --only-binary=...) is sometimes preferable.

So I'm wondering how to do that in tox v4.0.8, preferably without hardcoding the default install_command anywhere (because it could change/diverge).

@gaborbernat
Copy link
Member

I reiterate all pip configurations should be passed through environment variables. I plan to deprecate support for install_command very soon and drop it in v5 of tox. PIP_ONLY_BINARY env var also works.

@jayaddison
Copy link
Contributor Author

jayaddison commented Dec 14, 2022

Ok, sorry - I didn't understand that all pip configuration should begin using environment variables instead. That should work in the binary-wheel selection case. Thank you.

Edit: ...and thanks also for the correction :)

@gaborbernat
Copy link
Member

gaborbernat commented Dec 14, 2022

Ok, sorry - I didn't understand that all configuration should begin using environment variables instead. That should work in the binary-wheel selection case. Thank you.

To clarify all pip configurations 😊 The env var configuration for pip is more generic and easier to maintain.

@jayaddison jayaddison changed the title Regression / behaviour change: install_command with conditional environment name Regression / behaviour change: install_command with empty evaluated value Dec 14, 2022
@jayaddison
Copy link
Contributor Author

Re-prompting this question (that I shouldn't have embedded in a bunch of unrelated text..):

One more question: would it seem reasonable to add a {default_install_command} pattern replacement (perhaps with a more concise pattern name) at the same time, or as a follow-up pull request?

@gaborbernat
Copy link
Member

One more question: would it seem reasonable to add a {default_install_command} pattern replacement (perhaps with a more concise pattern name) at the same time, or as a follow-up pull request?

I'm -1 on this; I don't see how that would be valuable. Better just overwrite it entirely in the spirit of explicit better than implicit.

@jayaddison
Copy link
Contributor Author

One more question: would it seem reasonable to add a {default_install_command} pattern replacement (perhaps with a more concise pattern name) at the same time, or as a follow-up pull request?

I'm -1 on this; I don't see how that would be valuable. Better just overwrite it entirely in the spirit of explicit better than implicit.

Ok, yep - after a bit more consideration, I agree; thanks.

(in particular: if the default command did change in future, then codebases using a replacement pattern like that might experience unexpected and tricky-to-detect ripple effects)

@gaborbernat
Copy link
Member

if the default command did change in future

That sounds like a breaking change requiring transition documentation and a major version bump either way. Unlikely we'd do something so crazy.

@gaborbernat gaborbernat added area:documentation and removed bug:minor does not affect many people or has no big impact labels Dec 20, 2022
@gaborbernat
Copy link
Member

A PR explaining the new behavior in the breaking change section will resolve this issue.

@jayaddison
Copy link
Contributor Author

Resolved by #2806, #2807.

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
2 participants