Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion mesonpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ class InvalidLicenseExpression(Exception): # type: ignore[no-redef]
_SUPPORTED_DYNAMIC_FIELDS = {'version', } if _PYPROJECT_METADATA_VERSION < (0, 9) else {'version', 'license', 'license-files'}

_NINJA_REQUIRED_VERSION = '1.8.2'
_MESON_REQUIRED_VERSION = '0.63.3' # keep in sync with the version requirement in pyproject.toml

# Keep in sync with the version requirement in pyproject.toml
_MESON_REQUIRED_VERSION = '0.64.0' if sys.version_info < (3, 12) else '1.2.3'

_MESON_ARGS_KEYS = ['dist', 'setup', 'compile', 'install']

Expand Down
12 changes: 12 additions & 0 deletions tests/test_consistency.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import pathlib
import sys

from packaging import requirements, specifiers


if sys.version_info >= (3, 11):
import tomllib
Expand All @@ -30,3 +32,13 @@ def test_pyproject_dependencies():
# verify that all build dependencies are project dependencies
assert not set(build_dependencies) - set(project_dependencies), \
'pyproject.toml is inconsistent: not all "build-system.requires" are in "project.dependencies"'


def test_meson_version_requirement():
pyproject = pathlib.Path(__file__).parent.parent.joinpath('pyproject.toml')
with open(pyproject, 'rb') as f:
data = tomllib.load(f)
for dep in data['project']['dependencies']:
req = requirements.Requirement(dep)
if req.name == 'meson' and req.marker.evaluate():
assert req.specifier == specifiers.SpecifierSet(f'>= {mesonpy._MESON_REQUIRED_VERSION}')
Loading