Differences between mesonpep517 pyproject.toml settings and PEP-621
pep-621 configuration names have been implemented in pyproject.toml but there's a few things that the PEP says are allowed which we don't handle and a few places the PEP says need to raise an error that we silently work around:
name
The PEP says that this must be specified but we set it from the value in meson.build if it is not present. I'm not sure if this actually produces a problem? PEP-621 seems to work in conjunction with the core-metadata specification. Reading the core metadata information on dynamic, https://packaging.python.org/specifications/core-metadata/#dynamic-multiple-use , it looks like statically specified entries must be the same for the sdist and any wheels built for the sdist. So as long as we fill in this information and it is the same for the sdist and wheels, I think we might be in compliance (and the PEP's wording is just confusing).
Maybe need to check whether pip installing the sdist works if name is not set explicitly in pyproject.toml.
version
We always read this from meson.build. PEP-621 doesn't treat this field specially but the core-metadata spec lumps it into the same category as name. Some clarification about this might be in order too.
readme
-
Our documentation says it is a string that is the full description. But we actually treat it as a relative path to a readme file which complies with the PEP. Need to update the description. -
The PEP says that this could also be a table of either {"file": path}
XOR{"text": full_text_description}
. The table can also take a content-type field and optional charset field (defaults to utf-8). We should add these.
requires-python
-
add deprecated_by: 'project.requires-python'
to schema.py
license
See #13 (closed), fixed by !14 (merged)
keywords
-
the PEP specifies that this is a list of strings which are keywords to help with searching. We just need to add this
urls
-
add deprecated_by: 'project.urls'
to project-urls in schema.py
entry points
project.scripts, project.gui-scripts, and project.entry-points. I think the code is doing the right thing but:
-
Documentation needs to be updated to display the new format -
Deprecate the old format
optional-dependencies
-
Looks like this is documented in schema.py and the field is allowed but we don't emit it to the METADATA
dynamic
-
Looks like this is documented in schema.py and the field is allowed but we don't emit it to the METADATA -
We're also supposed to check that name is not present in dynamic (and possibly version. See above).
schema.py
-
There's a comment that says certain fields are in tool.mesonpep517.metadata but the code is actually merging both project and tool.mesonpep517.metadata together before checking for validity and some of the names are present in both sections. Probably could clarify the comment somewhat (or make separate VALID_OPTIONS dicts for each section).