astropy/astropy — Issue #8: Improve version.py generation
Author: iguananaut
Created: 2011-10-12 20:12:37+00:00
State: open

I've been working on my own version.py generation for STScI's packages--it works pretty similarly, but with a couple differences:
* I also started out making it an extension of the build_py command, but I ended up changing it to regenerate the file on every setup.py run--this ensures that an updated version.py file is created for commands such as 'develop' and 'sdist'. It doesn't seem to add any noticeable time to running setup.py.
* The version.py uses the SVN revision info getter to automatically update its SVN info on import *if* the package is installed in develop mode. That way, when installed in develop mode the revision is always up to date. I would want the same for git. It doesn't do this if the package is not installed in develop mode, so it doesn't hurt import time otherwise. The code for doing that is just part of the version.py template.

I'm open to other ideas for exactly how to implement this, but I would want to add these capabilities.