[Pythonmac-SIG] Python Eggs and Mac OS version compatibility
Bob Ippolito
bob at redivi.com
Tue Jul 19 23:51:56 CEST 2005
On Jul 19, 2005, at 4:56 AM, Kevin Dangoor wrote:
> I have been packaging up some of my python packages in eggs:
> http://peak.telecommunity.com/DevCenter/PythonEggs
>
> Basically, an egg has everything you need to use a package,
> ready-to-run... including binary versions of extensions. It's a nice
> format because it enables people to just run an "easy_install" program
> to get a package, no compiler required. (Which is a bigger win on
> Windows, to be sure, but even on the Mac it means that casual
> scripters wouldn't need to install Developer Tools).
>
> The way eggs are created right now generates a package name that looks
> something like this:
>
> [PackageName]-[Version]-py[PythonVersion]-darwin-8.2.0-
> Power_Macintosh.egg
>
> As coded currently, updating from Mac OS 10.4.1 to 10.4.2 (which
> bumped the Darwin version from 8.1.0 to 8.2.0), means that any eggs
> compiled under 10.4.1 won't work any more under 10.4.2, because
> setuptools is checking the full platform to see if it matches.
>
> That's more than a little aggressive, compatibility-wise. We can
> redefine for Mac OS what an appropriate platform string would be and
> what the compatibility rules are.
Pick out the sw_vers function from here:
http://svn.red-bean.com/bob/py2app/trunk/src/bdist_mpkg/tools.py
Use that instead of the uname (darwin-8.2.0-Power_Macintosh).
e.g.
'macosx-' + '.'.join(map(str, sw_vers().version[:2]))
Then contribute it to setuptools so it gets used in bdist_egg (or
distutils, really).
-bob
More information about the Pythonmac-SIG
mailing list