Skip to content

Commit

Permalink
metadata version 2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
dimbleby committed Mar 2, 2024
1 parent 09f5ad8 commit a13097d
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/poetry/core/masonry/builders/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
)

METADATA_BASE = """\
Metadata-Version: 2.1
Metadata-Version: 2.3
Name: {name}
Version: {version}
Summary: {summary}
Expand Down
6 changes: 4 additions & 2 deletions src/poetry/core/masonry/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@


if TYPE_CHECKING:
from packaging.utils import NormalizedName

from poetry.core.packages.package import Package


class Metadata:
metadata_version = "2.1"
metadata_version = "2.3"
# version 1.0
name: str | None = None
version: str
Expand Down Expand Up @@ -41,7 +43,7 @@ class Metadata:

# Version 2.1
description_content_type: str | None = None
provides_extra: list[str] = [] # noqa: RUF012
provides_extra: list[NormalizedName] = [] # noqa: RUF012

@classmethod
def from_package(cls, package: Package) -> Metadata:
Expand Down
2 changes: 1 addition & 1 deletion tests/masonry/builders/test_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def test_get_metadata_content() -> None:
p = Parser()
parsed = p.parsestr(metadata)

assert parsed["Metadata-Version"] == "2.1"
assert parsed["Metadata-Version"] == "2.3"
assert parsed["Name"] == "my-package"
assert parsed["Version"] == "1.2.3"
assert parsed["Summary"] == "Some description."
Expand Down
2 changes: 1 addition & 1 deletion tests/masonry/builders/test_complete.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def test_complete(no_vcs: bool) -> None:
assert (
wheel_data
== """\
Metadata-Version: 2.1
Metadata-Version: 2.3
Name: my-package
Version: 1.2.3
Summary: Some description.
Expand Down
2 changes: 1 addition & 1 deletion tests/masonry/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def test_prepare_metadata_for_build_wheel() -> None:
Tag: py3-none-any
"""
metadata = """\
Metadata-Version: 2.1
Metadata-Version: 2.3
Name: my-package
Version: 1.2.3
Summary: Some description.
Expand Down

0 comments on commit a13097d

Please # to comment.