poetry icon indicating copy to clipboard operation
poetry copied to clipboard

Implement PEP 639

Open befeleme opened this issue 1 year ago • 9 comments

Issue Kind

Change in current behaviour

Description

See: https://peps.python.org/pep-0639

Additional context:

  • The full implementation, including the Core Metadata bump to 2.4, will require also the support on the side of PyPI first: https://github.com/pypi/warehouse/issues/16620

  • There's a plan to add validation data and parser to packaging: https://github.com/pypa/packaging/pull/799 + https://github.com/pypa/packaging/pull/828

Impact

poetry now uses the license field from the custom [tool.poetry] table - this will enable unification under the specified main [project] table of pyproject.toml and map to a new core metadata field. This also brings in a standardized way of specifying the license files in the package metadata, which will help the downstream consumers locate them unambiguously.

Workarounds

poetry now includes both the license expression (as SPDX) and the license files in the distribution. This will just make the declarations and metadata unified across many packaging tools.

befeleme avatar Sep 04 '24 07:09 befeleme

We will wait for packaging to support it and use their implementation.

Secrus avatar Oct 06 '24 16:10 Secrus

This looks to be implemented in packaging 24.2.

https://github.com/pypa/packaging/releases/tag/24.2

carlwgeorge avatar Nov 11 '24 21:11 carlwgeorge

Hi - we started getting the following error when trying to update ruff to the latest version 0.8.1 which was released very recently. Is there some work that needs to be done for poetry to support packages using the new metadata 2.4 version? I checked that we already have the latest version of poetry, and also packaging==24.2 is already a transitive dependency.

Unable to determine package info for path: /var/folders/j3/<snip>/ruff-0.8.1-py3-none-linux_armv6l.whl

Unknown metadata version: 2.4

dekim24 avatar Dec 02 '24 05:12 dekim24

We have the same problem

martynvdijke avatar Dec 02 '24 08:12 martynvdijke

urllib3 2.3.0 released today uses metadata version 2.4.

andresdelfino avatar Dec 22 '24 15:12 andresdelfino

urllib3 2.3.0 released today uses metadata version 2.4.

@andresdelfino what problem is that causing for you? and have you seen https://github.com/astral-sh/ruff/issues/14681#issuecomment-2512302023? It seems upgrading pkginfo fixes the metadata issues.

edgarrmondragon avatar Dec 23 '24 01:12 edgarrmondragon

urllib3 2.3.0 released today uses metadata version 2.4.

@andresdelfino what problem is that causing for you? and have you seen astral-sh/ruff#14681 (comment)? It seems upgrading pkginfo fixes the metadata issues.

Sorry, I had a problem because I was using a Poetry installation made before the new pkginfo came out. Running a new installation of Poetry solved the problem.

andresdelfino avatar Dec 23 '24 13:12 andresdelfino

I have hidden the off-topic comments. Please avoid commenting on matters not connected with implementing the new standard.

Secrus avatar Dec 25 '24 10:12 Secrus

FYI: I started working on it in python-poetry/poetry-core#870. Actually, I think most of the work has been done. (See TODO list in the PR.)

radoering avatar May 18 '25 16:05 radoering

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

github-actions[bot] avatar Sep 17 '25 00:09 github-actions[bot]