pre-processing source from distutils
mstenner at ece.arizona.edu
Mon Mar 15 17:07:45 CET 2004
Michael Stenner wrote:
> Is it possible to pre-process source code from distutils? I don't want
> to do anything too fancy. I just want to put the VERSION from setup.py
> (and maybe a date) into the module at sdist or build time (I haven't
> decided which of those would be cleaner). Anybody know of a clean way
> to do this?
After some hunting around, I found that the preferred way to handle this
specific problem is to put __version__ = 'x.x.x' in the module itself
(or in __init__.py for a package) and then have setup.py import the
module and slurp the version in from there. That works for me.
More information about the Python-list