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
I was thinking about "editable" / dev installs today and it struck me, should we support automatically installing the import hook for pip install -e editable installs?
It would be quite nice if maturin-backed packages installed in editable mode automatically used the import hook. I think it would be possible by putting the hook installation in a .pth file. Maybe once in maturin's .pth, and then the hook can work out what packages have been installed in editable mode / whether to recompile?
That could be an interesting trick to make local development of Rust packages more seamless for those not used to compiling...
The text was updated successfully, but these errors were encountered:
Unlike the existing import hook, the new one supports detecting when rebuilds are necessary (including following path dependencies) and supports importlib.reload() (except on Windows right now).
It's not 100% finished but my idea for the workflow would be that for each virtualenv that you want to have the import hook available for you would run (once)
$ pip install maturin_import_hook
$ python -m maturin_import_hook site install
where I'm thinking the site subcommand could be passed install, info and uninstall for managing injecting the call to maturin_import_hook.install() into the site-packages/sitecustomize.py of the current environment. Or the user can add calls to maturin_import_hook.install() directly in each script that needs it if they prefer.
the installation of maturin_import_hook and optional injection into sitecustomize could also (optionally?) be done through maturin develop like you suggest.
I was thinking about "editable" / dev installs today and it struck me, should we support automatically installing the import hook for
pip install -e
editable installs?It would be quite nice if maturin-backed packages installed in editable mode automatically used the import hook. I think it would be possible by putting the hook installation in a
.pth
file. Maybe once inmaturin
's.pth
, and then the hook can work out what packages have been installed in editable mode / whether to recompile?That could be an interesting trick to make local development of Rust packages more seamless for those not used to compiling...
The text was updated successfully, but these errors were encountered: