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

tox -e expansion seems to parse incorrectly #2850

Open
tucked opened this issue Jan 10, 2023 · 3 comments
Open

tox -e expansion seems to parse incorrectly #2850

tucked opened this issue Jan 10, 2023 · 3 comments
Labels
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.

Comments

@tucked
Copy link

tucked commented Jan 10, 2023

I'm using tox 4.2.3.

[tox]
[testenv]
deps =
  pytest6.x: pytest~=6.0
  pytest7.x: pytest~=7.0
commands = pytest --version
$ tox -e py38-pytest7.x
py38-pytest7.x: commands[0]> pytest --version
pytest 7.2.0
  py38-pytest7.x: OK (0.57=setup[0.15]+cmd[0.42] seconds)
  congratulations :) (0.87 seconds)
$ tox -e 'py38-pytest{6.x,7.x}'
  File "/ifs/home/dtucker/.local/pipx/venvs/tox/lib/python3.8/site-packages/tox/tox_env/api.py", line 248, in setup
    self._setup_env()
  File "/ifs/home/dtucker/.local/pipx/venvs/tox/lib/python3.8/site-packages/tox/tox_env/python/runner.py", line 107, in _setup_env
    self._install_deps()
  File "/ifs/home/dtucker/.local/pipx/venvs/tox/lib/python3.8/site-packages/tox/tox_env/python/runner.py", line 110, in _install_deps
    requirements_file: PythonDeps = self.conf["deps"]
  File "/ifs/home/dtucker/.local/pipx/venvs/tox/lib/python3.8/site-packages/tox/config/sets.py", line 114, in __getitem__
    return self.load(item)
  File "/ifs/home/dtucker/.local/pipx/venvs/tox/lib/python3.8/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 "/ifs/home/dtucker/.local/pipx/venvs/tox/lib/python3.8/site-packages/tox/config/of_type.py", line 102, in __call__
    value = loader.load(key, self.of_type, self.factory, conf, args)
  File "/ifs/home/dtucker/.local/pipx/venvs/tox/lib/python3.8/site-packages/tox/config/loader/api.py", line 124, in load
    raw = self.load_raw(key, conf, args.env_name)
  File "/ifs/home/dtucker/.local/pipx/venvs/tox/lib/python3.8/site-packages/tox/config/loader/ini/__init__.py", line 42, in load_raw
    return self.process_raw(conf, env_name, self._section_proxy[key])
  File "/ifs/home/dtucker/.local/pipx/venvs/tox/lib/python3.8/site-packages/tox/config/loader/ini/__init__.py", line 56, in process_raw
    factor_filtered = filter_for_env(strip_comments, env_name)  # select matching factors
  File "/ifs/home/dtucker/.local/pipx/venvs/tox/lib/python3.8/site-packages/tox/config/loader/ini/factor.py", line 13, in filter_for_env
    set(chain.from_iterable([(i for i, _ in a) for a in find_factor_groups(name)])) if name is not None else set()
  File "/ifs/home/dtucker/.local/pipx/venvs/tox/lib/python3.8/site-packages/tox/config/loader/ini/factor.py", line 13, in <listcomp>
    set(chain.from_iterable([(i for i, _ in a) for a in find_factor_groups(name)])) if name is not None else set()
  File "/ifs/home/dtucker/.local/pipx/venvs/tox/lib/python3.8/site-packages/tox/config/loader/ini/factor.py", line 65, in find_factor_groups
    for env in expand_env_with_negation(value):
  File "/ifs/home/dtucker/.local/pipx/venvs/tox/lib/python3.8/site-packages/tox/config/loader/ini/factor.py", line 83, in expand_env_with_negation
    raise ValueError(variant_str)
ValueError: py38-pytest{6.x
py38-pytest{6.x: FAIL ✖ in 0.1 seconds
7.x}: internal error
Traceback (most recent call last):
  File "/ifs/home/dtucker/.local/pipx/venvs/tox/lib/python3.8/site-packages/tox/session/cmd/run/single.py", line 45, in _evaluate
    tox_env.setup()
  File "/ifs/home/dtucker/.local/pipx/venvs/tox/lib/python3.8/site-packages/tox/tox_env/api.py", line 248, in setup
    self._setup_env()
  File "/ifs/home/dtucker/.local/pipx/venvs/tox/lib/python3.8/site-packages/tox/tox_env/python/runner.py", line 107, in _setup_env
    self._install_deps()
  File "/ifs/home/dtucker/.local/pipx/venvs/tox/lib/python3.8/site-packages/tox/tox_env/python/runner.py", line 110, in _install_deps
    requirements_file: PythonDeps = self.conf["deps"]
  File "/ifs/home/dtucker/.local/pipx/venvs/tox/lib/python3.8/site-packages/tox/config/sets.py", line 114, in __getitem__
    return self.load(item)
  File "/ifs/home/dtucker/.local/pipx/venvs/tox/lib/python3.8/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 "/ifs/home/dtucker/.local/pipx/venvs/tox/lib/python3.8/site-packages/tox/config/of_type.py", line 102, in __call__
    value = loader.load(key, self.of_type, self.factory, conf, args)
  File "/ifs/home/dtucker/.local/pipx/venvs/tox/lib/python3.8/site-packages/tox/config/loader/api.py", line 124, in load
    raw = self.load_raw(key, conf, args.env_name)
  File "/ifs/home/dtucker/.local/pipx/venvs/tox/lib/python3.8/site-packages/tox/config/loader/ini/__init__.py", line 42, in load_raw
    return self.process_raw(conf, env_name, self._section_proxy[key])
  File "/ifs/home/dtucker/.local/pipx/venvs/tox/lib/python3.8/site-packages/tox/config/loader/ini/__init__.py", line 56, in process_raw
    factor_filtered = filter_for_env(strip_comments, env_name)  # select matching factors
  File "/ifs/home/dtucker/.local/pipx/venvs/tox/lib/python3.8/site-packages/tox/config/loader/ini/factor.py", line 13, in filter_for_env
    set(chain.from_iterable([(i for i, _ in a) for a in find_factor_groups(name)])) if name is not None else set()
  File "/ifs/home/dtucker/.local/pipx/venvs/tox/lib/python3.8/site-packages/tox/config/loader/ini/factor.py", line 13, in <listcomp>
    set(chain.from_iterable([(i for i, _ in a) for a in find_factor_groups(name)])) if name is not None else set()
  File "/ifs/home/dtucker/.local/pipx/venvs/tox/lib/python3.8/site-packages/tox/config/loader/ini/factor.py", line 65, in find_factor_groups
    for env in expand_env_with_negation(value):
  File "/ifs/home/dtucker/.local/pipx/venvs/tox/lib/python3.8/site-packages/tox/config/loader/ini/factor.py", line 83, in expand_env_with_negation
    raise ValueError(variant_str)
ValueError: 7.x}
  py38-pytest{6.x: FAIL code 2 (0.10 seconds)
  7.x}: FAIL code 2 (0.01 seconds)
  evaluation failed :( (0.25 seconds)
@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 Jan 11, 2023
@gaborbernat gaborbernat added this to the P-1 milestone Jan 11, 2023
@gaborbernat
Copy link
Member

PR welcome.

@Jajauma
Copy link

Jajauma commented Jan 12, 2023

At the same time parsing envlist in tox.ini seems to work correctly. The override option can be used as a workaround, e.g.:

tox run -x 'tox.envlist=py{x,y,z}-{a,b,c}'

@merwok
Copy link

merwok commented Jan 13, 2023

I also noticed this with such config:

...

[coverage:report]
exclude_lines =
    pragma: no cover

tox -e completion suggests pragma

@gaborbernat gaborbernat removed this from the P-1 milestone Jun 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.
Projects
None yet
Development

No branches or pull requests

4 participants