rye: Hatchling 1.19 breaks `rye sync`
Steps to Reproduce
See
https://github.com/pypa/hatch/issues/1113
❯ rye sync --no-lock
Reusing already existing virtualenv
Installing dependencies
Looking in indexes: https://pypi.org/simple/, https://pypi.org/simple/
Obtaining file:///. (from -r /tmp/tmpo2k2iiit (line 1))
Installing build dependencies ... done
Checking if build backend supports build_editable ... done
Getting requirements to build editable ... done
Preparing editable metadata (pyproject.toml) ... error
error: subprocess-exited-with-error
× Preparing editable metadata (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [31 lines of output]
Traceback (most recent call last):
File "/tmp/.tmpy1qEr0/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 167, in prepare_metadata_for_build_editable
hook = backend.prepare_metadata_for_build_editable
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'hatchling.build' has no attribute 'prepare_metadata_for_build_editable'
Expected Result
rye sync
should succeed
Actual Result
❯ rye sync --no-lock
Reusing already existing virtualenv
Installing dependencies
Looking in indexes: https://pypi.org/simple/, https://pypi.org/simple/
Obtaining file:///. (from -r /tmp/tmpo2k2iiit (line 1))
Installing build dependencies ... done
Checking if build backend supports build_editable ... done
Getting requirements to build editable ... done
Preparing editable metadata (pyproject.toml) ... error
error: subprocess-exited-with-error
× Preparing editable metadata (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [31 lines of output]
Traceback (most recent call last):
File "/tmp/.tmpy1qEr0/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 167, in prepare_metadata_for_build_editable
hook = backend.prepare_metadata_for_build_editable
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'hatchling.build' has no attribute 'prepare_metadata_for_build_editable'
Version Info
❯ rye --version rye 0.15.2 commit: 0.15.2 (2023-10-04) platform: macos (aarch64) self-python: cpython@3.11 symlink support: true
Stacktrace
No response
About this issue
- Original URL
- State: closed
- Created 7 months ago
- Reactions: 4
- Comments: 16 (1 by maintainers)
Commits related to this issue
- Pin max hatchling version in build process for pip install from git repo See https://github.com/mitsuhiko/rye/issues/515, for instance. — committed to jeflem/jupyter-fs by jeflem 4 months ago
- Pin `hatchling` to 1.18 `hatchling` 1.19 broke the build. Following the suggestion in rye's repo fixed it for now. https://github.com/mitsuhiko/rye/issues/515 — committed to bennettscience/feedback by bennettscience 4 months ago
For anyone who runs into this on an existing project, add this to your
pyproject.toml
:Workaround is
Maybe using
tool.hatch.build.targets.wheel.bypass-selection
is better.FYI https://github.com/pypa/hatch/pull/1135