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

Add PEP 660 support #648

Merged
merged 3 commits into from
Oct 14, 2021
Merged

Add PEP 660 support #648

merged 3 commits into from
Oct 14, 2021

Conversation

messense
Copy link
Member

Closes #624

@netlify

This comment has been minimized.

@messense messense marked this pull request as ready for review October 13, 2021 13:19
@davidhewitt
Copy link
Member

So I tried this out locally with the maturin_starter example from the PyO3 repo. I changed the pyproject.toml file to:

[build-system]
requires = ["maturin @ git+https://github.com/messense/maturin@pep660"]
build-backend = "maturin"

... and then I installed with pip install -e ..

The editable install completed successfully, which is great! I then changed the __init__.py file, started a new Python interpreter and imported maturin_starter, and expected to see the new additions I made to the __init__.py file.

That didn't seem to be the case; I had to run pip install -e . again to pick up the changes.

I thought that with editable installs the Python source files can be freely updated without needing to reinstall the package, though I could be misunderstanding something?

@messense
Copy link
Member Author

messense commented Oct 13, 2021

I thought that with editable installs the Python source files can be freely updated without needing to reinstall the package, though I could be misunderstanding something?

You are right, it should allow you freely update Python source files. What version of pip are you using? It requires pip 21.3.

And it'll install a ${pkg_name}.pth file in site-packages, could you paste the content here? It should contain the parent directory of Python source directory which will be added to sys.path on interpreter startup. Maybe the order of sys.path matters then we may need to avoid putting Python source files in editable wheels I guess.

@messense
Copy link
Member Author

I think maybe we can also make maturin develop work just like editable wheels by placing dist-info and a .pth file in site-packages? cc @konstin What do you think?

@messense
Copy link
Member Author

@davidhewitt Can you give this another try? I've tested the pyo3-mixed example and it works for me.

@konstin
Copy link
Member

konstin commented Oct 14, 2021

I think maybe we can also make maturin develop work just like editable wheels by placing dist-info and a .pth file in site-packages? cc @konstin What do you think?

Yes please! The current develop behavior is mostly a hack and .pth would be much better

@davidhewitt
Copy link
Member

👍 it's now working nicely for me too, awesome work!

@messense
Copy link
Member Author

I think maybe we can also make maturin develop work just like editable wheels by placing dist-info and a .pth file in site-packages? cc @konstin What do you think?

Yes please! The current develop behavior is mostly a hack and .pth would be much better

Great, I'll do it later in follow-up PRs.

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

Successfully merging this pull request may close these issues.

Add support for PEP 660 - Editable installs for pyproject.toml based builds
3 participants