Skip to content

Commit 20f9f6e

Browse files
committed
fix: move clang-tools to dependencies section
1 parent d56ca2a commit 20f9f6e

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

cpp_linter_hooks/util.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,9 @@ def get_version_from_dependency(tool: str) -> Optional[str]:
2020
return None
2121
with open(pyproject_path, "rb") as f:
2222
data = tomllib.load(f)
23-
# Check build-system.requires
24-
build_system = data.get("build-system", {})
25-
requires = build_system.get("requires", [])
26-
for dep in requires:
23+
# Check dependencies
24+
dependencies = data.get("dependencies", [])
25+
for dep in dependencies:
2726
if dep.startswith(f"{tool}=="):
2827
return dep.split("==")[1]
2928
return None

pyproject.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[build-system]
2-
requires = ["setuptools>=45", "setuptools-scm", "clang-format==21.1.0", "clang-tidy==21.1.0"]
2+
requires = ["setuptools>=45", "setuptools-scm"]
33
build-backend = "setuptools.build_meta"
44

55
requires-python = ">=3.9"
@@ -34,6 +34,8 @@ classifiers = [
3434
dependencies = [
3535
"tomli>=1.1.0; python_version < '3.11'",
3636
"setuptools>=45.0.0", # Required for pkg_resources in clang-tidy
37+
"clang-format==21.1.0",
38+
"clang-tidy==21.1.0",
3739
]
3840
dynamic = ["version"]
3941

0 commit comments

Comments
 (0)