views:

48

answers:

1

I've got a program/joke that needs a reasonably large data structure to operate, (a dictionary that takes a few seconds to construct) and I would like to create and pickle it into the installation dir when running python setup.py install.

setup() in distutils.core looks like it shouldn't exit, so I thought that I could just import my module and call the function after calling setup() in setup.py, but it doesn't seem to be working, even though installation does work.

This is what my setup.py looks like right now:

from distutils.core import setup

setup(...
    )

from phoneoops import utils

utils.get_hashed_dictionary(save=True)
+1  A: 
ma3
You should rather use a `finally` statement in your second example, so as to not swallow the error return code of the failed `setup()` call.
AndiDog
ma3204 you're right, I forgot that my PYTHONPATH has '.' at the beginning instead of the end, I was importing the source directory version instead of the destination directory.
quodlibetor