Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C extension module with no pure python files fails #22

Closed
isuruf opened this issue Jul 6, 2017 · 2 comments · Fixed by #123
Closed

C extension module with no pure python files fails #22

isuruf opened this issue Jul 6, 2017 · 2 comments · Fixed by #123
Labels

Comments

@isuruf
Copy link
Collaborator

isuruf commented Jul 6, 2017

gmpy is a single C extension module with no pure python files. I'm using multibuild and it fails to copy the dependent libraries (libgmp, libmpfr, libmpc) to the wheel although delocate-listdeps correctly finds out that the dependent libraries need to be copied. (Also, audit-wheel on linux works perfectly.)

https://travis-ci.org/isuruf/gmpy2-wheels/jobs/250226653

@matthew-brett
Copy link
Owner

Yes, sorry about that - your problem, I believe is this : #15

Could you see your way through to reorganizing to have a gmpy2 package rather than a single gmpy2.so module? As in something like:

gmpy2/
    __init__.py

where __init__.py contains "from ._gmpy2 import *" or similar.

@danielhers
Copy link

I would also appreciate if the libraries could be copied into .../site-packages/.libs/copied_lib.dylib when the modules are at the top level. In my case it's the dynet library, which also doesn't use packages, and it would be quite complicated to change that. The Cython extension uses just libdynet.dylib (built externally), so there is no problem of name collision with other libraries.
Perhaps enable this as an option to delocate-wheel, to avoid cases where it is done by mistake?
E.g.

delocate-wheel --allow-top-level  -v -w fixed-wheel dist/...

mgeplf added a commit to BlueBrain/libsonata that referenced this issue Mar 12, 2020
mgeplf added a commit to BlueBrain/libsonata that referenced this issue Mar 12, 2020
mgeplf added a commit to BlueBrain/libsonata that referenced this issue Mar 12, 2020
mgeplf added a commit to BlueBrain/libsonata that referenced this issue Mar 12, 2020
mgeplf added a commit to BlueBrain/libsonata that referenced this issue Mar 12, 2020
mgeplf added a commit to BlueBrain/libsonata that referenced this issue Mar 13, 2020
* Create python wrapper so that mac wheels will work
* needed to work around:
    matthew-brett/delocate#22
@HexDecimal HexDecimal added the bug label Sep 19, 2021
matthew-brett added a commit that referenced this issue Sep 21, 2021
MRG: Allow for delocating top level modules.

This delocates libraries into one directory per wheel.  I've added a top-level package-less wheel to test with.

Prevents copying duplicate libraries when a wheel has multiple packages.  Fixes #35.

Fixes issues where the module to work on is at the top-level, such as a wheel with no packages.  Generally any current issue where delocate mysteriously doesn't bundle libraries has been fixed.  Fixes #72, fixes #22, fixes #45, fixes #63, fixes #121, fixes #66, fixes #49, fixes #67.

See `_decide_dylib_bundle_directory` for how the folder to use is determined.  I've followed the advice from #72 to use an auditwheel-style name.  Wheels without packages use the folder `{package_name}.dylibs`, wheels with packages will put a `.dylibs` folder in only one of the packages preferring the one that matches the wheel name.  The one directory will hold the dependencies of the entire wheel.

After that the fix was simple:  In `delocate_wheel` call `delocate_path` only once and call it with a `tree_path` that includes the entire wheel.

Since this always collects everything regardless of if a package is found or not.  This will also resolve issues where namespace packages couldn't be delocated.  Fixes #95.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants