Skip to content

Commit

Permalink
MAINT: adjust typing annotations to pyproject-metadata 0.8.0
Browse files Browse the repository at this point in the history
mypy is always run with the latest version of the dependencies.
  • Loading branch information
dnicolodi committed Apr 18, 2024
1 parent a9ac054 commit e678453
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mesonpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ def _validate_name(name: str) -> str:
return name

@classmethod
def from_pyproject(cls, data: Mapping[str, Any], project_dir: Path) -> Metadata: # type: ignore[override]
def from_pyproject(cls, data: Mapping[str, Any], project_dir: Path) -> Self:
# The class method from the pyproject_metadata base class is not
# typed in a subclassing friendly way, thus annotations to ignore
# typing are needed.
Expand All @@ -266,7 +266,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
Expand Down

0 comments on commit e678453

Please sign in to comment.