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

pytest --version should also display information about installed plugins #8393

Closed
ssbarnea opened this issue Mar 3, 2021 · 4 comments
Closed

Comments

@ssbarnea
Copy link
Member

ssbarnea commented Mar 3, 2021

At this moment pytest --version does only output one line with its current version, missing to mention other essential informations which do affect its execution: installed plugins and python version.

Based on other tools that support plugins I dare to suggest extending the display to something similar with tox output:

$ tox --version
3.21.3 imported from /Users/ssbarnea/.pyenv/versions/3.8.6/lib/python3.8/site-packages/tox/__init__.py
registered plugins:
    tox-envreport-0.2.1 at /Users/ssbarnea/.pyenv/versions/3.8.6/lib/python3.8/site-packages/tox_envreport/plugin.py
    tox-ansible-1.0.5.dev1 at /Users/ssbarnea/c/a/tox-ansible/src/tox_ansible/hooks.py

I do not have a strong opinion regarding if those paths should be printed, but plugins and their versions are essential.

Also it would be wise to assure that the first line still starts with pytest <version>, so it would be unlikely to break parsing of version, if anyone did this. I mention this because recently Ansible managed to break even this, by adding some other bit between tool name and the version... :p

@The-Compiler
Copy link
Member

It already does this with --version --version - see #7169 and #7128. Given that the change was introduced because some people felt --version was too verbose (and there's precedence for repeating the argument for more verbose version info in other tools), I don't see a reason to go back.

@ssbarnea
Copy link
Member Author

ssbarnea commented Mar 3, 2021

Ooops, I kinda deserve a RTFM on that..... It is the first time when I see that --version is used like that, maybe I would have seen more logic on enabling it via -v instead of repeating it. Anyway sorry for creating a false bug report and thanks!

@ssbarnea ssbarnea closed this as completed Mar 3, 2021
@nicoddemus
Copy link
Member

nicoddemus commented Mar 3, 2021

maybe I would have seen more logic on enabling it via -v instead of repeating it

That was the original idea, but other tools (including Python) follow the same approach: #3692 (comment)

@ssbarnea
Copy link
Member Author

ssbarnea commented Mar 3, 2021

I did not see this documented on https://clig.dev/ but it would not be a bad idea to make a pull-request to improve it and to mention that displaying version twice could display more information. That guide is very useful for anyone writing CLI tools.

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

No branches or pull requests

3 participants