pypa / hatch

Modern, extensible Python project management
https://hatch.pypa.io/latest/
MIT License
6.1k stars 309 forks source link

`hatch publish` fails due to license metadata error #1819

Closed dholzmueller closed 2 days ago

dholzmueller commented 3 days ago

After running hatch publish -r main on a project where it previously worked, I am getting the following error message:

Error uploading to repository: https://upload.pypi.org/legacy/ - Client error '400 license-file introduced in metadata version 2.4, not 2.3. See https://packaging.python.org/specifications/core-metadata for more information.' for url 'https://upload.pypi.org/legacy/'
For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/400

Depending on whether I include only the license field or only the license spec in classifiers, the error message may refer to license-expression instead of license-file.

I am using hatch version 1.13.0 (and previously tried it with 1.12, I think).

From a bit of googling, it seems that metadata version 2.4 is not even out and perhaps PyPI started checking the metadata specs more carefully recently? Until 2.3, the license field should be used instead: https://packaging.python.org/en/latest/specifications/core-metadata/#license

ofek commented 2 days ago

https://github.com/pypa/hatch/issues/1818#issuecomment-2487197453

dholzmueller commented 2 days ago

Thank you, the answer from the other issue fixed it! I forgot to include closed issues in the search...