Skip to content

Instantly share code, notes, and snippets.

@Changaco
Forked from dcreager/version.py
Last active November 25, 2015 23:25
Show Gist options
  • Save Changaco/3762216 to your computer and use it in GitHub Desktop.
Save Changaco/3762216 to your computer and use it in GitHub Desktop.
Automatically extract version number from git tags
# This script has been moved to https://github.com/Changaco/version.py
@Changaco
Copy link
Author

Changes from the original version:

  • shorter and cleaner (at least to my eyes)
  • python 3 compatibility
  • PEP 386 compatibility
  • works with lightweight (non-annotated) tags
  • only matches tags that start with a digit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment