Skip to content

Commit 1099060

Browse files
committed
Fix issues with missing imports in Windows installer
1 parent b762383 commit 1099060

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

ms2rescore.spec

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,16 @@ while requirements:
4545
checked.add(requirement)
4646
module_version = importlib.metadata.version(re.match(r"^[\w\-]+", requirement)[0])
4747
try:
48-
datas_, binaries_, hidden_imports_ = collect_all(requirement, include_py_files=True)
49-
except ImportError:
48+
# Use filter to exclude problematic xgboost.testing module
49+
filter_func = lambda name: not name.startswith("xgboost.testing") if requirement == "xgboost" else True
50+
datas_, binaries_, hidden_imports_ = collect_all(
51+
requirement,
52+
include_py_files=True,
53+
filter_submodules=filter_func
54+
)
55+
except (ImportError, RuntimeError) as e:
56+
# Skip packages that fail to collect
57+
print(f"Warning: Failed to collect {requirement}: {e}")
5058
continue
5159
datas += datas_
5260
hidden_imports_ = set(hidden_imports_)
@@ -59,6 +67,18 @@ while requirements:
5967

6068
hidden_imports = sorted([h for h in hidden_imports if "tests" not in h.split(".")])
6169
hidden_imports = [h for h in hidden_imports if "__pycache__" not in h]
70+
71+
# Add hdf5plugin imports to fix runtime import issues
72+
hidden_imports.extend([
73+
"hdf5plugin.plugins.bshuf",
74+
"hdf5plugin.plugins.blosc",
75+
"hdf5plugin.plugins.blosc2",
76+
"hdf5plugin.plugins.lz4",
77+
"hdf5plugin.plugins.fcidecomp",
78+
"hdf5plugin.plugins.zfp",
79+
"hdf5plugin.plugins.zstd",
80+
])
81+
6282
datas = [
6383
d
6484
for d in datas

0 commit comments

Comments
 (0)