jbweston / miniver

Like Versioneer, but smaller
Creative Commons Zero v1.0 Universal
53 stars 10 forks source link

version=unknown #6

Closed basnijholt closed 6 years ago

basnijholt commented 6 years ago

I've tried adding miniver here: https://github.com/instagrambot/instabot/pull/578/files

basnijholt-macbook ➜  instabot git:(version)  pip install .
Processing /Users/basnijholt/Downloads/instabot
Installing collected packages: instabot
  Running setup.py install for instabot ... done
Successfully installed instabot-unknown
basnijholt-macbook ➜  instabot git:(version)  python -c 'import instabot; print(instabot.__version__)'
unknown

Do you have any idea why it doesn't work?

basnijholt commented 6 years ago

I fixed it by doing this.

I've opened #7 to implement the same change here.

jbweston commented 6 years ago

Thanks for the report!.

Not sure why this doesn't work; I will look into it.

jbweston commented 6 years ago

I understand now. miniver uses annotated tags to determine the version from git, however instabot uses unannotated tags.

The difference is essentially that annotated tags store metadata like the person who created it, time of creation etc., whereas unannotated tags do not.

AFAIK the recommended way to tag versions is using annotated tags. I often use unannotated tags to mark work in progress stuff, or to easily move around in the git history, and using these shouldn't affect the version....

jbweston commented 6 years ago

the --tags flag will get git describe to use unannotated tags to determine a description.

jbweston commented 6 years ago

Here's a stack overflow question that discusses this.

I'm pretty convinced that using annotated tags is the Right Way, however even large projects like scikit-learn had this problem during their development, and such projects should still be able to profit from miniver.

jbweston commented 6 years ago

I think in the end we shouldn't allow unannotated tags to denote versions.

Miniver is an opinionated tool. If someone's project really wants to use unannotated tags for their versions, then they should modify the source. I can add a section to the README and a patch that can be applied to allow unannotated tags.