Opened 15 months ago

Closed 5 months ago

Last modified 2 weeks ago

#35961 closed Bug (fixed)

Support PEP639-style license indicator in pyproject.toml

Reported by: Michiel Beijen Owned by: Michiel Beijen
Component: Packaging Version: 4.2
Severity: Release blocker Keywords: packaging, license
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Jacob Walls)

Attachments (1)

0001-Implement-PEP-639-licence-tags-in-pyproject.toml.patch (1.0 KB ) - added by Michiel Beijen 15 months ago.

Download all attachments as: .zip

Change History (24)

comment:1 by Michiel Beijen, 15 months ago

Description: modified (diff)

comment:2 by Michiel Beijen, 15 months ago

Description: modified (diff)

comment:3 by David Smith, 15 months ago

Has patch: unset
Triage Stage: UnreviewedAccepted

I'm accepting as the project is currently using License and this is now deprecated

However, I think the proposal here needs to be refined as the attached patch uses License and this is deprecated in favour of License-Expression.

comment:4 by Michiel Beijen, 15 months ago

Has patch: set
Owner: set to Michiel Beijen

Hi, I've added PR https://github.com/django/django/pull/18892 for this one.

You mention:

I'm accepting as the project is currently using License and this is now ​deprecated

but I think you're mistaken, this is metadata in the created package, which is made by the packaging software, and not the pyproject.toml itself, see the pep639 and the document you linked to about Core Metadata for details --> https://packaging.python.org/en/latest/specifications/core-metadata/#license

comment:5 by Natalia Bidart, 14 months ago

Patch needs improvement: set
Version: 5.1dev

Proposed change does not work, I added details to the PR.

comment:6 by Ahmed Nassar, 10 months ago

I'm happy to work on this ticket and submit my PR.

comment:7 by Ahmed Nassar, 10 months ago

Owner: changed from Michiel Beijen to Ahmed Nassar

comment:8 by Natalia Bidart, 10 months ago

#36362 was a dupe.

comment:9 by Natalia Bidart, 9 months ago

Fix for this ticket should include updating the tutorial section that describes steps for packaging your app.

comment:10 by Jacob Walls, 6 months ago

Summary: Support PEP639-style license indicator in pyproject.yamlSupport PEP639-style license indicator in pyproject.toml

comment:11 by Jacob Walls, 6 months ago

Description: modified (diff)
Keywords: license added
Owner: changed from Ahmed Nassar to Jacob Walls
Severity: NormalRelease blocker
Type: Cleanup/optimizationBug
Version: dev4.2

comment:12 by Jacob Walls, 6 months ago

Owner: changed from Jacob Walls to Michiel Beijen
Patch needs improvement: unset
Triage Stage: AcceptedReady for checkin

comment:13 by nessita <124304+nessita@…>, 5 months ago

Resolution: fixed
Status: assignedclosed

In 96a7a65:

Fixed #35961 -- Migrated license metadata in pyproject.toml to conform PEP 639.

See https://peps.python.org/pep-0639/ and
https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license-and-license-files.

Co-authored-by: Jacob Walls <jacobtylerwalls@…>

comment:14 by Natalia <124304+nessita@…>, 5 months ago

In d0d2dd77:

[6.0.x] Fixed #35961 -- Migrated license metadata in pyproject.toml to conform PEP 639.

See https://peps.python.org/pep-0639/ and
https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license-and-license-files.

Co-authored-by: Jacob Walls <jacobtylerwalls@…>

Backport of 96a7a652166bece8acc96d6335ebb8091de2f496 from main.

comment:15 by Natalia <124304+nessita@…>, 5 months ago

In c05c5b80:

[5.2.x] Fixed #35961 -- Migrated license metadata in pyproject.toml to conform PEP 639.

See https://peps.python.org/pep-0639/ and
https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license-and-license-files.

Co-authored-by: Jacob Walls <jacobtylerwalls@…>

Backport of 96a7a652166bece8acc96d6335ebb8091de2f496 from main.

comment:16 by Natalia <124304+nessita@…>, 5 months ago

In 7da2bf9:

[5.1.x] Fixed #35961 -- Migrated license metadata in pyproject.toml to conform PEP 639.

See https://peps.python.org/pep-0639/ and
https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license-and-license-files.

Co-authored-by: Jacob Walls <jacobtylerwalls@…>

Backport of 96a7a652166bece8acc96d6335ebb8091de2f496 from main.

comment:17 by Natalia Bidart, 5 months ago

Not migrating to 4.2.x until strictly necessary as Jacob mentioned in the PR.

comment:18 by stefan6419846, 3 weeks ago

This change seems to have removed the AUTHORS file from *.dist-info/licenses due to explicitly declaring the list of license files to use. Is this intended or an unexpected side effect?

comment:19 by Jacob Walls, 3 weeks ago

Thanks -- I was not aware that the AUTHORS file was previously included in *.dist-info/licenses. I see the packaging user guide example includes such a file, so I would accept a PR adding it to license-files. Would you like to do that? You can prefix it Refs #35961 -- ....

comment:20 by Michiel Beijen, 3 weeks ago

Hi stefan, thanks for spotting this! I was the one that created the original PR which caused this, I'm sorry.
My new PR for adding back the AUTHORS file explicitly is here --> https://github.com/django/django/pull/20638

comment:21 by GitHub <noreply@…>, 2 weeks ago

In 220db1c:

Refs #35961 -- Restored AUTHORS in wheel.

As a side effect from adding explicit license files to conform to PEP 639, the
AUTHORS file got dropped from the wheel. The tarball still contained this file.

In the "Python Packaging User Guide"
(https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license-files)
the AUTHORS file is modeled to be included in license-files.

Follow-up to 96a7a652166bece8acc96d6335ebb8091de2f496.

comment:22 by Jacob Walls <jacobtylerwalls@…>, 2 weeks ago

In dab569a1:

[6.0.x] Refs #35961 -- Restored AUTHORS in wheel.

As a side effect from adding explicit license files to conform to PEP 639, the
AUTHORS file got dropped from the wheel. The tarball still contained this file.

In the "Python Packaging User Guide"
(https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license-files)
the AUTHORS file is modeled to be included in license-files.

Follow-up to 96a7a652166bece8acc96d6335ebb8091de2f496.
Backport of 220db1c78a1bdeb3ccb91ba8bf0b7ab829379c35 from main.

comment:23 by Jacob Walls <jacobtylerwalls@…>, 2 weeks ago

In 420c707:

[5.2.x] Refs #35961 -- Restored AUTHORS in wheel.

As a side effect from adding explicit license files to conform to PEP 639, the
AUTHORS file got dropped from the wheel. The tarball still contained this file.

In the "Python Packaging User Guide"
(https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license-files)
the AUTHORS file is modeled to be included in license-files.

Follow-up to 96a7a652166bece8acc96d6335ebb8091de2f496.
Backport of 220db1c78a1bdeb3ccb91ba8bf0b7ab829379c35 from main.

Note: See TracTickets for help on using tickets.
Back to Top