mhhennig / HS2

Software for high density electrophysiology
GNU General Public License v3.0
26 stars 17 forks source link

Added version and commit information #47

Closed frozenblit closed 4 years ago

frozenblit commented 4 years ago

Hi,

I figured these changes may help implement https://github.com/mhhennig/HS2/issues/39

"base_version" is the usual version you have used before, "__version__" has the first 12 characters of the commit hash appended to it and "__commit__" is the full hash.

If git is available, the commit hash is stored within the packages created via setup.py bdist_wheel, sdist and install. The public version will use "base_version".

To try, simply use:

import herdingspikes
print(herdingspikes.__version__)

or

print(herdingspikes.version.__commit__)

Hope you find it helpful.

frozenblit commented 4 years ago

Before I forget: if the tags are properly annotated, it would be trivial to update version.py to use the latest tag + number of commits since then (similar to git describe).

colehurwitz commented 4 years ago

Oh shoot! I totally didn't see this. Looks good.