Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No need to consider license-files when handling PEP 621 metadata for setuptools plugin #34

Merged
merged 11 commits into from
Mar 9, 2022

Conversation

abravalheri
Copy link
Owner

Previously, ini2toml was considering that project.license and project.dynamic were relevant for setting the License-file in PKG-INFO. As clarified in a recent discussion, that is not the case: setuptools can fill License-file even when project.license is static and pyproject.toml' license.file is completely unrelated to setup.cfg' license_files.

When we consider license and license-files separately, we can simplify the implementation:

  • setup.cfg license can be converted directly into pyproject.toml license.text
  • setup.cfg license-files can be converted directly into pyproject.toml tool.setuptools.license-files (this will be reviewed after the approval of PEP 639 when there will be a standard for that field).

See:

As discussed in the [Packaging discourse], PEP 621' project.license.file
is completely uncorrelated to the currently non-standard License-file
core metadata used by setuptools.

Therefore it is completely possible to dynamically define `License-file`
without having to mark `license` as `dynamic`.

This allow some simplifications as implemented in this change.

[Packaging discourse]: https://discuss.python.org/t/help-testing-experimental-features-in-setuptools/13821/57
When an inline-table has comments, we can bubble this comments out to be
associated directly with the table (otherwise they are simply removed).
Now that we clarified that PEP 621 does not specify anything about the
(non-standard) core metadata field `License-file` and that it is not
necessary to add `license` to `dynamic` to be able to automatically fill
it, there is no motivation for keeping this field in
`tool.setuptools.dynamic` instead of `tool.setuptools` (directly).

Note that this is unlikely to change with PEP 639 (the draft currently
establishes that the backend can backfill `license-files` without
needing an explicit `dynamic` if it is not provided).
@abravalheri abravalheri marked this pull request as ready for review March 9, 2022 15:30
@abravalheri abravalheri merged commit 459c6d6 into main Mar 9, 2022
@abravalheri abravalheri deleted the license-files branch March 9, 2022 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant