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

build: Rework editables for full PEP-660 support #237

Merged
merged 1 commit into from
Jan 14, 2025
Merged

Conversation

adisbladis
Copy link
Member

@adisbladis adisbladis commented Jan 14, 2025

The previously used mechanism of synthezising a package using hatchling sort of works, and was enough to prove the concept of editables with Nix.

This changes mkDerivationEditable to use PEP-660 and should support pretty much everything.

The big complication in this development was the need for source level patching since editables are a pretty loose concept and are implemented differently by different build systems. Source patching uses https://github.com/Instagram/LibCST/. I'd like to rewrite this bit purely in Rust later.

So far I've successfully used this support with a few build systems, most notably meson.

For meson this requires manually calling build_editable.py to create the initial files. After that point dynamic recompilation "just works". This will be exposed as a separate package somehow, just not yet.

The previously used mechanism of synthezising a package using hatchling sort of works, and was enough to prove the concept of editables with Nix.

This changes `mkDerivationEditable` to use PEP-660 and should support pretty much everything.

The big complication in this development was the need for source level patching since editables are a pretty loose concept and are implemented differently by different build systems.
Source patching uses https://github.com/Instagram/LibCST/.
I'd like to rewrite this bit purely in Rust later.

So far I've successfully used this support with a few build systems, most notably meson.

For meson this requires manually calling `patch_editable.py` to create the initial files.
After that point dynamic recompilation "just works".
This will be exposed as a separate package somehow, just not yet.
@adisbladis adisbladis merged commit 3db43c7 into master Jan 14, 2025
91 checks passed
@adisbladis adisbladis deleted the editables-v1 branch January 14, 2025 06:30
adisbladis added a commit to pyproject-nix/uv2nix that referenced this pull request Jan 14, 2025
adisbladis added a commit to pyproject-nix/uv2nix that referenced this pull request Jan 14, 2025
adisbladis added a commit to pyproject-nix/uv2nix that referenced this pull request Jan 14, 2025
adisbladis added a commit to pyproject-nix/uv2nix that referenced this pull request Jan 14, 2025
adisbladis added a commit to pyproject-nix/uv2nix that referenced this pull request Jan 14, 2025
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