soft-matter/trackpy — pull request #128 by leouieda (2014-07-22 21:07:06+00:00)
Title: Use versioneer to handle version numbers

Hi! I saw the trackpy talk at Scipy2014 (congratulations, by the way) and was having a look at the source. Thought I'd submit a fix for the version string problem since I recently did this for my own projects. Hope this helps.

Basically, using [versioneer](https://github.com/warner/python-versioneer) to automatically create version strings based on git tags and the latest commit hash.

Fixes #126.

When not working from a release (for development), `trackpy.__version__` will have:

* the last version tag (`0.2.1`)
* the number of commits since the last version
* the latest commit hash
* 'dirty' if the repo has uncommitted modifications

e.g., `0.2.1-8-g608fc6e-dirty` for this specific commit. This allows better provenance tracking since most research work is probably done from `master` anyway.

To create a new version, simply `git tag v0.3` and versioneer will handle everything. If you run `python setup.py sdist` from the `v0.3` tag, you'll get `trackpy.__version__ = '0.3'`. For every commit after that, `trackpy.__version__ == '0.3-n-hash'`. I set the `release` variable in the docs to `trackpy.__version__` so the docs version will updated automatically.

Also, this doesn't add any extra dependencies.

**Note**: Is there a reason for `MANIFEST` being in the repo? It's a `setup.py` generated file, right? I didn't know if I could remove it but nothing seemed to break without it.