1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
"""Verify that the "all" reqs are in sync."""
import sys
from tomli import load
with open("pyproject.toml", "rb") as fid:
data = load(fid)
all_reqs = data["project"]["optional-dependencies"]["all"]
remaining_all = all_reqs.copy()
errors = []
for key, reqs in data["project"]["optional-dependencies"].items():
if key == "all":
continue
for req in reqs:
if req not in all_reqs:
errors.append(req)
elif req in remaining_all:
remaining_all.remove(req)
if errors:
print('Missing deps in "all" reqs:')
print(list(errors))
if remaining_all:
print('Reqs in "all" but nowhere else:')
print(list(remaining_all))
if errors or remaining_all:
sys.exit(1)
|