Skip to content

Commit f97e099

Browse files
committed
ENH: add tests to avoid dependencies getting out of sync again
1 parent d1f78e3 commit f97e099

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

tests/test_consistency.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# SPDX-FileCopyrightText: 2021 The meson-python developers
2+
#
3+
# SPDX-License-Identifier: MIT
4+
5+
import pathlib
6+
import sys
7+
8+
9+
if sys.version_info >= (3, 11):
10+
import tomllib
11+
else:
12+
import tomli as tomllib
13+
14+
15+
def test_pyproject_dependencies():
16+
pyproject = pathlib.Path(__file__).parent.parent.joinpath('pyproject.toml')
17+
with open(pyproject, 'rb') as f:
18+
data = tomllib.load(f)
19+
build_dependencies = data['build-system']['requires']
20+
project_dependencies = data['project']['dependencies']
21+
# verify that all build dependencies are project dependencies
22+
assert not set(build_dependencies) - set(project_dependencies), \
23+
'pyproject.toml is inconsistent: not all "build-system.requires" are in "project.dependencies"'

0 commit comments

Comments
 (0)