torchx-nightly 2025.5.5__py3-none-any.whl → 2025.5.6__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.

Potentially problematic release.


This version of torchx-nightly might be problematic. Click here for more details.

@@ -311,7 +311,7 @@ class _LocalReplica:
311
311
  """
312
312
  # safe to call terminate on a process that already died
313
313
  try:
314
- os.killpg(self.proc.pid, signal.SIGTERM)
314
+ os.kill(self.proc.pid, signal.SIGTERM)
315
315
  except ProcessLookupError as e:
316
316
  log.debug(f"Process {self.proc.pid} already got terminated")
317
317
 
torchx/util/types.py CHANGED
@@ -7,6 +7,7 @@
7
7
  # pyre-strict
8
8
 
9
9
  import inspect
10
+ import re
10
11
  from typing import Any, Callable, Dict, List, Optional, Tuple, Type, TypeVar, Union
11
12
 
12
13
  import typing_inspect
@@ -31,6 +32,9 @@ def to_dict(arg: str) -> Dict[str, str]:
31
32
  When values are lists, the last delimiter is used as kv-pair delimiter
32
33
  (e.g. ``FOO=v1,v2,BAR=v3``). Empty values of ``arg`` returns an empty map.
33
34
 
35
+ Values can be quoted with single or double quotes to include special characters
36
+ (``"="``, ``","``, ``";"``) without them being interpreted as separators.
37
+
34
38
  Note that values that encode list literals are returned as list literals
35
39
  NOT actual lists. The caller must further process each value in the returned
36
40
  map, to cast/decode the value literals as specific types. In this case,
@@ -57,6 +61,7 @@ def to_dict(arg: str) -> Dict[str, str]:
57
61
  to_dict("FOO=v1;v2,BAR=v3") == {"FOO": "v1;v2", "BAR": "v3"}
58
62
  to_dict("FOO=v1;v2;BAR=v3") == {"FOO": "v1;v2", "BAR": "v3"}
59
63
 
64
+ to_dict('FOO="value with = and , and ;"') == {"FOO": "value with = and , and ;"}
60
65
  """
61
66
 
62
67
  def parse_val_key(vk: str) -> Tuple[str, str]:
@@ -74,6 +79,10 @@ def to_dict(arg: str) -> Dict[str, str]:
74
79
  return vk[0:idx].strip(), vk[idx + 1 :].strip()
75
80
 
76
81
  def to_val(val: str) -> str:
82
+ if (val.startswith("'") and val.endswith("'")) or (
83
+ val.startswith('"') and val.endswith('"')
84
+ ):
85
+ return val[1:-1]
77
86
  return val if val != '""' and val != "''" else ""
78
87
 
79
88
  arg_map: Dict[str, str] = {}
@@ -81,12 +90,23 @@ def to_dict(arg: str) -> Dict[str, str]:
81
90
  if not arg:
82
91
  return arg_map
83
92
 
93
+ # find quoted values
94
+ quoted_pattern = r'([\'"])((?:\\.|(?!\1).)*?)\1'
95
+ quoted_values: List[str] = []
96
+
97
+ def replace_quoted(match):
98
+ quoted_values.append(match.group(0))
99
+ return f"__QUOTED_{len(quoted_values) - 1}__"
100
+
101
+ # replace quoted values with placeholders
102
+ processed_arg = re.sub(quoted_pattern, replace_quoted, arg)
103
+
84
104
  # split cfgs
85
105
  cfg_kv_delim = "="
86
106
 
87
107
  # ["FOO", "v1;v2,BAR", v3, "BAZ", "v4,v5"]
88
108
  split_arg = [
89
- s.strip() for s in arg.split(cfg_kv_delim) if s.strip()
109
+ s.strip() for s in processed_arg.split(cfg_kv_delim) if s.strip()
90
110
  ] # remove empty
91
111
  split_arg_len = len(split_arg)
92
112
 
@@ -98,10 +118,16 @@ def to_dict(arg: str) -> Dict[str, str]:
98
118
  # middle elements are value_{n}<delim>key_{n+1}
99
119
  for vk in split_arg[1 : split_arg_len - 1]: # python deals with
100
120
  val, key_next = parse_val_key(vk)
121
+ for i, quoted in enumerate(quoted_values):
122
+ val = val.replace(f"__QUOTED_{i}__", quoted)
101
123
  arg_map[key] = to_val(val)
102
124
  key = key_next
125
+
103
126
  val = split_arg[-1] # last element is always a value
127
+ for i, quoted in enumerate(quoted_values):
128
+ val = val.replace(f"__QUOTED_{i}__", quoted)
104
129
  arg_map[key] = to_val(val)
130
+
105
131
  return arg_map
106
132
 
107
133
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: torchx-nightly
3
- Version: 2025.5.5
3
+ Version: 2025.5.6
4
4
  Summary: TorchX SDK and Components
5
5
  Home-page: https://github.com/pytorch/torchx
6
6
  Author: TorchX Devs
@@ -74,7 +74,7 @@ torchx/schedulers/gcp_batch_scheduler.py,sha256=Noul_a01FGjDaa3ohAJbx_Pjhy4SN1TP
74
74
  torchx/schedulers/ids.py,sha256=3E-_vwVYC-8Tv8kjuY9-W7TbOe_-Laqd8a65uIN3hQY,1798
75
75
  torchx/schedulers/kubernetes_mcad_scheduler.py,sha256=-NHxKAW9bGnQ-4hpFhciZTlFJryPb3O_9oKv3f7MzuM,42954
76
76
  torchx/schedulers/kubernetes_scheduler.py,sha256=7AR3ccfta0NXqahxz9LVrv-vkdZnYTAHzw-sh_aLNDs,28242
77
- torchx/schedulers/local_scheduler.py,sha256=JMSGAO9RXeUiEz8BOTA_EnHDOd065oJ_tyV1E__m3OQ,41882
77
+ torchx/schedulers/local_scheduler.py,sha256=mH7kChaq34vYS4dhHaWxkucEHX1rr0__85rGKnyMRl4,41880
78
78
  torchx/schedulers/lsf_scheduler.py,sha256=e6BmJC6dNNNzzwATgJu5Sq4HxAPw_hI3EJFRojzAMlE,17690
79
79
  torchx/schedulers/ray_scheduler.py,sha256=9Sqesw3aOw_Z0gua2TY3aYE3OJ9MCi75hqVl_RUQwQY,15750
80
80
  torchx/schedulers/slurm_scheduler.py,sha256=RC1ze2w0oaoQDLgercW7yHz1rGv5FVB6em4HYbLmQRg,19434
@@ -110,14 +110,14 @@ torchx/util/modules.py,sha256=o4y_d07gTpJ4nIVBcoUVJ0JtXIHEsEC5kbgBM6NGpgA,2135
110
110
  torchx/util/session.py,sha256=r6M_nyzXgcbk1GgYGZ324F_ehRGCqjjdVk4YgKxMj8M,1214
111
111
  torchx/util/shlex.py,sha256=eXEKu8KC3zIcd8tEy9_s8Ds5oma8BORr-0VGWNpG2dk,463
112
112
  torchx/util/strings.py,sha256=GkLWCmYS89Uv6bWc5hH0XwvHy7oQmprv2U7axC4A2e8,678
113
- torchx/util/types.py,sha256=een55pV-N8aBc3qUBjHRc1llJcX10JVa19pB8dBE8No,7564
113
+ torchx/util/types.py,sha256=msyHky81Du45OEzIhbSK-U2zJQyOCTQhRdq1qaYA7Uo,8552
114
114
  torchx/workspace/__init__.py,sha256=FqN8AN4VhR1C_SBY10MggQvNZmyanbbuPuE-JCjkyUY,798
115
115
  torchx/workspace/api.py,sha256=PtDkGTC5lX03pRoYpuMz2KCmM1ZOycRP1UknqvNb97Y,6341
116
116
  torchx/workspace/dir_workspace.py,sha256=npNW_IjUZm_yS5r-8hrRkH46ndDd9a_eApT64m1S1T4,2268
117
117
  torchx/workspace/docker_workspace.py,sha256=PFu2KQNVC-0p2aKJ-W_BKA9ZOmXdCY2ABEkCExp3udQ,10269
118
- torchx_nightly-2025.5.5.dist-info/LICENSE,sha256=WVHfXhFC0Ia8LTKt_nJVYobdqTJVg_4J3Crrfm2A8KQ,1721
119
- torchx_nightly-2025.5.5.dist-info/METADATA,sha256=SsBkhLRjtxQfhMiApaqwM4eN21gogLf8cmRnH5BzhuY,6119
120
- torchx_nightly-2025.5.5.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
121
- torchx_nightly-2025.5.5.dist-info/entry_points.txt,sha256=T328AMXeKI3JZnnxfkEew2ZcMN1oQDtkXjMz7lkV-P4,169
122
- torchx_nightly-2025.5.5.dist-info/top_level.txt,sha256=pxew3bc2gsiViS0zADs0jb6kC5v8o_Yy_85fhHj_J1A,7
123
- torchx_nightly-2025.5.5.dist-info/RECORD,,
118
+ torchx_nightly-2025.5.6.dist-info/LICENSE,sha256=WVHfXhFC0Ia8LTKt_nJVYobdqTJVg_4J3Crrfm2A8KQ,1721
119
+ torchx_nightly-2025.5.6.dist-info/METADATA,sha256=fNxmCjAgfsVnL3kJ9QLGPd8r0bKNGoOj4rxRROS9hBs,6119
120
+ torchx_nightly-2025.5.6.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
121
+ torchx_nightly-2025.5.6.dist-info/entry_points.txt,sha256=T328AMXeKI3JZnnxfkEew2ZcMN1oQDtkXjMz7lkV-P4,169
122
+ torchx_nightly-2025.5.6.dist-info/top_level.txt,sha256=pxew3bc2gsiViS0zADs0jb6kC5v8o_Yy_85fhHj_J1A,7
123
+ torchx_nightly-2025.5.6.dist-info/RECORD,,