setuptools-scm

the blessed package to manage your versions by scm tags

Here are some articles that you may find helpful