At 04:01 PM 5/13/2007 +0100, Alexander Schmolck wrote: >Hi, > >I'm currently working on a package <http://www.scipy.org/MlabWrap> making the >move from distutils to setuptools and I've got the following problem: although >the code itself should work fine out of an egg, testing requires some a >directory with some files to be created for matlab. Since it's only needed for >testing I don't want to clutter the installers HD. > >How should I best handle this? Currently I'm just using ``zip_safe=False``, >but a more elegant solution would seem to be for the test-code to temporarily >unpack the relevant files from the egg into some temp-dir run the tests and >delete the temp files again.
Use pkg_resources.resource_filename() - it will give you a real filename for the resource (unpacked to a temporary directory if necessary). If you are running "setup.py test", on the other hand, it will return the path to the original source file. _______________________________________________ Distutils-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/distutils-sig
