machineconfig 4.94__py3-none-any.whl → 4.96__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- machineconfig/cluster/sessions_managers/ffile.py +4 -0
- machineconfig/scripts/python/fire_jobs_args_helper.py +9 -0
- machineconfig/scripts/python/helpers/helpers4.py +2 -68
- {machineconfig-4.94.dist-info → machineconfig-4.96.dist-info}/METADATA +1 -1
- {machineconfig-4.94.dist-info → machineconfig-4.96.dist-info}/RECORD +8 -7
- {machineconfig-4.94.dist-info → machineconfig-4.96.dist-info}/WHEEL +0 -0
- {machineconfig-4.94.dist-info → machineconfig-4.96.dist-info}/entry_points.txt +0 -0
- {machineconfig-4.94.dist-info → machineconfig-4.96.dist-info}/top_level.txt +0 -0
|
@@ -44,6 +44,10 @@ def extract_kwargs(args: FireJobArgs) -> dict[str, object]:
|
|
|
44
44
|
|
|
45
45
|
# Look for Fire-style arguments in sys.argv
|
|
46
46
|
for arg in sys.argv:
|
|
47
|
+
# Skip the -- separator
|
|
48
|
+
if arg == '--':
|
|
49
|
+
continue
|
|
50
|
+
|
|
47
51
|
# Match patterns like --key=value or --key value (but we'll focus on --key=value)
|
|
48
52
|
if arg.startswith('--') and '=' in arg:
|
|
49
53
|
key, value = arg[2:].split('=', 1) # Remove -- prefix and split on first =
|
|
@@ -53,6 +57,11 @@ def extract_kwargs(args: FireJobArgs) -> dict[str, object]:
|
|
|
53
57
|
elif arg.startswith('--') and '=' not in arg:
|
|
54
58
|
# Handle boolean flags like --debug
|
|
55
59
|
key = arg[2:] # Remove -- prefix
|
|
60
|
+
|
|
61
|
+
# Skip empty key (this would happen if someone just used '--')
|
|
62
|
+
if not key:
|
|
63
|
+
continue
|
|
64
|
+
|
|
56
65
|
# Check if next argument exists and doesn't start with --
|
|
57
66
|
arg_index = sys.argv.index(arg)
|
|
58
67
|
if arg_index + 1 < len(sys.argv) and not sys.argv[arg_index + 1].startswith('--'):
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
from typing import Any, Callable, Optional
|
|
2
|
-
import inspect
|
|
3
|
-
import os
|
|
4
1
|
|
|
2
|
+
from typing import Optional
|
|
3
|
+
import os
|
|
5
4
|
from machineconfig.utils.path_extended import PathExtended as PathExtended
|
|
6
5
|
|
|
7
6
|
|
|
@@ -21,19 +20,6 @@ def search_for_files_of_interest(path_obj: PathExtended):
|
|
|
21
20
|
return files
|
|
22
21
|
|
|
23
22
|
|
|
24
|
-
def convert_kwargs_to_fire_kwargs_str(kwargs: dict[str, Any]) -> str:
|
|
25
|
-
# https://google.github.io/python-fire/guide/
|
|
26
|
-
# https://github.com/google/python-fire/blob/master/docs/guide.md#argument-parsing
|
|
27
|
-
if not kwargs: # empty dict
|
|
28
|
-
kwargs_str = ""
|
|
29
|
-
else:
|
|
30
|
-
# For fire module, all keyword arguments should be passed as --key value pairs
|
|
31
|
-
tmp_list: list[str] = []
|
|
32
|
-
for k, v in kwargs.items():
|
|
33
|
-
tmp_list.append(f"--{k} {v}")
|
|
34
|
-
kwargs_str = " " + " ".join(tmp_list) + " "
|
|
35
|
-
return kwargs_str
|
|
36
|
-
|
|
37
23
|
|
|
38
24
|
def parse_pyfile(file_path: str):
|
|
39
25
|
print(f"🔍 Loading {file_path} ...")
|
|
@@ -84,58 +70,6 @@ def parse_pyfile(file_path: str):
|
|
|
84
70
|
return options, func_args
|
|
85
71
|
|
|
86
72
|
|
|
87
|
-
def interactively_run_function(func: Callable[[Any], Any]):
|
|
88
|
-
sig = inspect.signature(func)
|
|
89
|
-
params = list(sig.parameters.values())
|
|
90
|
-
args = []
|
|
91
|
-
kwargs = {}
|
|
92
|
-
for param in params:
|
|
93
|
-
if param.annotation is not inspect.Parameter.empty:
|
|
94
|
-
hint = f" ({param.annotation.__name__})"
|
|
95
|
-
else:
|
|
96
|
-
hint = ""
|
|
97
|
-
if param.default is not inspect.Parameter.empty:
|
|
98
|
-
default = param.default
|
|
99
|
-
value = input(f"Please enter a value for argument `{param.name}` (type = {hint}) (default = {default}) : ")
|
|
100
|
-
if value == "":
|
|
101
|
-
value = default
|
|
102
|
-
else:
|
|
103
|
-
value = input(f"Please enter a value for argument `{param.name}` (type = {hint}) : ")
|
|
104
|
-
try:
|
|
105
|
-
if param.annotation is not inspect.Parameter.empty:
|
|
106
|
-
value = param.annotation
|
|
107
|
-
except (TypeError, ValueError) as err:
|
|
108
|
-
raise ValueError(f"Invalid input: {value} is not of type {param.annotation}") from err
|
|
109
|
-
if param.kind == inspect.Parameter.KEYWORD_ONLY:
|
|
110
|
-
kwargs[param.name] = value
|
|
111
|
-
else:
|
|
112
|
-
args.append((param.name, value))
|
|
113
|
-
args_to_kwargs = dict(args)
|
|
114
|
-
return args_to_kwargs, kwargs
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
def get_attrs_recursively(obj: Any):
|
|
118
|
-
if hasattr(obj, "__dict__"):
|
|
119
|
-
res = {}
|
|
120
|
-
for k, v in obj.__dict__.items():
|
|
121
|
-
res[k] = get_attrs_recursively(v)
|
|
122
|
-
return res
|
|
123
|
-
return obj
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
# def run_on_remote(func_file: str, args: argparse.Namespace):
|
|
127
|
-
# host = choose_ssh_host(multi=False)
|
|
128
|
-
# assert isinstance(host, str), f"host must be a string. Got {type(host)}"
|
|
129
|
-
# from machineconfig.cluster.remote_machine import RemoteMachine, RemoteMachineConfig
|
|
130
|
-
# config = RemoteMachineConfig(copy_repo=True, update_repo=False, update_essential_repos=True,
|
|
131
|
-
# notify_upon_completion=True, ssh_params=dict(host=host),
|
|
132
|
-
# # to_email=None, email_config_name='enaut',
|
|
133
|
-
# data=[],
|
|
134
|
-
# ipython=False, interactive=args.interactive, pdb=False, pudb=args.debug, wrap_in_try_except=False,
|
|
135
|
-
# transfer_method="sftp")
|
|
136
|
-
# m = RemoteMachine(func=func_file, func_kwargs=None, config=config)
|
|
137
|
-
# m.run()
|
|
138
|
-
|
|
139
73
|
|
|
140
74
|
def find_repo_root_path(start_path: str) -> Optional[str]:
|
|
141
75
|
root_files = ["setup.py", "pyproject.toml", ".git"]
|
|
@@ -11,6 +11,7 @@ machineconfig/cluster/remote/remote_machine.py,sha256=xRuoHKNsIT0-FTFSvF1q7scnGK
|
|
|
11
11
|
machineconfig/cluster/remote/script_execution.py,sha256=4U70FDtjOh6A6C2Ei-Xh90S888q64VhRPbExoEbdepk,9980
|
|
12
12
|
machineconfig/cluster/remote/script_notify_upon_completion.py,sha256=GRxnnbnOl1-hTovTN-zI_M9wdV7x293yA77_mou9I1o,2032
|
|
13
13
|
machineconfig/cluster/sessions_managers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
14
|
+
machineconfig/cluster/sessions_managers/ffile.py,sha256=QzkBU5Ysnah9SxlzODsGprx4Q_VskWntChoejaOCEdw,52
|
|
14
15
|
machineconfig/cluster/sessions_managers/wt_local.py,sha256=cnLAcyVUr2d2ZPh0dEEr-LHrLiwTMVu7YWXM21IS7_4,17507
|
|
15
16
|
machineconfig/cluster/sessions_managers/wt_local_manager.py,sha256=BaJNOOY5rAfssreJm8Nmr4we_PCxMkmQqzUMdimNwaM,24565
|
|
16
17
|
machineconfig/cluster/sessions_managers/wt_remote.py,sha256=XmZV9rLubwxND5UYAS15mAcpzDdXvm4KyubVGYkVBmo,8743
|
|
@@ -159,7 +160,7 @@ machineconfig/scripts/python/fire_agents_help_search.py,sha256=qIfSS_su2YJ1Gb0_l
|
|
|
159
160
|
machineconfig/scripts/python/fire_agents_helper_types.py,sha256=zKu8Vr6iucaGSkCm_Tkt_WrYU7-6Nript3coYyzTXzY,295
|
|
160
161
|
machineconfig/scripts/python/fire_agents_load_balancer.py,sha256=mpqx3uaQdBXYieuvhdK-qsvLepf9oIMo3pwPj9mSEDI,1079
|
|
161
162
|
machineconfig/scripts/python/fire_jobs.py,sha256=CqtFt4VGtdEP0tbmRRZ-qU5G232jQj0umlS8C_qtQRM,15911
|
|
162
|
-
machineconfig/scripts/python/fire_jobs_args_helper.py,sha256
|
|
163
|
+
machineconfig/scripts/python/fire_jobs_args_helper.py,sha256=-gl5I-26Op12nToIpAA-YEpvn8MMkNlI5XjhUbj50I0,4273
|
|
163
164
|
machineconfig/scripts/python/fire_jobs_route_helper.py,sha256=EFWsg6F9TeSAtYQec57WtPopUbm2euGZTUZv6J4RhNE,3026
|
|
164
165
|
machineconfig/scripts/python/fire_jobs_streamlit_helper.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
165
166
|
machineconfig/scripts/python/ftpx.py,sha256=l_gdJS0QB2wVZErubtZvm4HJD9HZAJxSP68sbY73xwo,10278
|
|
@@ -217,7 +218,7 @@ machineconfig/scripts/python/ai/solutions/opencode/opencode.py,sha256=AbpHGcgLb-
|
|
|
217
218
|
machineconfig/scripts/python/helpers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
218
219
|
machineconfig/scripts/python/helpers/cloud_helpers.py,sha256=GA-bxXouUmknk9fyQAsPT-Xl3RG9-yBed71a2tu9Pig,4914
|
|
219
220
|
machineconfig/scripts/python/helpers/helpers2.py,sha256=ZdqeF1MLlaBRwoqsQAqnHi4b8rW0byFCBnbyCrPKkoA,7336
|
|
220
|
-
machineconfig/scripts/python/helpers/helpers4.py,sha256=
|
|
221
|
+
machineconfig/scripts/python/helpers/helpers4.py,sha256=rwAy7HK1CbKQZORzQMQULSKNHj0i4jo7KbUXj3qLG9I,4765
|
|
221
222
|
machineconfig/scripts/python/helpers/helpers5.py,sha256=dPBvA9Tcyx9TMgM6On49A1CueGMhBdRzikDnlJGf3J0,1123
|
|
222
223
|
machineconfig/scripts/python/helpers/repo_sync_helpers.py,sha256=39Q3XV8Zx0Y6_iWUtbwDIQI8riqLPSZ008zjqx-Gd-g,5328
|
|
223
224
|
machineconfig/scripts/windows/agents.ps1,sha256=DqdrC_Xc2rwQ6kGzT0xh5CJz4B_0p5ZwB7s8XE6rPCM,77
|
|
@@ -407,8 +408,8 @@ machineconfig/utils/schemas/fire_agents/fire_agents_input.py,sha256=pTxvLzIpD5RF
|
|
|
407
408
|
machineconfig/utils/schemas/installer/installer_types.py,sha256=QClRY61QaduBPJoSpdmTIdgS9LS-RvE-QZ-D260tD3o,1214
|
|
408
409
|
machineconfig/utils/schemas/layouts/layout_types.py,sha256=TcqlZdGVoH8htG5fHn1KWXhRdPueAcoyApppZsPAPto,2020
|
|
409
410
|
machineconfig/utils/schemas/repos/repos_types.py,sha256=ECVr-3IVIo8yjmYmVXX2mnDDN1SLSwvQIhx4KDDQHBQ,405
|
|
410
|
-
machineconfig-4.
|
|
411
|
-
machineconfig-4.
|
|
412
|
-
machineconfig-4.
|
|
413
|
-
machineconfig-4.
|
|
414
|
-
machineconfig-4.
|
|
411
|
+
machineconfig-4.96.dist-info/METADATA,sha256=9UWC2rvt9CEmexbqBn9bBY39SnI54J7X_cv49wKr4mI,7061
|
|
412
|
+
machineconfig-4.96.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
413
|
+
machineconfig-4.96.dist-info/entry_points.txt,sha256=LcwklRJPY_uKBvStgtOJn5G_pmFCEdpgRNzUUc6twAQ,1134
|
|
414
|
+
machineconfig-4.96.dist-info/top_level.txt,sha256=porRtB8qms8fOIUJgK-tO83_FeH6Bpe12oUVC670teA,14
|
|
415
|
+
machineconfig-4.96.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|