Repository navigation
license in pyproject.toml is not following the PEP 621 #200
Copy link
Copy link
Closed
Description
Hi!
I'm getting the following error while trying to install the poetry==1.8.2 using pip 25.0.1, it looks that the license in pyproject.toml is not compatible with the PEP 621:
Collecting cffi>=1.14 (from cryptography>=2.0->SecretStorage>=3.2->keyring<25.0.0,>=24.0.0->poetry==1.8.2)
Downloading #REDACTED#/pypi/simple/cffi/2.0.0/cffi-2.0.0.tar.gz
- 523.6 kB 231.7 MB/s 0:00:00
Installing build dependencies ... done
Getting requirements to build wheel ... error
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [87 lines of output]
configuration error: `project.license` must be valid exactly by one definition (2 matches found):
- keys:
'file': {type: string}
required: ['file']
- keys:
'text': {type: string}
required: ['text']
DESCRIPTION:
`Project license <https://peps.python.org/pep-0621/#license>`_.
GIVEN VALUE:
"MIT"
OFFENDING RULE: 'oneOf'
DEFINITION:
{
"oneOf": [
{
"properties": {
"file": {
"type": "string",
"$$description": [
"Relative path to the file (UTF-8) which contains the license for the",
"project."
]
}
},
"required": [
"file"
]
},
{
"properties": {
"text": {
"type": "string",
"$$description": [
"The license of the project whose meaning is that of the",
"`License field from the core metadata",
"<https://packaging.python.org/specifications/core-metadata/#license>`_."
]
}
},
"required": [
"text"
]
}
]
}
I proposed #199 for making it compatible but am not quite sure whether it's the best way to resolve it
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
EpicWink commentedon Sep 11, 2025
licensebeing a (inline) table is deprecated, and should be a string (identifying the license). See:pyproject.tomlguidelicenseinpyproject.tomlspecTry using Setuptools v77.0.3 or later. If your version of Python can't support that, try constraining
cffito below v2cclauss commentedon Dec 1, 2025
Is this still a problem?
%
uvx --with=packaging validate-pyproject pyproject.toml# https://validate-pyproject.readthedocs.io@DimitriPapadopoulos
DimitriPapadopoulos commentedon Dec 1, 2025
As explained in #200 (comment), PEP 621 has been superseded by PEP 639.
Make sure that you use up-to-date build tools. From the Python Packaging User Guide:
You'll need poetry 2.2.0 for PEP 639 support.
cclauss commentedon Dec 1, 2025
@Bluefissure Should this issue be closed?