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

pandas_schema.__version__ does not return package version #11

Closed
chfischer opened this issue Jun 29, 2018 · 3 comments
Closed

pandas_schema.__version__ does not return package version #11

chfischer opened this issue Jun 29, 2018 · 3 comments
Assignees

Comments

@chfischer
Copy link

The package does not return version information.

@multimeric multimeric self-assigned this Jun 29, 2018
@smarie
Copy link

smarie commented Sep 3, 2019

For what's worth, a good way to do this automatically is by using the great setuptools_scm library, like this: https://smarie.github.io/python-getversion/#package-versioning-best-practices

@multimeric
Copy link
Owner

Is it not possible to just use setuptools to interrogate the version?

>>> from pkg_resources import get_distribution
>>> dist = get_distribution('pandas_schema')
>>> dist.version
'0.3.1'

This seems easy enough, no?

@smarie
Copy link

smarie commented Sep 4, 2019

Two completely independent topics:

  • this issue seems to be about how to easily create the __version__ attribute in your project so as to comply with PEP396. To do so in an easy and fully automatic way, I recommend the procedure mentioned above, that relies on setuptools_scm. I personally use it on several packages. This is how I do it : Add __version__ attribute to comply with PEP396 smarie/python-makefun#45 (I realized that it was not done for this project, so I took the opportunity to do it right now :) )

  • another issue that you mention in your last comment, (that is off-topic for this project) is how can users reliably get the version of any package. Just for reference, setuptools (that you mention) has many limitations, it can not get the version of all packages. That's why I created getversion, a package that combines setuptools with PEP396 and several other methods, so that you are almost guaranteed to get a version number, whatever twisted package you're asking the version for :)

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

No branches or pull requests

3 participants