$ python -m build
* Creating isolated environment: venv+pip...
* Installing packages in isolated environment:
- hatchling
* Getting build dependencies for sdist...
* Building sdist...
* Building wheel from sdist
* Creating isolated environment: venv+pip...
* Installing packages in isolated environment:
- hatchling
* Getting build dependencies for wheel...
* Building wheel...
Traceback (most recent call last):
File "/Users/xxxxx/.pyenv/versions/mcs-3.11.3/lib/python3.11/site-packages/pyproject_hooks/_in_process/_in_process.py", line 389, in <module>
main()
File "/Users/xxxxx/.pyenv/versions/mcs-3.11.3/lib/python3.11/site-packages/pyproject_hooks/_in_process/_in_process.py", line 373, in main
json_out["return_val"] = hook(**hook_input["kwargs"])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xxxxx/.pyenv/versions/mcs-3.11.3/lib/python3.11/site-packages/pyproject_hooks/_in_process/_in_process.py", line 280, in build_wheel
return _build_backend().build_wheel(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/private/var/folders/dc/ydwmt_mj5fz77h68kp9qtzv80000gn/T/build-env-xpm4xsg1/lib/python3.11/site-packages/hatchling/build.py", line 58, in build_wheel
return os.path.basename(next(builder.build(directory=wheel_directory, versions=["standard"])))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/private/var/folders/dc/ydwmt_mj5fz77h68kp9qtzv80000gn/T/build-env-xpm4xsg1/lib/python3.11/site-packages/hatchling/builders/plugin/interface.py", line 157, in build
artifact = version_api[version](directory, **build_data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/private/var/folders/dc/ydwmt_mj5fz77h68kp9qtzv80000gn/T/build-env-xpm4xsg1/lib/python3.11/site-packages/hatchling/builders/wheel.py", line 521, in build_standard
record = archive.add_file(included_file)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/private/var/folders/dc/ydwmt_mj5fz77h68kp9qtzv80000gn/T/build-env-xpm4xsg1/lib/python3.11/site-packages/hatchling/builders/wheel.py", line 131, in add_file
with open(included_file.path, "rb") as in_file, self.zf.open(zip_info, "w") as out_file:
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/private/var/folders/dc/ydwmt_mj5fz77h68kp9qtzv80000gn/T/build-env-xpm4xsg1/lib/python3.11/site-packages/hatchling/builders/wheel.py", line 78, in open
raise ValueError(message)
ValueError: A second file is being added to the wheel archive at the same path: `xxx_sub_directory/README.md`.
The most likely cause of this is an entry in the `tool.hatch.build.targets.wheel.force-include` table. See: https://hatch.pypa.io/1.8/config/build/#forced-inclusion
ERROR Backend subprocess exited when trying to invoke build_wheel
[tool.hatch.version]
path = "VERSION"
pattern = "(?P<version>.+)"
[tool.hatch.build.targets.wheel]
packages = ["xxx_sub_directory"]
[tool.hatch.build.targets.wheel.force-include]
"xxx_sub_directory" = "xxx_sub_directory"
python build output:
Our tool.hatch settings are: