regebro / pyroma

Rate your Python packages package friendliness
MIT License
213 stars 21 forks source link

Support PEP 639 license metadata once that PEP is accepted #93

Open edmorley opened 1 year ago

edmorley commented 1 year ago

This project has a license defined under the [project] table in pyproject.toml: https://github.com/heroku/sf-functions-python/blob/a7541831525ae1850ae2c8511d2b0c8f94597a53/pyproject.toml#L10

However, pyroma 4.1 on macOS using Python 3.11.0 reports that no license was specified:

$ pyroma .
------------------------------
Checking .
Getting metadata for wheel...
Found salesforce-functions
------------------------------
...
Your package does neither have a license field nor any license classifiers.
edmorley commented 1 year ago

Hmm so this might be fixed by: https://github.com/pypa/hatch/pull/576

CAM-Gerlach commented 1 year ago

Pyroma is referring to the License core metadata field (which is mapped to license.text key in the [project] table, and license in most other tool-specific configs, e.g. setup.cfg). If you set a string value directly for the license key in Hatch, which implements my latest draft of PEP 639, that is used to set the License-Expression core metadata field. I do include an optional provision allowing, but not requiring tools to also backfill the License field with the same value, but I assume Hatch does not choose to do that. Therefore, Pyroma will not directly detect it.

PEP 639 is a draft spec, and I need to finish at least one last round of (mostly non-content-relevant changes) and potentially some additional feedback, before it is considered for acceptance and final implementation, so it seems premature for Pyroma to support it yet. Sorry for the delay! However, when it does, Pyroma should detect (and perhaps validate) it.

edmorley commented 1 year ago

Thank you for the fast reply! I'd missed that PEP 639 is still a draft - Hatch's docs suggest using the new string form project.license field, so I had presumed it was finalised.

I've filed https://github.com/pypa/hatch/issues/679

CAM-Gerlach commented 1 year ago

Thanks, I've replied over there. We could leave this open as a reminder if/when PEP 639 is accepted, or we could close this for now.

edmorley commented 1 year ago

We could leave this open as a reminder if/when PEP 639 is accepted, or we could close this for now.

Whichever you prefer; either works for me :-)

CAM-Gerlach commented 1 year ago

Up to @regebro

regebro commented 1 year ago

Let's leave it open.