-
We are creating a shim package that consists only of a [build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "tzdata"
version = "9999"
description = "tzdata shim to satisfy requirements (using system tzdata)" However, this no longer works with 1.19.1: Traceback (most recent call last):
File "/usr/lib/python3.12/site-packages/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
main()
File "/usr/lib/python3.12/site-packages/pyproject_hooks/_in_process/_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/pyproject_hooks/_in_process/_in_process.py", line 251, in build_wheel
return _build_backend().build_wheel(wheel_directory, config_settings,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/build-env-jx4x4iew/lib/python3.12/site-packages/hatchling/build.py", line 58, in build_wheel
return os.path.basename(next(builder.build(directory=wheel_directory, versions=['standard'])))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/build-env-jx4x4iew/lib/python3.12/site-packages/hatchling/builders/plugin/interface.py", line 155, in build
artifact = version_api[version](directory, **build_data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/build-env-jx4x4iew/lib/python3.12/site-packages/hatchling/builders/wheel.py", line 407, in build_standard
for included_file in self.recurse_included_files():
File "/tmp/build-env-jx4x4iew/lib/python3.12/site-packages/hatchling/builders/plugin/interface.py", line 176, in recurse_included_files
yield from self.recurse_selected_project_files()
File "/tmp/build-env-jx4x4iew/lib/python3.12/site-packages/hatchling/builders/plugin/interface.py", line 180, in recurse_selected_project_files
if self.config.only_include:
^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/build-env-jx4x4iew/lib/python3.12/site-packages/hatchling/builders/config.py", line 781, in only_include
only_include = only_include_config.get('only-include', self.default_only_include()) or self.packages
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/build-env-jx4x4iew/lib/python3.12/site-packages/hatchling/builders/wheel.py", line 235, in default_only_include
return self.default_file_selection_options.only_include
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/functools.py", line 995, in __get__
val = self.func(instance)
^^^^^^^^^^^^^^^^^^^
File "/tmp/build-env-jx4x4iew/lib/python3.12/site-packages/hatchling/builders/wheel.py", line 223, in default_file_selection_options
raise ValueError(message)
ValueError: Unable to determine which files to ship inside the wheel using the following heuristics: https://hatch.pypa.io/latest/plugins/builder/wheel/#default-file-selection
At least one file selection option must be defined in the `tool.hatch.build.targets.wheel` table, see: https://hatch.pypa.io/latest/config/build/
As an example, if you intend to ship a directory named `foo` that resides within a `src` directory located at the root of your project, you can define the following:
[tool.hatch.build.targets.wheel]
packages = ["src/foo"]
ERROR Backend subprocess exited when trying to invoke build_wheel Is there a supported way of installing such package? In other words, I literally want hatchling to create a wheel that contains only a |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
I considered this in the history note as a new feature since this was never intentional, I hope that's okay |
Beta Was this translation helpful? Give feedback.
-
First: please use the solution pointed out by ofek which is [tool.hatch.build.targets.wheel]
bypass-selection = true I was looking at this problem and I found that the following works too, to create an empty wheel: [tool.hatch.build.targets.wheel]
only-include = [""] but I'm mentioning it here, is it a bug that this works too? |
Beta Was this translation helpful? Give feedback.
#1135
I considered this in the history note as a new feature since this was never intentional, I hope that's okay