You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am encountering an error when setting the license field to an string-value (license = "something") in the pyproject.toml file, using Hatchling v1.26.1.
[project]
name = "foo-bar"readme = "README.rst"license = "MIT OR GPL-2.0-or-later OR (FSFUL AND BSD-2-Clause)"
I think as per PEP 639, setting the license field to an string is completely valid. However, Hatchling is throwing the following error during the build process:
Preparing editable metadata (pyproject.toml) ... error
error: subprocess-exited-with-error
× Preparing editable metadata (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [21 lines of output]
Traceback (most recent call last):
File "/home/ndhandre/RedHat/iqe/.iqe_env/lib64/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in<module>main()
File "/home/ndhandre/RedHat/iqe/.iqe_env/lib64/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/ndhandre/RedHat/iqe/.iqe_env/lib64/python3.11/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 "/tmp/pip-build-env-exmmg97_/overlay/lib/python3.11/site-packages/hatchling/build.py", line 83, in build_editable
return os.path.basename(next(builder.build(directory=wheel_directory, versions=['editable'])))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/pip-build-env-exmmg97_/overlay/lib/python3.11/site-packages/hatchling/builders/plugin/interface.py", line 90, in build
self.metadata.validate_fields()
File "/tmp/pip-build-env-exmmg97_/overlay/lib/python3.11/site-packages/hatchling/metadata/core.py", line 266, in validate_fields
self.core.validate_fields()
File "/tmp/pip-build-env-exmmg97_/overlay/lib/python3.11/site-packages/hatchling/metadata/core.py", line 1366, in validate_fields
getattr(self, attribute)
File "/tmp/pip-build-env-exmmg97_/overlay/lib/python3.11/site-packages/hatchling/metadata/core.py", line 683, in license
raise ValueError(message) from None
ValueError: Error parsing field `project.license` - Invalid license expression: ''
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
The text was updated successfully, but these errors were encountered:
digitronik
changed the title
Hatchling v1.26.1 not allow empty string License in pyproject.toml
Hatchling v1.26.1 not allow string License in pyproject.toml
Nov 11, 2024
digitronik
changed the title
Hatchling v1.26.1 not allow string License in pyproject.toml
Hatchling v1.26.1 not allow string-value to license key in pyproject.toml
Nov 11, 2024
I am encountering an error when setting the license field to an string-value (license = "something") in the pyproject.toml file, using Hatchling v1.26.1.
I think as per PEP 639, setting the license field to an string is completely valid. However, Hatchling is throwing the following error during the build process:
The text was updated successfully, but these errors were encountered: