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

Option -a, --listenvs-all does not list environments defined with dict-like syntax #645

Closed
volans- opened this issue Oct 8, 2017 · 3 comments

Comments

@volans-
Copy link

volans- commented Oct 8, 2017

The option -a, --listenvs-all does not list environments defined implicitly inside the [testenv] section in the INI file through the dict-like syntax of commands.
It was introduced with #495 to fix #271.

Versions: tox 2.9.1 with Python 2.7.10 on macOS Sierra.

Repro setup:

[tox]
minversion = 1.6
skipsdist = true
envlist = default

[testenv]
whitelist_externals = echo
commands =
    default: echo "{envname}"
    extra: echo "{envname}"

Expected output:

$ tox -l
default
$ tox -a
default
extra

Current output:

$ tox -l
default
$ tox -a
default

It looks to me that the way the extra environment list is generated in https://github.com/tox-dev/tox/blob/master/tox/session.py#L652 takes account only of the INI sections in the tox.ini file. If I add a section [testenv:extra], then the extra environment is properly listed.

@volans-
Copy link
Author

volans- commented Oct 8, 2017

As a side note it would be nice to have the possibility to take advantage of the expanding syntax to define envlist but mark some of them as additional so that they do not run by default when executing tox alone.

Something like:

[tox]
envlist = {flake8,unit}{,-min,-extra}
mark_extra = min,extra

or

[tox]
envlist =  flake8,unit
extra_envlist =  {flake8,unit}-{min,extra}

But I'm going offtopic and towards a feature request, so I'll stop here.

@obestwalter
Copy link
Member

obestwalter commented Oct 8, 2017

Hi @volans- thanks for the report, the original request is a duplicate of #505 and as you can see there, it is not without it's thorns. Closing this one to keep the discussion there.

The second one also looks vaguely familiar. I think we have a similar request already, but I can't find it atm. Maybe you want to poke around a bit in the issues and check out the discussion there?

@volans-
Copy link
Author

volans- commented Oct 8, 2017

@obestwalter thanks for the quick reply, I searched a bit for similar issues before opening this one but didn't find the #505, sorry for the added noise. I'll look for the other one too.

@tox-dev tox-dev locked and limited conversation to collaborators Jan 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants