Skip to content

Commit

Permalink
more fixes in pyproject-metadata 0.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dnicolodi committed Apr 15, 2024
1 parent 9cc7078 commit 3f99f81
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions mesonpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,20 +242,14 @@ def __init__(self, name: str, *args: Any, **kwargs: Any):
super().__init__(name, *args, **kwargs)

@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) -> Self:
metadata = super().from_pyproject(data, project_dir)

# Check for unsupported dynamic fields.
unsupported_dynamic = set(metadata.dynamic) - {'version', }
if unsupported_dynamic:
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

@property
def distribution_name(self) -> str:
Expand Down

0 comments on commit 3f99f81

Please sign in to comment.