Skip to content

Commit 2e22082

Browse files
authored
Merge pull request #119 from ocaisa/grpcio_hook
Don't have grpcio hook error out when version not in the list
2 parents 9cec653 + 9c7099b commit 2e22082

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

eb_hooks.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -418,13 +418,17 @@ def parse_hook_fontconfig_add_fonts(ec, eprefix):
418418

419419
def parse_hook_grpcio_zlib(ec, ecprefix):
420420
"""Adjust preinstallopts to use ZLIB from compat layer."""
421-
if ec.name == 'grpcio' and ec.version in ['1.57.0']:
422-
exts_list = ec['exts_list']
423-
original_preinstallopts = (exts_list[0][2])['preinstallopts']
424-
original_option = "GRPC_PYTHON_BUILD_SYSTEM_ZLIB=True"
425-
new_option = "GRPC_PYTHON_BUILD_SYSTEM_ZLIB=False"
426-
(exts_list[0][2])['preinstallopts'] = original_preinstallopts.replace(original_option, new_option, 1)
427-
print_msg("Modified the easyconfig to use compat ZLIB with GRPC_PYTHON_BUILD_SYSTEM_ZLIB=False")
421+
if ec.name == 'grpcio':
422+
target_list = ['1.57.0', '1.67.1', '1.70.0']
423+
if ec.version in target_list:
424+
exts_list = ec['exts_list']
425+
original_preinstallopts = (exts_list[0][2])['preinstallopts']
426+
original_option = "GRPC_PYTHON_BUILD_SYSTEM_ZLIB=True"
427+
new_option = "GRPC_PYTHON_BUILD_SYSTEM_ZLIB=False"
428+
(exts_list[0][2])['preinstallopts'] = original_preinstallopts.replace(original_option, new_option, 1)
429+
print_msg("Modified the easyconfig to use compat ZLIB with GRPC_PYTHON_BUILD_SYSTEM_ZLIB=False")
430+
else:
431+
print_warning("%s version %s not in target list %s, not applying hook", ec.name, ec.version, target_list)
428432
else:
429433
raise EasyBuildError("grpcio-specific hook triggered for a non-grpcio easyconfig?!")
430434

0 commit comments

Comments
 (0)