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
Hi!
I recently changed to an older machine and noticed that my code would not compile with the hook:
Uninstalled 1 package in 0.19ms
Installed 1 package in 0.43ms
failed to resolve project "/export/home/eertmans/repositories/DiffeRT/DiffeRT": pyproject.toml is invalid (does not have required fields)
building "differt_core"
maturin_import_hook [ERROR] command "/export/home/eertmans/.local/bin/maturin develop --manifest-path /export/home/eertmans/repositories/DiffeRT/DiffeRT/differt-core/Cargo.toml --color always --uv" returned non-zero exit status: 2
maturin_import_hook [ERROR] maturin output:
error: unexpected argument '--uv' found
tip: to pass '--uv' as a value, use '-- --uv'
Usage: maturin develop <--quiet|--jobs <N>|--profile <PROFILE-NAME>|--features <FEATURES>|--all-features|--no-default-features|--target <TRIPLE>|--target-dir <DIRECTORY>|--manifest-path <PATH>|--ignore-rust-version|--verbose...|--color <WHEN>|--frozen|--locked|--offline|--config <KEY=VALUE>|-Z <FLAG>|--timings=<FMTS>|--future-incompat-report|ARGS>
For more information, try '--help'.
ImportError while loading conftest '/export/home/eertmans/repositories/DiffeRT/DiffeRT/differt/src/differt/conftest.py'.
differt/src/differt/__init__.py:3: in <module>
from ._version import VERSION
differt/src/differt/_version.py:1: in <module>
from differt_core import __version__ # Re-export version from code module
.venv/lib/python3.11/site-packages/maturin_import_hook/project_importer.py:151: in find_spec
spec, rebuilt = self._rebuild_project(package_name, project_dir)
.venv/lib/python3.11/site-packages/maturin_import_hook/project_importer.py:261: in _rebuild_project
maturin_output = develop_build_project(self.find_maturin(), resolved.cargo_manifest_path, settings)
.venv/lib/python3.11/site-packages/maturin_import_hook/_building.py:181: in develop_build_project
raise MaturinError(msg)
E maturin_import_hook.error.MaturinError: Failed to build package with maturin
I know --uv option was added as of maturin>=1.6, but this constraint is already specified in my pyproject.toml:
So I checked and, indeed, my globalmaturin executable was too old:
$ maturin --version
maturin 1.5.1
and upgrading it to >=1.6 now works.
Is there a way for this hook to use the same maturin executable as the one from the build backend? I guess this can be hard, especially as the place where the build dependencies are installed is probably not obvious.
Otherwise, I think it could be nice to include some words about this in the docs.
What do you think?
Steps to Reproduce
Create dummy repo that uses uv;
Specify the build dependencies as above;
Install hook with --detect-uv;
Install maturin<1.6globally;
Trigger the hook.
Please provide the output of python -m maturin_import_hook version (or provide manually)
I think the build backend gets downloaded automatically by the installer so it's not persistent on your system. I suppose the import hook could also do this as an option
Passing thought: an easier first step might be for the hook to warn (or error?) if the maturin version on the path doesn't match the requested one in the pyproject.toml.
I think the build backend gets downloaded automatically by the installer so it's not persistent on your system. I suppose the import hook could also do this as an option
Yes, this is what I thought when saying that it might not be obvious.
Passing thought: an easier first step might be for the hook to warn (or error?) if the maturin version on the path doesn't match the requested one in the pyproject.toml.
Bug Description
Hi!
I recently changed to an older machine and noticed that my code would not compile with the hook:
I know
--uv
option was added as ofmaturin>=1.6
, but this constraint is already specified in mypyproject.toml
:So I checked and, indeed, my global
maturin
executable was too old:and upgrading it to
>=1.6
now works.Is there a way for this hook to use the same
maturin
executable as the one from the build backend? I guess this can be hard, especially as the place where the build dependencies are installed is probably not obvious.Otherwise, I think it could be nice to include some words about this in the docs.
What do you think?
Steps to Reproduce
uv
;--detect-uv
;maturin<1.6
globally;Please provide the output of
python -m maturin_import_hook version
(or provide manually)Does
maturin develop
work when run manually for your project?The text was updated successfully, but these errors were encountered: