-
Notifications
You must be signed in to change notification settings - Fork 54
Use setuptools_scm to dynamically create the version #1486
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
Conversation
Signed-off-by: David Wallace <david.wallace@tu-darmstadt.de>
|
Are tests passing locally? Is there something wrong with the version in init.py? It looks as if every tests fails? |
|
This is weird, locally it works. Even if I download the |
|
Something with replace and None. Maybe you temporarily select just one test module via Also add |
|
Ok, this is a weird Python quirk. If I install the wheel locally and run I think is is also why |
|
maybe move to the "conventional" to get the version in the |
|
Yes, thanks, that is apparently the way to go. Added it (a bit more concise) to this branch. I looked at other repose and now I am also convinced that |
| from importlib.metadata import version as _version | ||
|
|
||
| try: | ||
| VERSION = __version__ = _version(__package__) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Last question: Which part of the project consumes VERSION? I saw a couple of usages of ___version__.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its just convention to expose VERSION and __version__ in the "root" python module, e.g. https://github.com/django/django/blob/main/django/__init__.py.
MyPyDavid
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me like this!
It still makes the ...dev..+g.. version as well.
With
2.4.0, I would like to an automatically generated version, created from the git tag or the latest ref. I use this setup in several other repos for some time now. Any objections @MyPyDavid @afuetterer ? (lets see if this breaks the CI)