File 6aa97735de80943a61aecea59963bdb685d7c324.patch of Package python-meson-python
From 6aa97735de80943a61aecea59963bdb685d7c324 Mon Sep 17 00:00:00 2001
From: Daniele Nicolodi <daniele@grinta.net>
Date: Thu, 18 Apr 2024 10:15:33 +0200
Subject: [PATCH] MAINT: adjust typing annotations to pyproject-metadata 0.8.0
mypy is always run with the latest version of the dependencies.
---
mesonpy/__init__.py | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/mesonpy/__init__.py b/mesonpy/__init__.py
index eee05a69..feca54a4 100644
--- a/mesonpy/__init__.py
+++ b/mesonpy/__init__.py
@@ -248,11 +248,12 @@ def _validate_name(name: str) -> str:
return name
@classmethod
- def from_pyproject(cls, data: Mapping[str, Any], project_dir: Path) -> Metadata: # type: ignore[override]
- # The class method from the pyproject_metadata base class is not
- # typed in a subclassing friendly way, thus annotations to ignore
- # typing are needed.
-
+ def from_pyproject(
+ cls,
+ data: Mapping[str, Any],
+ project_dir: Path = os.path.curdir,
+ metadata_version: Optional[str] = None
+ ) -> Self:
metadata = super().from_pyproject(data, project_dir)
# Check for missing version field.
@@ -266,7 +267,7 @@ def from_pyproject(cls, data: Mapping[str, Any], project_dir: Path) -> Metadata:
fields = ', '.join(f'"{x}"' for x in unsupported_dynamic)
raise pyproject_metadata.ConfigurationError(f'Unsupported dynamic fields: {fields}')
- return metadata # type: ignore[return-value]
+ return metadata
# Local fix for a bug in pyproject-metadata. See
# https://github.com/mesonbuild/meson-python/issues/454