Building files within a package

S

schwehr

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,291
Messages
2,571,453
Members
48,132
Latest member
AnneHarpur

Latest Threads

Top