Skip to content

Commit a36840f

Browse files
committed
Fix shebang test to skip __init__/test files, fix forumdl cchardet build failure
1. Shebang test: skip executable bit + shebang checks for __init__.py, test files, and utils — these aren't meant to be run as scripts. 2. Forumdl test: add pip overrides matching the crawl hook — install with --no-deps and chardet==5.2.0 instead of cchardet, which can't compile on Python 3.12+ (longintrepr.h removed). https://claude.ai/code/session_01XyzPfEB3qopffFuRyouaTa
1 parent b27dbc0 commit a36840f

2 files changed

Lines changed: 25 additions & 1 deletion

File tree

abx_plugins/plugins/forumdl/tests/test_forumdl.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,26 @@ def get_forumdl_binary_path() -> str | None:
5858
binary = Binary(
5959
name="forum-dl",
6060
binproviders=[PipProvider(), EnvProvider()],
61+
overrides={
62+
"pip": {
63+
"install_args": [
64+
"--no-deps",
65+
"--prefer-binary",
66+
"forum-dl",
67+
"chardet==5.2.0",
68+
"beautifulsoup4",
69+
"soupsieve",
70+
"lxml",
71+
"requests",
72+
"urllib3",
73+
"tenacity",
74+
"python-dateutil",
75+
"six",
76+
"html2text",
77+
"warcio",
78+
]
79+
}
80+
},
6181
).load_or_install()
6282
if binary and binary.abspath:
6383
_forumdl_binary_path = str(binary.abspath)

tests/test_plugin_executables_have_shebang.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,15 @@ def test_all_plugin_scripts_are_executable_and_have_shebang() -> None:
3232

3333
for script_path in _iter_plugin_scripts():
3434
rel_path = script_path.relative_to(REPO_ROOT)
35+
36+
if not _requires_shebang(script_path):
37+
continue
38+
3539
mode = script_path.stat().st_mode
3640
if not mode & (stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH):
3741
failures.append(f"{rel_path}: missing executable bit")
3842

39-
if _requires_shebang(script_path):
43+
if True:
4044
first_line = script_path.read_text(
4145
encoding="utf-8", errors="ignore"
4246
).splitlines()

0 commit comments

Comments
 (0)