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

Added versioning to init.py and setup.py using the manual approach. #20

Merged

Conversation

HealthyPear
Copy link
Member

@HealthyPear HealthyPear commented Nov 6, 2019

Versioning in the documentation will be added after this PR has been merged.

@@ -0,0 +1 @@
__version__ = "0.2.1-dev"
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Contributor

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",
Copy link
Member

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__

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I agree!

Copy link
Member Author

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__?

Copy link
Member

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

Copy link
Member Author

@HealthyPear HealthyPear Nov 6, 2019

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.

Copy link
Member

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.

Copy link
Member Author

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",
Copy link
Member

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.

Copy link
Member Author

@HealthyPear HealthyPear Nov 6, 2019

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

Copy link
Member

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"
Copy link
Contributor

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"

@kosack
Copy link
Contributor

kosack commented Nov 6, 2019

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.

@HealthyPear
Copy link
Member Author

HealthyPear commented Nov 6, 2019

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.
But why 0.2.2? Did you mean 0.2.1?

@HealthyPear HealthyPear merged commit 768109d into cta-observatory:master Nov 8, 2019
@HealthyPear HealthyPear deleted the feature-update_version branch November 8, 2019 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants