Skip to content

feat: hatchling edit#1282

Open
henryiii wants to merge 5 commits intomainfrom
henryiii/feat/hatchlingedit
Open

feat: hatchling edit#1282
henryiii wants to merge 5 commits intomainfrom
henryiii/feat/hatchlingedit

Conversation

@henryiii
Copy link
Copy Markdown
Collaborator

@henryiii henryiii commented Apr 30, 2026

Editable support for the hatchling plugin.

🤖 Assisted-by: Copilot:GPT-5.4

@henryiii
Copy link
Copy Markdown
Collaborator Author

@LecrisUT Any thoughts as to why just the one fedora test might be failing here? It's on the new code, so it looks valid.

@LecrisUT
Copy link
Copy Markdown
Collaborator

LecrisUT commented Apr 30, 2026

Oh interesting. The only difference that should be there are the compilers. I'll need to dig into the code changes.

Btw tmt is meant to be replicable locally, but we do not have mac users or CI to test it on, but if you have docker/podman and tmt installed (even from pypi), the following would replicate that job

$ tmt run -a \
  provision --how=container --image=fedora:rawhide \
  plans --name=/tests/plans/pytest \
  login -t

@LecrisUT
Copy link
Copy Markdown
Collaborator

Ok, I am reproducing locally. My suspicion is that EXT_SUFFIX gets calculated a bit differently so the file is not as expected, but let me see with the debugger.

@LecrisUT
Copy link
Copy Markdown
Collaborator

Oops, wrong finding previously:

  • ext_location = '/tmp/pytest-of-cle/pytest-2/test_hatchling_editable_instal0/venv/lib/python3.14/site-packages/hatchling_example/_core.cpython-314-x86_64-linux-gnu.so'
  • expected = '/tmp/pytest-of-cle/pytest-2/test_hatchling_editable_instal0/venv/lib64/python3.14/site-packages/hatchling_example/_core.cpython-314-x86_64-linux-gnu.so'

see the lib vs lib64 difference there

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds initial support and test coverage for building editable wheels via the Hatchling hook integration, extending scikit-build-core’s Hatch plugin to handle PEP 660-style editable outputs (redirect/inplace) and validating resulting wheel metadata and contents.

Changes:

  • Extend ScikitBuildHook (Hatch plugin) to support version="editable" builds, including redirect/inplace modes and correct pure_python/WHEEL metadata handling.
  • Refactor editable-wheel file generation into reusable helpers (editable_redirect_files, editable_inplace_files, get_packages) and reuse them in the PEP 517 wheel builder.
  • Add Hatchling-focused tests (editable wheel build + editable install) and adjust the Hatchling test package CMakeLists to support editable inplace output paths.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/test_hatchling.py Adds assertions for wheel Root-Is-Purelib, plus new editable wheel and editable install integration tests for Hatchling hook behavior.
tests/packages/hatchling/cpp/CMakeLists.txt Ensures editable inplace builds place built extension outputs in the expected source-package directory, including multi-config generator handling.
src/scikit_build_core/hatch/plugin.py Implements Hatchling editable wheel support (redirect/inplace), updates config/state handling, and sets correct pure_python behavior.
src/scikit_build_core/build/wheel.py Refactors editable wheel generation to use new helper functions and shared package discovery.
src/scikit_build_core/build/_editable.py Introduces helper functions for generating editable wheel files and package discovery to share logic across builders.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@henryiii henryiii marked this pull request as ready for review April 30, 2026 21:47
henryiii and others added 5 commits May 1, 2026 21:14
Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
Assisted-by: Copilot:GPT-5.4
Assisted-by: Copilot:GPT-5.4-mini
Assisted-by: Copilot:GPT-5.4
Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
@henryiii henryiii force-pushed the henryiii/feat/hatchlingedit branch from e495e20 to 2a67c41 Compare May 2, 2026 01:14
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.

3 participants