On 7/20/05, Ronald Oussoren <[EMAIL PROTECTED]> wrote:
> You don't mention the implementation of macosx_vers, but instead of
> calling /usr/bin/sw_vers you could also use platform.mac_ver,
> something like:

Ahh, I didn't know about that. macosx_vers is basically the sw_vers
function that Bob pointed to.

> 
>      if sys.platform == "darwin":
>          import platform
>          ver = platform.mac_ver()[0]
>          if ver != '':
>              return "macosx-%s.%s-%s"%tuple(ver.split('.')[:2] +
> [ platform.machine().replace(' ', '_') ])
>          # fall through to the generic version
> 
> This would return 'macosx-10.4-Power_Macintosh' on my system. Note
> that I explicitly drop the micro release number because OSX is binary
> compatible across all micro-releases in a release.

Yeah, maybe I should have dropped that as well. I included the micro
release number in the egg name, but excluded it from compatibility
computations. Now that I think about it, though, it would be better to
just drop the micro release altogether.

I noticed that mac_ver also returns "PowerPC" for the machine. Would
it be better to use that than "Power_Macintosh"?

> > I thought it made sense to leave the Power_Macintosh in there because
> > of the upcoming Intel switch. I don't want to think about "Universal
> > Binary" eggs right now :)
> 
> "Universal Binary" eggs should be automatic once someone teaches
> distutils to build "Univeral Binary" extensions. Building such
> extensions is easy enough (there's a hack in PyObjC's setup.py to do
> so), nicely integrating that in distutils is harder.

Automatic universal eggs will be cool.

Kevin
_______________________________________________
Pythonmac-SIG maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/pythonmac-sig

Reply via email to