-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Bug Description
PEP 420-style namespace packages like the following:
foo_a/
Cargo.toml
python/foo/a/
__init__.py
pyproject.toml
src/
lib.rs
foo_b/
Cargo.toml
python/foo/b/
__init__.py
pyproject.toml
src/
lib.rs
are skipped entirely in find_spec (because they appear as if they are not top-level packages, since importlib.util.find_spec passes a specialized _NamespacePath to find_spec).
Flagging on enable_automatic_installation appears to work, but actually just installs the namespaced package as foo (resulting in silent clobbering of members of the namespace).
I should have a PR soon-ish for this.
Steps to Reproduce
- Initialize a boilerplate folder structure along the lines described above, marking
python-source = "python",module-name = "foo.._rustin the Cargo.tomls and insertingfrom . import _rust`. - install the hook and import from a venv with the namespace members editable-installed.
- Modify any of the files - observe the hook missing them.
Please provide the output of python -m maturin_import_hook version (or provide manually)
OS: Linux-6.12.4-arch1-1-x86_64-with-glibc2.40
Python: CPython 3.12.8
maturin-import-hook: 0.2.0
maturin: maturin 1.7.8
rustc: rustc 1.81.0 (eeb90cda1 2024-09-04)
pip: ?
Does maturin develop work when run manually for your project?
- Yes/No (leave blank if not applicable)
kylebarron
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working