[Pythonmac-SIG] Building plugins with py2app
Dethe Elza
delza at livingcode.org
Fri Oct 13 01:15:46 CEST 2006
On 12-Oct-06, at 2:56 PM, Ronald Oussoren wrote:
> I have macholib 1.2, modulegraph 0.7.1, altgraph 0.6.8 and py2app
> 0.3.5, all fresh checkouts from svn.
OK, I now have those versions as well, via easy_install [module]==dev
on each one. I had tried building them all from svn the other day,
but failed, perhaps because of having the wrong version of setuptools.
> Could you check the Info.plist and the structure of the screensaver?
>
> Info.plist should have a key PyResourcePackages with an empty array
> as its value
yes, have that
> and an PyRuntimeLocations that points to an embedded python framework.
PyRuntimeLocaions contains the value: @executable_path/../Frameworks/
Python.framework/Versions/2.4/Python
> The patch I just checked in ensures that PyResourcePackages is
> empty, with an unpatched version the array will contain some
> strings and that messes up sys.path.
>
> There should be a lib/python2.4 in the Resources directory of the
> screensaver, that should contain site-packages.zip, site.py and a
> lib-dynload directory.
Yes. It also contains a config directory which contains Makefile,
Setup, Setup.config, Setup.local.
> To make absolutely sure you have my patched version you could check
> py2app/bundletemplate/plist_template.py, there is a definition of
> PyResourcePackages in there, the value of which should be an empty
> list. One way to check:
>
> .>> import pprint
> .>> import py2app.bundletemplate.plist_template
> .>> pprint.pprint(py2app.bundletemplate.plist_template.infoPlistDict
> ('dummy'))
> {'CFBundleDevelopmentRegion': u'English',
> 'CFBundleDisplayName': u'dummy',
> 'CFBundleExecutable': u'dummy',
> 'CFBundleIconFile': u'dummy',
> 'CFBundleIdentifier': u'org.pythonmac.unspecified.dummy',
> 'CFBundleInfoDictionaryVersion': u'6.0',
> 'CFBundleName': u'dummy',
> 'CFBundlePackageType': u'BNDL',
> 'CFBundleShortVersionString': u'0.0',
> 'CFBundleSignature': u'????',
> 'CFBundleVersion': u'0.0',
> 'LSHasLocalizedDisplayName': False,
> 'NSAppleScriptEnabled': False,
> 'NSHumanReadableCopyright': u'Copyright not specified',
> 'NSMainNibFile': u'MainMenu',
> 'NSPrincipalClass': u'dummy',
> 'PyMainFileNames': [u'__boot__'],
> 'PyResourcePackages': [],
> 'PyRuntimeLocations': [u'@executable_path/../Frameworks/
> Python.framework/Versions/2.4/Python',
> u'~/Library/Frameworks/Python.framework/
> Versions/2.4/Python',
> u'/Library/Frameworks/Python.framework/
> Versions/2.4/Python',
> u'/Network/Library/Frameworks/
> Python.framework/Versions/2.4/Python',
> u'/System/Library/Frameworks/
> Python.framework/Versions/2.4/Python'],
> u'PythonInfoDict': {'PythonExecutable': u'/Library/Frameworks/
> Python.framework/Versions/2.4/Resources/Python.app/Contents/MacOS/
> Python',
> 'PythonLongVersion': u'2.4.4c1 (#1, Oct 11
> 2006, 15:11:04) \n[GCC 4.0.1 (Apple Computer, Inc. build 5341)]',
> 'PythonShortVersion': u'2.4',
> u'py2app': {'version': u'0.3.5', 'template':
> u'bundle'}}}
That looks right, I see an empty list as the value of
PyResourcePackages.
> Ronald
>
> P.S. Are you sure you installed the latest version of py2app in the
> right version of Python? If you installed python2.5 after
> installing python2.4 easy_install might point to the 2.5 version of
> easy_install (if you have that installed), if it is
> easy_install-2.4 should pick up the correct version.
I'm sure. I've been checking the site-packages directory before and
after running easy_install, and I've gone through and removed
old .egg directories (and checked the easy_install.pth) so I can be
sure I'm getting the right versions. I've checked to make sure I
have the current version of the SillyBalls code too. SillyBalls
doesn't even use setuptools, so whatever is broken is broken across
both distutils and setuptools (I haven't dug underneath yet to see
how these work, so it's still magic under the covers to me).
So still no idea why it's working for you, but not for me. Anything
else you can think of? I followed the instructions in the py2app
docs for removing old versions of py2app. If everything is
encapsulated in the .egg, perhaps I can revert to the earlier version
that worked?
--Dethe
It was odd: even though I was pretty much being eaten alive, I didn't
really mind. I suppose it's the same sort of feeling Jesus had while
on the cross, or how Buddha felt when Mechabuddha beat him up in
downtown Tokyo. --AJ Packman
More information about the Pythonmac-SIG
mailing list