Skip to content

Commit

Permalink
mesonpy: allow pre-releases when checking the interpreter version
Browse files Browse the repository at this point in the history
Signed-off-by: Filipe Laíns <lains@riseup.net>
  • Loading branch information
FFY00 committed Jun 10, 2022
1 parent a394f9c commit ef44fb1
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions mesonpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,14 +464,13 @@ def _validate_metadata(self) -> None:
)

# check if we are running on an unsupported interpreter
if (
self._metadata.requires_python
and platform.python_version() not in self._metadata.requires_python
):
raise MesonBuilderError(
f'Unsupported Python version `{platform.python_version()}`, '
f'expected `{self._metadata.requires_python}`'
)
if self._metadata.requires_python:
self._metadata.requires_python.prereleases = True
if platform.python_version() not in self._metadata.requires_python:
raise MesonBuilderError(
f'Unsupported Python version `{platform.python_version()}`, '
f'expected `{self._metadata.requires_python}`'
)

@functools.lru_cache(maxsize=None)
def build(self) -> None:
Expand Down

0 comments on commit ef44fb1

Please sign in to comment.