Skip to content

Commit e5a9c65

Browse files
committed
ci: improve pre-commit-update check
1 parent 1dd56df commit e5a9c65

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

build_helpers/pre_commit_update.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,12 @@
1616
with require.open("r") as rfile:
1717
requirements.extend(rfile.readlines())
1818

19-
# Extract types only
20-
type_reqs = [
21-
r.strip("\n") for r in requirements if r.startswith("types-") or r.startswith("SQLAlchemy")
22-
]
19+
# Extract relevant types only
20+
supported = ("types-", "SQLAlchemy", "scipy-stubs")
21+
22+
# Find relevant dependencies
23+
# Only keep the first part of the line up to the first space
24+
type_reqs = [r.strip("\n").split()[0] for r in requirements if r.startswith(supported)]
2325

2426
with pre_commit_file.open("r") as file:
2527
f = yaml.load(file, Loader=yaml.SafeLoader)

0 commit comments

Comments
 (0)