42
43 Raises:
44▶ ValueError: If the dependency string cannot be parsed.
45 """
46 match = _NAME_RE.match(dep)
· · ·
47 if not match:
48 msg = f"Cannot parse dependency: {dep!r}"
49▶ raise ValueError(msg)
50 name = match.group(1)
51 rest = dep[match.end() :].strip()
· · ·
55 if close == -1:
56 msg = f"Unclosed extras bracket in dependency: {dep!r}"
57▶ raise ValueError(msg)
58 rest = rest[close + 1 :].strip()
59
· · ·
70
71def main(pyproject_path: Path) -> int:
72▶ """Check extras sync and return `0` on pass, `1` on mismatch or parse error."""
73 with pyproject_path.open("rb") as f:
74 data = tomllib.load(f)
· · ·
78 try:
79 name, spec = _parse_dep(dep)
80▶ except ValueError as e:
81 print(f"::error file={pyproject_path}::{e}")
82 return 1
+ 3 more matches in this file