File tree Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -416,6 +416,17 @@ def run(**kwargs):
416416 disable_console_interactive = (
417417 kwargs .pop ("disable_console_interactive" , False ) or disable_console
418418 )
419+ console = Console () if not disable_console else None
420+ envs = cli_tools .list_set_env ()
421+ if console and envs :
422+ console .print_update (
423+ title = (
424+ "Note: the following environment variables "
425+ "are set and **may** affect configuration"
426+ ),
427+ details = ", " .join (envs ),
428+ status = "warning" ,
429+ )
419430
420431 try :
421432 args = BenchmarkGenerativeTextArgs .create (
@@ -439,7 +450,7 @@ def run(**kwargs):
439450 if not disable_console_interactive
440451 else None
441452 ),
442- console = Console () if not disable_console else None ,
453+ console = console ,
443454 )
444455 )
445456
Original file line number Diff line number Diff line change 11import contextlib
22import json
3+ import os
34from typing import Any
45
56import click
67
78__all__ = [
89 "Union" ,
910 "format_list_arg" ,
11+ "list_set_env" ,
1012 "parse_json" ,
1113 "parse_list" ,
1214 "parse_list_floats" ,
1315 "set_if_not_default" ,
1416]
1517
1618
19+ def list_set_env (prefix : str = "GUIDELLM_" ) -> list [str ]:
20+ """
21+ List all set environment variables prefixed with the given prefix.
22+
23+ :param prefix: The prefix to filter environment variables.
24+ :return: List of environment variable names that are set with the given prefix.
25+ """
26+ return [key for key in os .environ if key .startswith (prefix )]
27+
28+
1729def parse_list (ctx , param , value ) -> list [str ] | None :
1830 """
1931 Click callback to parse the input value into a list of strings.
You can’t perform that action at this time.
0 commit comments