Follow

Hm… PEP 621 deliberately doesn’t have a replacement for setuptools’s license, but they do have a license key that is equivalent to license_files. Unfortunately, this is what PyPI does with the data in that field:

Not great.

@pganssle yeah in single-license projects I’ve replaced it but in the dual-license one the text is short enough that I can live with it until the relevant PEP is finalized. Hatch already supports it but then VS Code is whiny about license not being a dict.

@pganssle Instead of:

license = {file = "LICENSE"}

Try:

license = {text = "Apache-2.0"}

@hugovk I am not sure if you are supposed to use it that way, and that makes it so you have to choose between including the license file and having a meaningful short description of the license.

I’ll probably just fall back to the setuptools config options.

@hugovk Either way it’s a huge footgun. The thing everyone is going to think to do causes this problem.

@pganssle Aha, I'm using Hatchling which uses SPDX identifiers:

hatch.pypa.io/latest/config/me

Which points to the draft #PEP639 – "Improving License Clarity with Better Package Metadata":

peps.python.org/pep-0639/

Hopefully it'll be submitted soon. 🤞

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.