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
If I edit the Rust source code I am importing with maturin.import_hook, I would expect that a new Python process would rebuild the code when importing in the new process. Instead, the package is only ever compiled once.
Your maturin version (maturin --version)
1.1.0
Your Python version (python -V)
3.11.4
Your pip version (pip -V)
23.2
What bindings you're using
pyo3
Does cargo build work?
Yes, it works
If on windows, have you checked that you aren't accidentally using unix path (those with the forward slash /)?
Yes
Steps to Reproduce
I have a rust_pointvec.rs with PyO3 module defined.
I then modify the Rust code, and rerun the Python script. No rebuild or recompilation happens, the old compiled module is imported, and there is no maturin logging, unlike the initial run.
Bug Description
If I edit the Rust source code I am importing with
maturin.import_hook
, I would expect that a new Python process would rebuild the code when importing in the new process. Instead, the package is only ever compiled once.Your maturin version (
maturin --version
)1.1.0
Your Python version (
python -V
)3.11.4
Your pip version (
pip -V
)23.2
What bindings you're using
pyo3
Does
cargo build
work?If on windows, have you checked that you aren't accidentally using unix path (those with the forward slash
/
)?Steps to Reproduce
I have a
rust_pointvec.rs
with PyO3 module defined.I run:
It compiles and installs.
I then modify the Rust code, and rerun the Python script. No rebuild or recompilation happens, the old compiled module is imported, and there is no maturin logging, unlike the initial run.
My guess at the problem: now that the package is installed, the import hook is bypassed since it can just use the default importer. Perhaps instead of
sys.meta_path.append()
the hook should be inserted earlier insys.meta_path
, e.g.rustimport
makes sure to be first: https://github.com/mityax/rustimport/blob/master/rustimport/import_hook.py#L65C2-L65C2The text was updated successfully, but these errors were encountered: