[Distutils] ctypes and shared libs, and wheels, oh my!

Chris Barker chris.barker at noaa.gov
Wed Jun 11 17:35:06 CEST 2014


Folks,

I'm trying to help figure out how to do binary wheels for a package that
relies on ctypes and a bundles shared lib (dll, .so. etc)

The trick here is that the python code is quite version and platform
independent: py2 and py3, version 2.7 and 3.3+ (I think)

(it's py_enchant, if anyone is interested:
http://pythonhosted.org/pyenchant/)

So the trick is that the binary wheel will be platform dependent, but not
the code itself, so ideally we'd have one wheel, that for instance (and teh
case at hand) should work on any OS-X box version 10.6 and above, with a
any of python2.7, 3.3, 3.4 (an up?)

Usually, a binary wheel involves  compiled extensions, and thus is tied to
a particular python version -- so this is an odd case.

We tried:

pyenchant-1.6.6-py2.py3-none-macosx_10_6_intel.whl

which seems to be saying: any version of python2 or python 3, but only on
macosx 10.6

but trying to install that on my machine (py2.7, os-x 10.6) gives:

pyenchant-1.6.6-py2.py3-none-macosx_10_6_intel.whl is not a supported wheel
on this platform.

(side note: it would be really great if that could be a more useful message
-- what part of the file name didn't match? I know that's a trick, as there
is a whole pile of heuristics to go through, but maybe a way to dump that
process would be helpful...)

Now, this may, in fat be tied to CPython (I have no idea if ctypes
is available on pypy or jython or IronPython...). So I tried:

pyenchant-1.6.6-cp27-none-macosx_10_6_intel.whl

that does, indeed, install on my system.

Also:

pyenchant-1.6.6-cp27.cp33-none-macosx_10_6_intel.whl

works.

As 2.7 is really the only py2 that much matters, no biggie, but is there a
way to get 3.3 and 3.4 and ??? all at once (I don't have py3 on that
machine, so didn't test that...)

So: how should this be done? Is the above the best option there is?

Thanks,
  -Chris














-- 

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/distutils-sig/attachments/20140611/56e913cb/attachment.html>


More information about the Distutils-SIG mailing list