MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / set_action_env_var

Function set_action_env_var

configure.py:402–434  ·  view source on GitHub ↗

Set boolean action_env variable. Ask user if query_item will be enabled. Default is used if no input is given. Set environment variable and write to .bazelrc. Args: environ_cp: copy of the os.environ. var_name: string for name of environment variable, e.g. "TF_NEED_CUDA". query_i

(environ_cp,
                       var_name,
                       query_item,
                       enabled_by_default,
                       question=None,
                       yes_reply=None,
                       no_reply=None,
                       bazel_config_name=None)

Source from the content-addressed store, hash-verified

400
401
402def set_action_env_var(environ_cp,
403 var_name,
404 query_item,
405 enabled_by_default,
406 question=None,
407 yes_reply=None,
408 no_reply=None,
409 bazel_config_name=None):
410 """Set boolean action_env variable.
411
412 Ask user if query_item will be enabled. Default is used if no input is given.
413 Set environment variable and write to .bazelrc.
414
415 Args:
416 environ_cp: copy of the os.environ.
417 var_name: string for name of environment variable, e.g. "TF_NEED_CUDA".
418 query_item: string for feature related to the variable, e.g. "CUDA for
419 Nvidia GPUs".
420 enabled_by_default: boolean for default behavior.
421 question: optional string for how to ask for user input.
422 yes_reply: optional string for reply when feature is enabled.
423 no_reply: optional string for reply when feature is disabled.
424 bazel_config_name: adding config to .bazelrc instead of action_env.
425 """
426 var = int(
427 get_var(environ_cp, var_name, query_item, enabled_by_default, question,
428 yes_reply, no_reply))
429
430 if not bazel_config_name:
431 write_action_env_to_bazelrc(var_name, var)
432 elif var:
433 write_to_bazelrc('build --config=%s' % bazel_config_name)
434 environ_cp[var_name] = str(var)
435
436
437def convert_version_to_int(version):

Callers 3

set_tf_cuda_clangFunction · 0.85
set_tf_download_clangFunction · 0.85
mainFunction · 0.85

Calls 3

write_to_bazelrcFunction · 0.85
get_varFunction · 0.70

Tested by

no test coverage detected