<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, May 19, 2015 at 4:27 AM, Oscar Benjamin <span dir="ltr"><<a href="mailto:oscar.j.benjamin@gmail.com" target="_blank">oscar.j.benjamin@gmail.com</a>></span> wrote:<br><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Surely the best way to manage non-Python shared libs is by<br>
exposing them as extension modules which can be packaged up on PyPI.<br>
Then you have dependency resolution for pip, you don't need to worry<br>
about the OS-specific shared library loading details and ABI<br>
information can be stored as metadata in the module. It would even be<br>
possible to load multiple versions or ABIs of the same library as<br>
differently named Python modules IIUC.<br></blockquote><div><br></div><div>yes, that's what I "proposed" earlier in this thread. I put proposed in quotes because it was buried in the discussion, and not the least bit fleshed out, but that was the point.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
As a case in point numpy packages up a load of C code and wraps a<br>
BLAS/Lapack library. Many other extension modules are written which<br>
can all take advantage of the non-Python shared libraries that embody<br>
numpy via its C API.<br></blockquote><div><br></div><div>Though to be fair -- managing that has been a challenge -- numpy may be built with different versions of BLAS, and there is no way to really know what you might be getting... but I think this is solved with the "curated packages" approach.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Is there some reason that this is not considered a good solution?<br></blockquote><div><br></div><div>Well, I've had some issues with getting the linking worked out right so that modules could use each-other's libraries, at least on Windows -- but that can probably be worked out.</div><div><br></div><div>The missing piece in terms of the PyPA infrastructure is that that is no way to specify a binary dependency in the meta data: we can specify that this python package depends on some other python package, but not that this particular binary wheel depends on some other binary wheel. For example, the same python package (say something like PIL) might use the system libs when built on Linux, some of the system libs when built for OS-X, and need all the third party libs when built for Windows. So the OS-X wheel has different dependencies than the Windows wheel, which has different dependencies than, say, a conda package of the same lib. Then there are wheels that might be built to use the homebrew libs on OS-X -- it gets messy!</div><div><br></div><div>But that can be hacked around, so that we could give it a try and see how it works.</div><div><br></div><div>The other issue is social: this would really only be a benefit if a wide variety of packages shared the same libs -- but each of those packages is maintained by different individuals and communities. So it's had to know if it would get used. I could put up a libpng wheel, for instance, and who knows if the Pillow folks would have any interest in using it? or the matplotlib folks, or, ... And this would be particularly difficult when the solution was hacked together...</div><div><br></div><div>-Chris</div><div><br></div></div>-- <br><div class="gmail_signature"><br>Christopher Barker, Ph.D.<br>Oceanographer<br><br>Emergency Response Division<br>NOAA/NOS/OR&R            (206) 526-6959   voice<br>7600 Sand Point Way NE   (206) 526-6329   fax<br>Seattle, WA  98115       (206) 526-6317   main reception<br><br><a href="mailto:Chris.Barker@noaa.gov" target="_blank">Chris.Barker@noaa.gov</a></div>
</div></div>