Building files within a package

schwehr at gmail.com schwehr at gmail.com
Thu Mar 23 08:20:31 EST 2006


Hi All,

I am creating a python package that contains a whole pile of functions
that build lookup tables.  Since these lookup tables will not be
changing, I would like to have setup.py create a lut_static.py fie from
the lookup table code (lut.py).  What is the best way to do this so
that when I install the package the static tables get build?  It
basically looks like this

foo-py-0.1
   setup.py
   foo
      lut.py
      lut_static.py <- want to generate this from lut.py

For development, it is easy enough for me to have a Makefile in foo
that creates lut_static.py when ever lut.py is changed, but I would
like to make setup.py handle this so if someone tweaks the lut.py and
reinstalls it, they don't have to know about foo/Makefile

Thanks!
-kurt




More information about the Python-list mailing list