setuptools icon indicating copy to clipboard operation
setuptools copied to clipboard

[FR] Support License-File root license directory (PEP 639)

Open hroncok opened this issue 3 years ago • 3 comments

What's the problem this feature will solve?

The License-File core metadata tag definition in https://peps.python.org/pep-0639/ was updated. Specifically:

Root License Directory (Short: License Directory) The directory under which license files are stored in a project/distribution and the root directory that their paths, as recorded under the License-File core metadata fields, are relative to. Defined here to be the project root directory for source trees and source distributions, and a subdirectory named licenses of the directory containing the core metadata (i.e., the .dist-info/licenses directory) for built distributions and installed projects.

And:

As specified by this PEP, [License-File] value is also that file’s path relative to the root license directory in [...] installed projects [...]

Translated to human language, when the License-File looks like this:

License-File: LICENSE

The file should be located in ...dist-info/licenses/LICENSE. Currently, it is located in ...dist-info/LICENSE directly, based on a previous iteration of this PEP (which is til a draft).

Describe the solution you'd like

When including license files in dist-info, move them to the licenses directory.

Alternative Solutions

An alternate solution is that a tool that reads the License-File core metadata tag should look for the files in both locations.

Additional context

hatchling already follows this and includes the license files in the licenses directory.

Thank you :heart:

Code of Conduct

  • [X] I agree to follow the PSF Code of Conduct

hroncok avatar Sep 19 '22 12:09 hroncok

Thank you for the ticket @hroncok.

My doubt here is if we should wait until PEP 639 is finalised instead of risking implementing it again and having to change later.

This issue also might require coordination with the wheel package.

abravalheri avatar Sep 20 '22 11:09 abravalheri

My doubt here is if we should wait until PEP 639 is finalised instead of risking implementing it again and having to change later.

PEP 639 has been provisionally accepted (with one of the conditions being implementation in at least two build backends :pleading_face:), so this issue now describes the solution agreed upon.

befeleme avatar Sep 03 '24 07:09 befeleme

Thank you very much @befeleme.

If any member of the community is interested in giving it a go, PRs are very welcome.

abravalheri avatar Sep 03 '24 09:09 abravalheri

UPD: PEP 639 has been accepted in full.

webknjaz avatar Jan 27 '25 14:01 webknjaz