-
Notifications
You must be signed in to change notification settings - Fork 123
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
Have a unified way of showing info about installed plugins #87
Comments
Huh, yeah I guess we don't have anything for that yet. @RonnyPfannschmidt @obestwalter what were you thinking? How bout version, path = PluginManager.get_info(plugin_name) |
get_info is pretty much nonsaying, its not an acceptable api |
I think we should figure out what in general a command line tool using pluggy should output when tox current version (no pluggy information at all):
tox dev version (fetching pluggy info via): https://github.com/tox-dev/tox/blob/aa05d0fd625322bad1fb451ef2e192523061d831/tox/config.py#L263-L272
for pytest:
pytest also outputs the version info to stderr, which I find strange, but that is another topic. Pluggy should offer a function that returns a string representation of all relevant information about what is installed through it and how (and maybe with different verbosity levels, if that makes sense). I do not know too much about pluggy yet, so I don't know what information is there and how it should be presented. I am quite happy though with that comes back from I also think that the info should say that those pugins are installed via pluggy (and then maybe more concrete info about the mechanism, e.g. setuptools). |
So, basically not much different of what we now construct from
|
for good measure - here is what devpi does:
|
I still think it would be good to consolidate this functionality into pluggy instead of everybody baking their own thing. |
the main question is api until then i believe its fine just to have a helper that lists names and versions for setuptools plugins off a pluginmanager |
Can you explain that problem further? I don't get it. From the perspective of a maintainer of a project using pluggy I would like to have a convenience method to give me a human readable version of the installed plugins. What I did in tox was simply:
This is running happily for quite a while now and I haven't seen any problems with it yet: I am pretty sure that if we put our heads together we can come up with a bit more generalized version of that that catches some corner cases I might not have foreseen (which is another reason, why I would rather have a proper wrapper directly from pluggy rather then digging around in the guts). Regarding API and naming things I could think of several ways: e.g. adding a Or make that parameter more versatile by passing in a string that asks for the info in one of several formats. Or add a method |
pytest: https://github.com/pytest-dev/pytest/blob/master/_pytest/helpconfig.py#L154
|
looks like pytest even grew two ways of doing the same thing already? I did not look to closely but here it is: https://github.com/pytest-dev/pytest/blob/master/_pytest/terminal.py#L455 https://github.com/pytest-dev/pytest/blob/master/_pytest/terminal.py#L736
|
devpi server does save the generated output in a dict and sorts the stuff (good idea), but not fundamentally different: https://github.com/devpi/devpi/blob/master/server/devpi_server/main.py#L309
|
i beleive an api getting a sorted by name list of unique setuptools plugins might be a nice point - it should be a helper function not part of the pluginmanager |
I think it should be part of the plugin manager, because
I would prefer something like this: pluginmanager.list_plugin_distinfo(format='human_readable') |
@obestwalter depending on circumstances human readable is pain text, formatteddifferently, maybe html, maybe terminal encoded ^^ plus different implementation may choose to behave different in different circumstances (like list distributions vs list actual plugins) - there is a lot of choice possible and its all presentation logic thats completely unrelated to actual plugin management - as such i beleive its best experimented with and implemented with as an external consumer of pluginmanager, not as a part of it |
Greetings. I am going through old issues and I think this can be closed as not really worth following up on. As @RonnyPfannschmidt said:
|
When implementing tox-dev/tox#544 a discussion arose about what it should look like when you output version information about the tool.
tox-dev/tox#628 (comment)
So I leave that suggestion here, that pluggy could provide a higher level API to output version information and maybe with different levels of exactness/verbosity (e.g. full paths, vs. just names and versions).
The text was updated successfully, but these errors were encountered: