[SciPy-dev] Issues "freezing" scipy using py2app

Robert Kern robert.kern at gmail.com
Thu Dec 22 13:57:42 EST 2005


Pearu Peterson wrote:

> I'd like to learn more about the magic that Python does with .zip files.
> Are there similar issues when using eggs?

Well, setuptools correctly recognizes scipy as "not zip-safe". We use __file__
and __path__ in a couple of places (we also use inspect.something_or_other but
that's restricted to weave now, and I believe it is always inspecting code
outside of scipy, so it's not a problem). pkg_resources provides a few ways of
getting data from inside zipped eggs without using __file__. As Bob is working
on making py2app play nicely with eggs, if we were to use pkg_resources, then we
would be set.

>From python setup.py bdist_egg on scipy_core (a few days old):

zip_safe flag not set; analyzing archive contents...
scipy.core_version: module references __file__
scipy.base.setup: module references __file__
scipy.distutils.exec_command: module references __file__
scipy.distutils.misc_util: module references __file__
scipy.distutils.system_info: module references __file__
scipy.distutils.command.build_src: module references __file__
scipy.f2py.diagnose: module references __file__
scipy.f2py.f2py2e: module references __file__
scipy.f2py.setup: module references __file__
scipy.test.logging: module references __file__
scipy.test.logging: module MAY be using inspect.stack
scipy.test.testing: module references __file__
scipy.weave.blitz_spec: module references __file__
scipy.weave.blitz_tools: module references __file__
scipy.weave.bytecodecompiler: module MAY be using inspect.getsource
scipy.weave.bytecodecompiler: module MAY be using inspect.getcomments
scipy.weave.bytecodecompiler: module MAY be using inspect.stack
scipy.weave.c_spec: module references __file__
scipy.weave.catalog: module references __file__
scipy.weave.catalog: module references __path__
scipy.weave.inline_tools: module references __file__

See http://peak.telecommunity.com/DevCenter/PkgResources#resourcemanager-api for
details on how to use pkg_resources for accessing in-package resources.

-- 
Robert Kern
robert.kern at gmail.com

"In the fields of hell where the grass grows high
 Are the graves of dreams allowed to die."
  -- Richard Harter




More information about the SciPy-Dev mailing list