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

Let tox --listenvs list all defined environments, not only from envlist in [tox] section #271

Closed
pytoxbot opened this issue Sep 17, 2016 · 5 comments · Fixed by #495
Closed

Comments

@pytoxbot
Copy link

Issue #52 asks for having a command to list all configured environments.

However, I found, that it lists only those environments, which are in envlist.

If I do not want to run some of the environments when tox is invoked without any argument, I keep the envlist in [tox] shorter. However, this does not print it out when::

$ tox -l

It would be nice to list all existing environments.

tox version: 2.1.1

OS: Debian Jessie

Python 2.7.9

Sample tox.ini:

#!ini

# Tox (http://tox.testrun.org/) is a tool for running tests
# in multiple virtualenvs. This configuration file will run the
# test suite on all supported python versions. To use it, "pip install tox"
# and then run "tox" from this directory.

[tox]
envlist = help
skipsdist = true

[testenv:help]
basepython = python2.7
commands = python -c "print(open('tox.help').read());" 
deps =

[testenv:docs]
basepython = python2.7
whitelist_externals =
    make
changedir = docs
commands = make html
deps = 
    -rrequirements-docs.txt

[testenv:testsamples]
basepython = python2.7
envdir = {toxworkdir}/test
commands = py.test -sv tests/test_samples.py
deps =
    -rrequirements-json.txt

[testenv:testschema]
basepython = python2.7
envdir = {toxworkdir}/test
commands = py.test -sv tests/test_schema.py
deps =
    -rrequirements-json.txt

[testenv:testyaml]
basepython = python2.7
envdir = {toxworkdir}/test
commands = py.test -sv tests/test_sample.py --yamlsample []
deps =
    -rrequirements-json.txt

[testenv:testjson]
basepython = python2.7
envdir = {toxworkdir}/test
commands = py.test -sv tests/test_sample.py --jsonsample []
deps =
    -rrequirements-json.txt

For given tox.ini it lists only help:

#!bash

$ tox --listenvs
help

and I would like to see there all:

#!bash

$ tox --listenvs
help
docs
testsamples
testschema
testyaml
testjson
@pytoxbot
Copy link
Author

Original comment by @obestwalter

+1 That is actually what I as a tox user would expect tox --listenvs to print out.

@volans-
Copy link

volans- commented Feb 15, 2017

+1, how a user could discover an environment not run by default?

@obestwalter
Copy link
Member

how a user could discover an environment not run by default?

Until this issue is resolved only by looking for all [testenv:???]sections directly in the tox.ini of the project .

@gaborbernat
Copy link
Member

created an implementation for this based on top of #489, I'll create the PR once that gets accepted 👍

obestwalter added a commit that referenced this issue Apr 1, 2017
[#271] show all defined enviroments for listenv, not just what's in envlist
@obestwalter
Copy link
Member

fixed in #495

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

Successfully merging a pull request may close this issue.

4 participants