[Pythonmac-SIG] pkg_resources and Mac OS X compatibility

Bob Ippolito bob at redivi.com
Tue Feb 7 20:48:15 CET 2006


On Feb 7, 2006, at 5:37 AM, Phillip J. Eby wrote:

> At 02:07 PM 2/5/2006 -0800, Bob Ippolito wrote:
>> On Feb 5, 2006, at 2:00 PM, Bob Ippolito wrote:
>>> With the way that we're returning the distutils platform on the
>>> universal branch of Mac OS X, we need another patch to
>>> pkg_resources.  The reason for this is that
>>> distutils.util.get_platform() returns the platform that it is
>>> trying to produce binaries for, which is often not the exact
>>> current platform.  More specifically, our current strategy is to
>>> produce a version of Python that will build extensions that are
>>> compatible with Mac OS X 10.3, but the actual building of
>>> extensions requires Mac OS X 10.4 or later (because the toolchain
>>> doesn't exist on Mac OS X 10.3).
>>>
>>> In some rare cases, people will want to produce packages that
>>> explicitly require Mac OS X 10.4 or later, which they can do by
>>> setting the MACOSX_DEPLOYMENT_TARGET=10.4 environment variable when
>>> running setup.py.  This will influence the value returned by
>>> disutils.util.get_platform(), and will influence the compiler and
>>> linker if extensions are built.
>>>
>>> This patch adds an internal _get_max_platform(plat) function that
>>> returns the actual runtime version of Mac OS X, for use in
>>> compatible_platforms.
>>
>> Oops, wrong patch.. here's the correct one.  Sorry about that:
>
> I've implemented a similar - but different - patch.  Yours causes  
> setuptools' tests to fail on non-Mac platforms, including non-Mac  
> darwin.

Could you explain how?  I don't see it.  The condition is::

	if m is not None and sys.platform == "darwin":
		...

How does that fail on pure Darwin?  The condition should be False  
because m has to be None at that point and the branch shouldn't happen.

-bob



More information about the Pythonmac-SIG mailing list