Skip to content
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

maturin develop requires pip to be available #1752

Closed
mitsuhiko opened this issue Aug 29, 2023 · 2 comments · Fixed by #1753
Closed

maturin develop requires pip to be available #1752

mitsuhiko opened this issue Aug 29, 2023 · 2 comments · Fixed by #1753
Labels
enhancement New feature or request

Comments

@mitsuhiko
Copy link
Contributor

This might sound like a weird request but maturin develop requires pip to be available in a virtualenv. Not all installations of Python provide that (for instance rye does not provide one, i think pdm also does not). Obviously maturin might want to have pip available to do some things, but maybe there is a way to reconfigure it to explicitly provide a path to a pip installation and then to use --python to pass it to the virtualenv's python.

@mitsuhiko mitsuhiko added the enhancement New feature or request label Aug 29, 2023
@messense
Copy link
Member

Pull requests are welcome.

Note that previously we don't require pip in maturin develop but the implementation was too complex (handling entrypoints, windows launcher etc.) so I ditched it when working on editable wheels, see https://github.com/PyO3/maturin/pull/653/files.

@konstin
Copy link
Member

konstin commented Aug 30, 2023

There are two thoughts from my end:

When project.dependencies is set (which i expect most new projects will start to use), we need pip to install the dependencies. maturin unfortunately can't really know if it's used with another tool like rye or poetry that handles the dependencies. We could check whether all top level dependencies are installed with a compatible and skip the pip call in that case. It would make sense to also do a check that all transitive dependencies are also installed with compatible versions, it's unfortunately really easy to get a broken venv atm (implementation is just a depth first search, all the utils we need for that are already implemented in rust).

For installing the editable wheel, we now have a rust implementation for normal wheel installation that only lacks windows launchers and testing for editable wheel oddities (https://github.com/konstin/poc-monotrail/tree/main/install-wheel-rs). Personally, i'd like to migrate back to a pure rust implementation because it also avoids the pip overhead and the errorprone-ness of subprocess calls.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants