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 companion package for editable packages with native extensions #160

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

adisbladis
Copy link
Member

@adisbladis adisbladis commented Sep 29, 2024

This package is intended to aid Nix-based Python development using editable installs.

This is to be used with build-systems such as meson-python that builds native extensions.
It's purpose is similar to that of python setup.py build_ext -i, just using PEP-660.

Problems

Of course this is not a perfect analogy to using something like meson-python directly.
We just use the .pth machinery directly, while meson-python uses a more complex hook machinery:

  • Automatic inference of Python

    meson-python puts the editable build in build/cp312.
    Users will have to manually override any editable root automatically inferred by Nix to point to the correct build directory.

  • Automatic rebuilds

    Thanks to it's hook machinery meson-python can rebuild packages as necessary on load.
    This automatic rebuild behaviour will not work, and users will have to call build-editable manually.

These are just two examples of build-system specific behaviour that will not work out of the box.

--

Note: This isn't final by any means. I'm exploring what the requirements are.

This is to be used with build-systems such as `meson-python` that builds native extensions.
It's purpose is the same as that of `python setup.py build_ext -i`, just using PEP-660.

Of course this is not a perfect analogy to using something like `meson-python` directly.
We just use the `.pth` machinery directly, while `meson-python` uses a more complex hook machinery:

- Automatic inference of Python

`meson-python` puts the editable build in `build/cp312`.
Users will have to manually override any automatically inferred editable root to point to the correct build directory.

- Automatic rebuilds

Thanks to it's hook machinery `meson-python` can rebuild packages as necessary on load.
This automatic rebuild behaviour will not work, and users will have to call `build-editable` manually.

These are just two examples of build-system specific behaviour that will not work.
@adisbladis adisbladis marked this pull request as draft September 29, 2024 05:20
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.

1 participant