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

module 'xgi' has no attribute '__version__' #43

Closed
maximelucas opened this issue Feb 14, 2022 · 4 comments · Fixed by #44
Closed

module 'xgi' has no attribute '__version__' #43

maximelucas opened this issue Feb 14, 2022 · 4 comments · Fixed by #44
Labels
new feature New feature or request

Comments

@maximelucas
Copy link
Collaborator

import xgi
xgi.__version__

yields module 'xgi' has no attribute '__version__'. It would be nice to support it.

@maximelucas maximelucas added the new feature New feature or request label Feb 14, 2022
@leotrs
Copy link
Collaborator

leotrs commented Feb 14, 2022

That's a good point. There are two main ways to support version variables: hard-code them or make them increase automatically. The latter option is surprisingly hard because of how python packages work so I vote we hard code them.

However, this adds an item to the release check list...

@nwlandry
Copy link
Collaborator

nwlandry commented Feb 14, 2022

This is a good idea! My thought is that we can add this code block (suggested in this thread) in __init__.py at the top level which will get the version specified in setuptools:

import pkg_resources
__version__ = pkg_resources.require("xgi")[0].version

I just tested it locally and verified that it works.

@maximelucas
Copy link
Collaborator Author

Nice, fine with me.

@iaciac
Copy link
Collaborator

iaciac commented Feb 15, 2022

Good call! And good to know about this ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants