Add tool.hatch.build.targets.wheel to fix pip install . with Hatchling 1.19
#106
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
With Hatchling 1.19:
❯ git clone https://github.com/sphinx-contrib/sphinx-lint && cd sphinx-lint ... ❯ pip install -e . Obtaining file:///private/tmp/sphinx-lint 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 ╰─> [39 lines of output] Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/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' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module> main() File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main json_out['return_val'] = hook(**hook_input['kwargs']) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 176, in prepare_metadata_for_build_editable whl_basename = build_hook(metadata_directory, config_settings) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/private/var/folders/p6/lf2s1s5d4kb335g2n1td8z8c0000gn/T/pip-build-env-z5yx9mlz/overlay/lib/python3.12/site-packages/hatchling/build.py", line 82, in build_editable return os.path.basename(next(builder.build(directory=wheel_directory, versions=['editable']))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/private/var/folders/p6/lf2s1s5d4kb335g2n1td8z8c0000gn/T/pip-build-env-z5yx9mlz/overlay/lib/python3.12/site-packages/hatchling/builders/plugin/interface.py", line 155, in build artifact = version_api[version](directory, **build_data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/private/var/folders/p6/lf2s1s5d4kb335g2n1td8z8c0000gn/T/pip-build-env-z5yx9mlz/overlay/lib/python3.12/site-packages/hatchling/builders/wheel.py", line 423, in build_editable return self.build_editable_detection(directory, **build_data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/private/var/folders/p6/lf2s1s5d4kb335g2n1td8z8c0000gn/T/pip-build-env-z5yx9mlz/overlay/lib/python3.12/site-packages/hatchling/builders/wheel.py", line 434, in build_editable_detection for included_file in self.recurse_selected_project_files(): File "/private/var/folders/p6/lf2s1s5d4kb335g2n1td8z8c0000gn/T/pip-build-env-z5yx9mlz/overlay/lib/python3.12/site-packages/hatchling/builders/plugin/interface.py", line 180, in recurse_selected_project_files if self.config.only_include: ^^^^^^^^^^^^^^^^^^^^^^^^ File "/private/var/folders/p6/lf2s1s5d4kb335g2n1td8z8c0000gn/T/pip-build-env-z5yx9mlz/overlay/lib/python3.12/site-packages/hatchling/builders/config.py", line 774, in only_include only_include = only_include_config.get('only-include', self.default_only_include()) or self.packages ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/private/var/folders/p6/lf2s1s5d4kb335g2n1td8z8c0000gn/T/pip-build-env-z5yx9mlz/overlay/lib/python3.12/site-packages/hatchling/builders/wheel.py", line 231, in default_only_include self.set_default_file_selection() File "/private/var/folders/p6/lf2s1s5d4kb335g2n1td8z8c0000gn/T/pip-build-env-z5yx9mlz/overlay/lib/python3.12/site-packages/hatchling/builders/wheel.py", line 209, in set_default_file_selection raise ValueError(message) ValueError: At least one file selection option must be defined, see: https://hatch.pypa.io/latest/config/build/ [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed × Encountered error while generating package metadata. ╰─> See above for output. note: This is an issue with the package mentioned above, not pip. hint: See above for details.PyPI install still work, but this does affect pre-commit installs, which uses
pip install .from a Git clone.CI build of current
main: https://github.com/sphinx-contrib/sphinx-lint/actions/runs/7171471394This is pypa/hatch#1113, and adding this fixes it: