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

display a short documentation with the -l/ show envlist (a concatenation of the environments description) #489

Merged
merged 1 commit into from
Mar 25, 2017

Conversation

gaborbernat
Copy link
Member

This is the implementation for #462.

For example:

[tox]
envlist={py27,py36}-{windows,linux}
[testenv]
description= py27: run py.test on Python 2.7
             py36: run py.test on Python 3.6
             windows: on Windows platform
             linux: on Linux platform
             docs: generate documentation
commands=py.test {posargs}

[testenv:docs]
changedir = docs
tox -l 
py27-windows run py.test on Python 2.7 on Windows platform
py27-linux   run py.test on Python 2.7 on Linux platform
py36-windows run py.test on Python 3.6 on Windows platform
py36-linux   run py.test on Python 3.6 on Linux platform

tox/session.py Outdated
for env in self.config.envlist:
self.report.line("%s" % env)
self.report.line("{} {}".format(env.ljust(max_length), self.config.envconfigs[env].description))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be {0} {1} to work on Python 2.6 - it seems like it doesn't get caught in the tests though, and they report "can not run tests involving calling tox on python2.6. (and python2.6 is about to be deprecated anyway)"...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@The-Compiler indeed, fixed that, thanks!

@gaborbernat
Copy link
Member Author

@The-Compiler , @obestwalter now that the CI checks passed, can you guys take a look? thanks!

@The-Compiler
Copy link
Member

LGTM (though I don't know tox' code very well), but I'll let @obestwalter press the button 😉

@nicoddemus
Copy link
Member

LGTM as well, but I feel we should add docs about this new feature first.

@@ -1,3 +1,4 @@
.vagrant
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ha - nice to see it's being used already - does not really belong to this PR, but won't hurt anyone to just add it now, I guess :)

@obestwalter
Copy link
Member

@The-Compiler what an honour :D - I agree with @nicoddemus that this deserves some documentation (somewhere here-ish) before we call this done.

@gaborbernat
Copy link
Member Author

@obestwalter hmm, I thought that's automatically taken during documentation generation from here:

 parser.add_testenv_attribute(
        name="description", type="string", default='', postprocess=merge_description,
        help="short description of this environment")

Where is that shown otherwise?

@The-Compiler
Copy link
Member

When doing tox --help

@gaborbernat
Copy link
Member Author

@obestwalter , @The-Compiler done 👍

@obestwalter obestwalter self-assigned this Mar 25, 2017
@obestwalter obestwalter merged commit 270d85f into tox-dev:master Mar 25, 2017
@obestwalter
Copy link
Member

Played around with it locally a bit and it looks good. Looking forward to the next step that fixes #271.

@The-Compiler
Copy link
Member

I can't get this to work with the 2.7.0 preview with this tox.ini. Both description = Hello World in [testenv:py36-cov] (which is what I'd expect to work by reading the docs) and description = py36-cov: Hello World in [testenv] (which seems odd, but what the tests do) still gives me no description in the env list.

@obestwalter
Copy link
Member

obestwalter commented Mar 26, 2017

o.k. just tried the unconditional approach with 2.7.0 from devpi with this ini:

[tox]
envlist={py27,py36}-{windows,linux}
[testenv]
description= hello world

[testenv:docs]
description = blablabla


$ tox -l

py27-windows hello world
py27-linux   hello world
py36-windows hello world
py36-linux   hello world

$ tox -l -e docs

docs blablabla

So from how I understand it, it works like it should. Am I missing something?

@The-Compiler
Copy link
Member

Oh, damn, my bad! I was running my systemwide tox instead of the one from the virtualenv... nevermind! 😊

@gaborbernat
Copy link
Member Author

@obestwalter cool, submitted the PR for #271 in #495

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 this pull request may close these issues.

4 participants