You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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_installationappears 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)
Bug Description
PEP 420-style namespace packages like the following:
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 asfoo
(resulting in silent clobbering of members of the namespace).I should have a PR soon-ish for this.
Steps to Reproduce
python-source = "python",
module-name = "foo.._rustin the Cargo.tomls and inserting
from . import _rust`.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?The text was updated successfully, but these errors were encountered: