spe for Python 2.7?

Dave Curtis dave at dave-curtis.com
Fri Mar 23 11:10:30 PDT 2012


On Mar 22, 2012, at 11:46 PM, Dave Curtis wrote:

> 
> On Mar 22, 2012, at 6:05 PM, Lawrence Velázquez wrote:
> 
>> On Mar 22, 2012, at 7:41 p.m., Ryan Schmidt wrote:
>> 
>>> 
>>> On Mar 22, 2012, at 18:34, Dave Curtis wrote:
>>> 
>>>> OK.  Agreement all around. Yay!
>>>> 
>>>> So... does that mean there *should* be py26-spe and py27-spe, etc, ports?
>>> 
>>> No. Spe is not a python module. Spe is a program that happens to use python. There is and should only be a single port called "spe".
>>> 
>> 
>> 
>> To clarify, you'll want to have one port called "spe" that has a variant for each version of Python  it can use (+python26, +python27, etc.).
>> 
> 
> 
> Since I'm just learning how to do this, I thought I'd try to make the minimal necessary changes to the existing portfile for spe 2.6 to see if I could get things going for 2.7.   I managed to achieve 'hello world' in spe, albeit with some annoying benign exceptions coming from something wx isn't finding. 
> 
> Diff's attached.  Summary:
> 1. Tweaked portgroup to python27
> 2. added supported_arches i386 because of wx dependency
> 3. changed py26-foo dependencies to py27-foo
> 4. tweaked call to python to use arch -i386, which was conveniently already being patched in the portfile.  This was moved to a post-patch to get out of the way of a new patchfile.
> 5. Added patchfiles command to overcome the fact that pychecker2 is not available in macports.  spe contains a fall-back version of the module, so I tweaked the installation to include the fallback version.
> 
> When SPE exists, 17 copies of this are printed to stderr:
> 
> Exception ImportError: 'No module named traceback' in <bound method WeakMethod.__onNotifyDeadObj of <wx.lib.pubsub.core.weakmethod.WeakMethod at 336293600; DEAD>> ignored
> 
> which looks like wx is not quite right, yet.  I'm guessing this comes during widget destruction or some such.

One more note: When spe runs a Python script from within the IDE, it gets the default (64 bit) Python.  I think I've found the place where this could be adjusted.  It looks like spe is no longer being actively developed, so I haven't found the right forum for questions so that I can get confirmation.

spe needs to run 32 bit, since it uses wx.  There is no reason it should force the code under development to run 32 bit, unless the user has a good reason to make that happen.  I'm thinking that for both idle and spe, the sub-shelled variant problem can be handled by wrapping the launch of the ide in a script that exports VERSIONER_PYTHON_PREFER_32_BIT -- the environment variable will get passed down to all subshells, correct?

-dave



More information about the macports-users mailing list