Add __version__ module-level attribute
Refs #209 (closed)
Merge request reports
Activity
mentioned in issue #209 (closed)
Hi @matthew-pitkin , thanks for looking into this. How does this interact with the
.version
file we have? The version file includes information about the current git hash and the state of the repository. Is this included in the__version__
attribute? I think this is important for code likebilby
that most people tend to work with a development version (though it would be great if we eventually move to people using mainly the pip-tagged versions)Hi @gregory.ashton, at the moment my patch just does what is currently implemented and puts what's in the
__version__
attribute into the.version
file. But, we could do something more sophisticated. For example in astropyquery the have a__version__
that follows the formatX.X.X.devXXXX
(see PEP440), where the final fourX
s are taken from the current git hash. From looking at theirsetup.py
, when they want to draft a new release they just remove the.dev
, create a release, and then add it back afterwards.Does that sound like a preferable route to take?
Another option instead, or additionally to this, would be to add a local version identifier, that included information that is currently in the
.version
file, e.g.__version__ = '0.3.1+XXXXXXX.(UN)CLEAN.20YY.MM.DD.HH.MM.SS
__version__ = '0.3.1.devXXXXXXX+(UN)CLEAN.20YY.MM.DD.HH.MM.SS
Both the
dev
and "local version" option could mean developers end up with many different installed versions, so they'd have to be careful to uninstall current development versions before re-installing.I'd be wary of something which means people could get confused about which version they are running.
How about something like this patch (I've based it of your branch so you should be able to apply and see if it works). It puts the "version" number back into the setup.py, which I think is useful as its easier to remember to update it, the patches the
__version__
in the init file as you had it. Could that work?added 9 commits
-
ca9f7837...47d29e5a - 6 commits from branch
Monash:master
- 575ed0f1 - Merge remote-tracking branch 'upstream/master' into version
- e691e935 - Apply Gregs patch
- 2fe1a0de - Fix import of version into docs
Toggle commit list-
ca9f7837...47d29e5a - 6 commits from branch
@gregory.ashton I've switched to your patch, so take a look what you think.
- Resolved by Colm Talbot
mentioned in commit 3b98cdf5