-
Notifications
You must be signed in to change notification settings - Fork 13
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
Added versioning to init.py and setup.py using the manual approach. #20
Added versioning to init.py and setup.py using the manual approach. #20
Conversation
@@ -0,0 +1 @@ | |||
__version__ = "0.2.1-dev" |
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.
Usually "0.y.z" already states "dev" no?
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.
I am not an expert on this: this "dev" means that is the development version after the tagging of the last release (the docs will be built from the master branch as for ctapipe, which code to get the version is a bit complicated for me now.).
I have seen people using "-alpha", "-beta", but I didn't want to be overly specific for the moment.
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.
I think in this case, "dev" means "not a tagged release"
setup.py
Outdated
setup( | ||
name="protopipe", | ||
version="0.2.1-dev", |
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.
Error-prone when the version changes and you have several places to update.
You might prefer to read the version directly:
import protopipe
setup(
name="protopipe",
version=protopipe.__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.
Yes, I agree!
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.
Is it costumary to import the package in here?
Like import protopipe
and then protopipe.__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.
There are several ways to do it and I am not sure there is really one customary way.
You may also use
from pkg_resources import get_distribution
get_distribution('protopipe').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.
This way I would need to add a new dependence.
Doing from protopipe._version import __version__
should work nicely for the moment and I can do the same later in docs/conf.py
.
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.
Then why not importing protopipe as suggested first?
It is customary to have the version in __init__.py
.
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.
Yes, in the end, is the same, __version__
gets imported from __init__.py
setup.py
Outdated
description="Pipeline to process events from DL0 to DL3", | ||
url="https://github.com/cta-observatory/protopipe", | ||
author="CEA", |
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.
cta-observatory?
Or authors read directly from GitHub.
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.
Yes, I forgot to update the authors: I can update the list from GitHub - is there an automatic way? I can do it as in ctapipe but later; fast solution would be to copy paste the list from the CHANGELOG
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.
Yes have a look into ctapipe
@@ -0,0 +1 @@ | |||
__version__ = "0.2.1-dev" |
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.
I think in this case, "dev" means "not a tagged release"
I guess you could also call it "0.2.2-alpha" or something like that (e.g. the alpha version of the next release). No preference for me, as long as it's updated (obviously) when you do the actual release. @vuillaut this is just so that if somebody installs the master version using pip, you can tell it's not a release version. |
Yes, I guess alpha would be anyway a more correct naming. |
Versioning in the documentation will be added after this PR has been merged.