Skip to content

Commit c9e252b

Browse files
committed
MAINT: adjust typing annotations to pyproject-metadata 0.8.0
mypy is always run with the latest version of the dependencies.
1 parent 3deefb9 commit c9e252b

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

mesonpy/__init__.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -248,11 +248,7 @@ def _validate_name(name: str) -> str:
248248
return name
249249

250250
@classmethod
251-
def from_pyproject(cls, data: Mapping[str, Any], project_dir: Path) -> Metadata: # type: ignore[override]
252-
# The class method from the pyproject_metadata base class is not
253-
# typed in a subclassing friendly way, thus annotations to ignore
254-
# typing are needed.
255-
251+
def from_pyproject(cls, data: Mapping[str, Any], project_dir: Path, metadata_version: Optional[str] = None) -> Self:
256252
metadata = super().from_pyproject(data, project_dir)
257253

258254
# Check for missing version field.
@@ -266,7 +262,7 @@ def from_pyproject(cls, data: Mapping[str, Any], project_dir: Path) -> Metadata:
266262
fields = ', '.join(f'"{x}"' for x in unsupported_dynamic)
267263
raise pyproject_metadata.ConfigurationError(f'Unsupported dynamic fields: {fields}')
268264

269-
return metadata # type: ignore[return-value]
265+
return metadata
270266

271267
# Local fix for a bug in pyproject-metadata. See
272268
# https://github.com/mesonbuild/meson-python/issues/454

0 commit comments

Comments
 (0)