Skip to content

Commit

Permalink
BUG: adjust to older pyproject-metadata releases
Browse files Browse the repository at this point in the history
  • Loading branch information
dnicolodi committed Oct 12, 2024
1 parent 8f1efd5 commit 9635f33
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mesonpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ def canonicalize_license_expression(s: str) -> str:

__version__ = '0.17.0.dev0'

_PYPROJECT_METADATA_VERSION = tuple(map(int, pyproject_metadata.__version__.split('.')[:2]))

_NINJA_REQUIRED_VERSION = '1.8.2'
_MESON_REQUIRED_VERSION = '0.63.3' # keep in sync with the version requirement in pyproject.toml
Expand Down Expand Up @@ -244,6 +245,9 @@ class MesonBuilderError(Error):

class Metadata(pyproject_metadata.StandardMetadata):
def __init__(self, name: str, *args: Any, **kwargs: Any):
if _PYPROJECT_METADATA_VERSION < (0, 9):
kwargs.pop('license', None)
kwargs.pop('license_files', None)
super().__init__(name, *args, **kwargs)
# Local fix for https:/FFY00/python-pyproject-metadata/issues/60
self.name = self._validate_name(name)
Expand Down

0 comments on commit 9635f33

Please sign in to comment.