Skip to content

Getting environments not found error when running a partial set of factors #3096

@atugushev

Description

@atugushev

Issue

Since 4.9.0 having env_list=a-b in tox.ini and running top -e a raises a error:

HandledError| provided environments not found in configuration file: ['a']

This error was caught today on on pip-tools' CI (jazzband/pip-tools#1963), see the log. It's likely a regression introduced in #3089.

Environment

Provide at least:

  • OS: Ubuntu
Output of pip list of the host Python, where tox is installed
Package       Version
------------- -------
cachetools    5.3.1
chardet       5.2.0
colorama      0.4.6
distlib       0.3.7
filelock      3.12.2
packaging     23.1
pip           22.3.1
platformdirs  3.10.0
pluggy        1.2.0
pyproject-api 1.5.4
setuptools    65.5.1
tox           4.9.0
virtualenv    20.24.3
wheel         0.40.0

Output of running tox

Output of tox -rvv
a-b: 266 W remove tox env folder /.tox/a-b [tox/tox_env/api.py:322]
a-b: 307 I find interpreter for spec PythonSpec(path=/usr/local/bin/python) [virtualenv/discovery/builtin.py:58]
a-b: 307 I proposed PythonInfo(spec=CPython3.11.3.final.0-64, exe=/usr/local/bin/python, platform=linux, version='3.11.3 (main, May  3 2023, 08:13:29) [GCC 10.2.1 20210110]', encoding_fs_io=utf-8-utf-8) [virtualenv/discovery/builtin.py:65]
a-b: 308 D accepted PythonInfo(spec=CPython3.11.3.final.0-64, exe=/usr/local/bin/python, platform=linux, version='3.11.3 (main, May  3 2023, 08:13:29) [GCC 10.2.1 20210110]', encoding_fs_io=utf-8-utf-8) [virtualenv/discovery/builtin.py:67]
a-b: 310 D filesystem is case-sensitive [virtualenv/info.py:26]
a-b: 349 I create virtual environment via CPython3Posix(dest=/.tox/a-b, clear=False, no_vcs_ignore=False, global=False) [virtualenv/run/session.py:50]
a-b: 350 D create folder /.tox/a-b/bin [virtualenv/util/path/_sync.py:12]
a-b: 350 D create folder /.tox/a-b/lib/python3.11/site-packages [virtualenv/util/path/_sync.py:12]
a-b: 351 D write /.tox/a-b/pyvenv.cfg [virtualenv/create/pyenv_cfg.py:32]
a-b: 351 D 	home = /usr/local/bin [virtualenv/create/pyenv_cfg.py:36]
a-b: 351 D 	implementation = CPython [virtualenv/create/pyenv_cfg.py:36]
a-b: 352 D 	version_info = 3.11.3.final.0 [virtualenv/create/pyenv_cfg.py:36]
a-b: 352 D 	virtualenv = 20.24.3 [virtualenv/create/pyenv_cfg.py:36]
a-b: 352 D 	include-system-site-packages = false [virtualenv/create/pyenv_cfg.py:36]
a-b: 353 D 	base-prefix = /usr/local [virtualenv/create/pyenv_cfg.py:36]
a-b: 353 D 	base-exec-prefix = /usr/local [virtualenv/create/pyenv_cfg.py:36]
a-b: 353 D 	base-executable = /usr/local/bin/python [virtualenv/create/pyenv_cfg.py:36]
a-b: 354 D symlink /usr/local/bin/python to /.tox/a-b/bin/python [virtualenv/util/path/_sync.py:32]
a-b: 355 D create virtualenv import hook file /.tox/a-b/lib/python3.11/site-packages/_virtualenv.pth [virtualenv/create/via_global_ref/api.py:91]
a-b: 355 D create /.tox/a-b/lib/python3.11/site-packages/_virtualenv.py [virtualenv/create/via_global_ref/api.py:94]
a-b: 356 D ============================== target debug ============================== [virtualenv/run/session.py:52]
a-b: 356 D debug via /.tox/a-b/bin/python /usr/local/lib/python3.11/site-packages/virtualenv/create/debug.py [virtualenv/create/creator.py:200]
a-b: 356 D {
  "sys": {
    "executable": "/.tox/a-b/bin/python",
    "_base_executable": "/usr/local/bin/python3.11",
    "prefix": "/.tox/a-b",
    "base_prefix": "/usr/local",
    "real_prefix": null,
    "exec_prefix": "/.tox/a-b",
    "base_exec_prefix": "/usr/local",
    "path": [
      "/usr/local/lib/python311.zip",
      "/usr/local/lib/python3.11",
      "/usr/local/lib/python3.11/lib-dynload",
      "/.tox/a-b/lib/python3.11/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.11.3 (main, May  3 2023, 08:13:29) [GCC 10.2.1 20210110]",
  "makefile_filename": "/usr/local/lib/python3.11/config-3.11-x86_64-linux-gnu/Makefile",
  "os": "<module 'os' (frozen)>",
  "site": "<module 'site' (frozen)>",
  "datetime": "<module 'datetime' from '/usr/local/lib/python3.11/datetime.py'>",
  "math": "<module 'math' from '/usr/local/lib/python3.11/lib-dynload/math.cpython-311-x86_64-linux-gnu.so'>",
  "json": "<module 'json' from '/usr/local/lib/python3.11/json/__init__.py'>"
} [virtualenv/run/session.py:53]
a-b: 400 I add seed packages via FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/root/.local/share/virtualenv) [virtualenv/run/session.py:57]
a-b: 406 D install pip from wheel /usr/local/lib/python3.11/site-packages/virtualenv/seed/wheels/embed/pip-23.2.1-py3-none-any.whl via CopyPipInstall [virtualenv/seed/embed/via_app_data/via_app_data.py:49]
a-b: 406 D install wheel from wheel /usr/local/lib/python3.11/site-packages/virtualenv/seed/wheels/embed/wheel-0.41.1-py3-none-any.whl via CopyPipInstall [virtualenv/seed/embed/via_app_data/via_app_data.py:49]
a-b: 408 D install setuptools from wheel /usr/local/lib/python3.11/site-packages/virtualenv/seed/wheels/embed/setuptools-68.0.0-py3-none-any.whl via CopyPipInstall [virtualenv/seed/embed/via_app_data/via_app_data.py:49]
a-b: 414 D copy directory /root/.local/share/virtualenv/wheel/3.11/image/1/CopyPipInstall/pip-23.2.1-py3-none-any/pip to /.tox/a-b/lib/python3.11/site-packages/pip [virtualenv/util/path/_sync.py:40]
a-b: 416 D copy /root/.local/share/virtualenv/wheel/3.11/image/1/CopyPipInstall/setuptools-68.0.0-py3-none-any/setuptools-68.0.0.virtualenv to /.tox/a-b/lib/python3.11/site-packages/setuptools-68.0.0.virtualenv [virtualenv/util/path/_sync.py:40]
a-b: 417 D copy directory /root/.local/share/virtualenv/wheel/3.11/image/1/CopyPipInstall/wheel-0.41.1-py3-none-any/wheel-0.41.1.dist-info to /.tox/a-b/lib/python3.11/site-packages/wheel-0.41.1.dist-info [virtualenv/util/path/_sync.py:40]
a-b: 420 D copy directory /root/.local/share/virtualenv/wheel/3.11/image/1/CopyPipInstall/setuptools-68.0.0-py3-none-any/pkg_resources to /.tox/a-b/lib/python3.11/site-packages/pkg_resources [virtualenv/util/path/_sync.py:40]
a-b: 441 D copy /root/.local/share/virtualenv/wheel/3.11/image/1/CopyPipInstall/wheel-0.41.1-py3-none-any/wheel-0.41.1.virtualenv to /.tox/a-b/lib/python3.11/site-packages/wheel-0.41.1.virtualenv [virtualenv/util/path/_sync.py:40]
a-b: 443 D copy directory /root/.local/share/virtualenv/wheel/3.11/image/1/CopyPipInstall/wheel-0.41.1-py3-none-any/wheel to /.tox/a-b/lib/python3.11/site-packages/wheel [virtualenv/util/path/_sync.py:40]
a-b: 549 D generated console scripts wheel3 wheel3.11 wheel-3.11 wheel [virtualenv/seed/embed/via_app_data/pip_install/base.py:43]
a-b: 559 D copy directory /root/.local/share/virtualenv/wheel/3.11/image/1/CopyPipInstall/setuptools-68.0.0-py3-none-any/setuptools-68.0.0.dist-info to /.tox/a-b/lib/python3.11/site-packages/setuptools-68.0.0.dist-info [virtualenv/util/path/_sync.py:40]
a-b: 567 D copy directory /root/.local/share/virtualenv/wheel/3.11/image/1/CopyPipInstall/setuptools-68.0.0-py3-none-any/setuptools to /.tox/a-b/lib/python3.11/site-packages/setuptools [virtualenv/util/path/_sync.py:40]
a-b: 789 D copy /root/.local/share/virtualenv/wheel/3.11/image/1/CopyPipInstall/setuptools-68.0.0-py3-none-any/distutils-precedence.pth to /.tox/a-b/lib/python3.11/site-packages/distutils-precedence.pth [virtualenv/util/path/_sync.py:40]
a-b: 791 D copy directory /root/.local/share/virtualenv/wheel/3.11/image/1/CopyPipInstall/setuptools-68.0.0-py3-none-any/_distutils_hack to /.tox/a-b/lib/python3.11/site-packages/_distutils_hack [virtualenv/util/path/_sync.py:40]
a-b: 796 D generated console scripts  [virtualenv/seed/embed/via_app_data/pip_install/base.py:43]
a-b: 868 D copy directory /root/.local/share/virtualenv/wheel/3.11/image/1/CopyPipInstall/pip-23.2.1-py3-none-any/pip-23.2.1.dist-info to /.tox/a-b/lib/python3.11/site-packages/pip-23.2.1.dist-info [virtualenv/util/path/_sync.py:40]
a-b: 871 D copy /root/.local/share/virtualenv/wheel/3.11/image/1/CopyPipInstall/pip-23.2.1-py3-none-any/pip-23.2.1.virtualenv to /.tox/a-b/lib/python3.11/site-packages/pip-23.2.1.virtualenv [virtualenv/util/path/_sync.py:40]
a-b: 873 D generated console scripts pip-3.11 pip3 pip pip3.11 [virtualenv/seed/embed/via_app_data/pip_install/base.py:43]
a-b: 873 I add activators for Bash, CShell, Fish, Nushell, PowerShell, Python [virtualenv/run/session.py:63]
a-b: 878 D write /.tox/a-b/pyvenv.cfg [virtualenv/create/pyenv_cfg.py:32]
a-b: 878 D 	home = /usr/local/bin [virtualenv/create/pyenv_cfg.py:36]
a-b: 878 D 	implementation = CPython [virtualenv/create/pyenv_cfg.py:36]
a-b: 878 D 	version_info = 3.11.3.final.0 [virtualenv/create/pyenv_cfg.py:36]
a-b: 879 D 	virtualenv = 20.24.3 [virtualenv/create/pyenv_cfg.py:36]
a-b: 879 D 	include-system-site-packages = false [virtualenv/create/pyenv_cfg.py:36]
a-b: 879 D 	base-prefix = /usr/local [virtualenv/create/pyenv_cfg.py:36]
a-b: 879 D 	base-exec-prefix = /usr/local [virtualenv/create/pyenv_cfg.py:36]
a-b: 880 D 	base-executable = /usr/local/bin/python [virtualenv/create/pyenv_cfg.py:36]
a-b: 882 W commands_pre[0]> python -c 'print("a")' [tox/tox_env/api.py:427]
a
a-b: 916 I exit 0 (0.03 seconds) /> python -c 'print("a")' pid=556 [tox/execute/api.py:279]
a-b: 917 W commands_pre[1]> python -c 'print("b")' [tox/tox_env/api.py:427]
b
a-b: 946 I exit 0 (0.03 seconds) /> python -c 'print("b")' pid=562 [tox/execute/api.py:279]
a-b: 947 W commands[0]> python -c 'print("ok")' [tox/tox_env/api.py:427]
ok
a-b: 976 I exit 0 (0.03 seconds) /> python -c 'print("ok")' pid=568 [tox/execute/api.py:279]
  a-b: OK (0.71=setup[0.62]+cmd[0.03,0.03,0.03] seconds)
  congratulations :) (0.80 seconds)

Minimal example

  1. tox.ini:
# tox.ini
[tox]
env_list=a-b

[testenv]
package=skip
commands_pre =
  a: python -c 'print("a")'
  b: python -c 'print("b")'
commands=python -c 'print("ok")'
  1. run tox:
$ tox -e a
ROOT: HandledError| provided environments not found in configuration file: ['a']

Expected result

$ pip install tox==4.8.0
Successfully installed tox-4.8.0

$ tox -e a
a: commands_pre[0]> python -c 'print("a")'
a
a: commands[0]> python -c 'print("ok")'
ok
  a: OK (0.11=setup[0.05]+cmd[0.03,0.03] seconds)
  congratulations :) (0.19 seconds)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions