Skip to content
New issue

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

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

Already on GitHub? # to your account

metadata version 2.3 #707

Merged
merged 1 commit into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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