add __version__ attribute to module (or class) #17

Closed
LarsNordin opened this Issue Mar 15, 2012 · 4 comments

Projects

None yet

2 participants

@LarsNordin

It would be nice to be able to display the version of the module from within the code

@salimfadhley

You can already do this with pkg_resources. Does anybody else think we have a need for this feature?

@LarsNordin

To be clear: I can run the following on a system where the package is installed:

import pkg_resources
print pkg_resources.get_distribution("jenkinsapi").version

This works but isn't very standard python-ish.

@salimfadhley

Feel free to have a go at implementing this - it's not a priority but it might be helpful for the doc generator.

@salimfadhley

I've used @LarsNordin 's solution in the doc generator. It works perfectly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment