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

Process C extensions inside namespace packages #38

Closed
wants to merge 1 commit into from

Conversation

lpsinger
Copy link

When a wheel contains subpackages of a namespace package, there is no __init__.py file for the namespace package, though its subpackage directories do contain __init__.py files.

When scanning the wheel for package directories, searching the root for directories that contain __init__.py files is insufficient because we will miss C extension modules that are subpackages of namespace packages.

Instead, we need to do a depth-first traversal of the directory tree and capture the most shallow directories that contain __init__.py files.

lpsinger added a commit to lpsinger/ligo.skymap that referenced this pull request Jun 11, 2018
@lpsinger lpsinger force-pushed the namespace-packages branch from 8093456 to 39b4d10 Compare October 2, 2018 19:28
When a wheel contains subpackages of a namespace package, there is
no `__init__.py` file for the namespace package, though its
subpackage directories do contain `__init__.py` files.

When scanning the wheel for package directories, searching the
root for directories that contain `__init__.py` files is
insufficient because we will miss C extension modules that are
subpackages of namespace packages.

Instead, we need to do a depth-first traversal of the directory
tree and capture the most shallow directories that contain
`__init__.py` files.
rowillia pushed a commit to rowillia/delocate that referenced this pull request Feb 24, 2021
Namespace packes do not have a top level `__init__.py` - https://packaging.python.org/guides/packaging-namespace-packages/#native-namespace-packages
This causes delcoate to fail to find those packages.

setuptools will store the those values in `*.dist-info/namespace_packages.txt`
https://github.com/pypa/setuptools/blob/main/setup.py#L139

matthew-brett#38 blindly globbed everything, this approaches it in a more
compliant way.
rowillia pushed a commit to rowillia/delocate that referenced this pull request Feb 24, 2021
Namespace packes do not have a top level `__init__.py` - https://packaging.python.org/guides/packaging-namespace-packages/#native-namespace-packages
This causes delcoate to fail to find those packages.

setuptools will store the those values in `*.dist-info/namespace_packages.txt`
https://github.com/pypa/setuptools/blob/main/setup.py#L139

matthew-brett#38 blindly globbed everything, this approaches it in a more
compliant way.
@HexDecimal
Copy link
Collaborator

PR #123 was merged which has fixed this issue and includes tests for namespace packages.

@HexDecimal HexDecimal closed this Sep 23, 2021
@lpsinger lpsinger deleted the namespace-packages branch September 24, 2021 13:37
@lpsinger
Copy link
Author

Nice! This worked for my package. Thank you!

lpsinger added a commit to lpsinger/ligo.skymap that referenced this pull request Sep 24, 2021
Ceciliogq pushed a commit to Ceciliogq/lalsuite that referenced this pull request Oct 15, 2021
The issues that required using a fork have been fixed upstream.
See matthew-brett/delocate#38.

Fixes #472.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants