-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot install import hook when monorepo #15
Comments
you say
Are you saying that the import hook is not rebuilding when it should for you? When I follow the steps it works despite the warnings:
so the hook is functional but I agree that the messages ideally shouldn't be there. The problem is that the top level workspace looks like it could be a maturin project (has
which is what the import hook is also complaining about. It's printing the error because it was assumed that a user working with a project that looks like a maturin project that fails to build is working with a broken project. adding the following to the pyproject.toml makes the warnings go away: [build-system]
requires = ["hatchling"]
build-backend = "hatchling.build" for some reason there is a however, more generally I think it would be an improvement to the |
Thanks for your reply @mbway! What command did you exactly run? Because it doesn't work for me.
Importing differt fails.
Pytest also fails:
|
This seems to be this maturin bug I assume running |
It worked after upgrading uv! Thanks :D |
…ages (#2389) since version 0.4.25, `uv pip show --files` is supported and can be used to set the package installed by `maturin develop` as editable without having to fallback to using `pip`. However several users are using old versions of `uv` and it would be better if the error message was clearer if an outdated uv is used. This has caused confusion in these issues: - #2388 - PyO3/maturin-import-hook#15 before: ``` ✏️ Setting installed package as editable 💥 maturin failed Caused by: failed to list package files ``` after: ``` ✏️ Setting installed package as editable⚠️ Warning: failed to set package as editable: uv >= 0.4.25 is required for `show --files`. Version 0.4.23 was found. 🛠 Installed $PACKAGE ``` (note that installation now proceeds if setting as editable fails)
Bug Description
Hello!
I currently develop tools that is split into two Python modules:
differt-core
: lower-level Python module built on Rust code (using PyO3 and maturin);differt
: the main Python module, that imports the lower-level module and provides all high-level API.The project is a bit like
pydantic-core
andpydantic
, except that I use a monorepo architecture (thanks to uv's workspace feature).The (simplified) project layout is as follows:
When trying to install the import hook, it complains that the top-level
pyproject.toml
does not contain required information (i.e., build section). However, it should actually look atdiffert-core/pyproject.toml
instead.I did try to
cd differt-core && python -m maturin_import_hook site install
, but it stills uses the top-levelpyproject.toml
file. Is there any way to make it use the correct project file?Steps to Reproduce
import_hook
branch;cd differt-core && uv run python -m maturin_import_hook site install --detect-uv
Repository: https://github.com/jeertmans/DiffeRT/tree/import-hook
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: