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.ini parsing regression with globbed modules #2746

Closed
tfranzel opened this issue Dec 18, 2022 · 1 comment · Fixed by #2748
Closed

tox.ini parsing regression with globbed modules #2746

tfranzel opened this issue Dec 18, 2022 · 1 comment · Fixed by #2748

Comments

@tfranzel
Copy link

Our CI suddenly stopped working with tox==4.0.13. 4.0.12 works as expected. The command is tox -l

config file has globbed submodules which look like this: [mypy-rest_framework.compat.*]. Tox seems to choke here.

https://github.com/tfranzel/drf-spectacular/blob/7bfcfb16fe63556f0c6044a4fda4d41cca058051/tox.ini#L97

File "/opt/hostedtoolcache/Python/3.10.9/x64/bin/tox", line 8, in <module>
    sys.exit(run())
  File "/opt/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/tox/run.py", line 19, in run
    result = main(sys.argv[1:] if args is None else args)
  File "/opt/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/tox/run.py", line 45, in main
    result = handler(state)
  File "/opt/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/tox/session/cmd/legacy.py", line 105, in legacy
    return list_env(state)
  File "/opt/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/tox/session/cmd/list_env.py", line 27, in list_env
    active = dict.fromkeys(state.envs.iter())
  File "/opt/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/tox/session/env_select.py", line 333, in iter
    for name, env_info in self._defined_envs.items():
  File "/opt/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/tox/session/env_select.py", line 176, in _defined_envs
    env_name_to_active = self._env_name_to_active()
  File "/opt/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/tox/session/env_select.py", line [15](https://github.com/tfranzel/drf-spectacular/actions/runs/3721512771/jobs/6316917714#step:5:16)1, in _env_name_to_active
    for name in a_collection:
  File "/opt/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/tox/config/source/ini.py", line 70, in envs
    for name in self._discover_tox_envs(core_config):
  File "/opt/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/tox/config/source/ini.py", line 86, in _discover_tox_envs
    register_factors(section.names)
  File "/opt/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/tox/config/source/ini_section.py", line [18](https://github.com/tfranzel/drf-spectacular/actions/runs/3721512771/jobs/6316917714#step:5:19), in names
    elements = list(extend_factors(self.name))
  File "/opt/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/tox/config/loader/ini/factor.py", line 41, in extend_factors
    for group in find_factor_groups(value):
  File "/opt/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/tox/config/loader/ini/factor.py", line 65, in find_factor_groups
    for env in expand_env_with_negation(value):
  File "/opt/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/tox/config/loader/ini/factor.py", line 80, in expand_env_with_negation
    raise ValueError(variant_str)
ValueError: mypy-rest_framework.compat.*
@tfranzel
Copy link
Author

can confirm the issue is resolved with 4.0.14. thanks alot @gaborbernat for the quick fix and release ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant