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

torchx/specs/builders.py CHANGED
@@ -4,7 +4,7 @@
4
4
  # This source code is licensed under the BSD-style license found in the
5
5
  # LICENSE file in the root directory of this source tree.
6
6
 
7
- # pyre-strict
7
+ # pyre-unsafe
8
8
 
9
9
  import argparse
10
10
  import inspect
@@ -39,7 +39,7 @@ def _create_args_parser(
39
39
 
40
40
 
41
41
  def _create_args_parser_from_parameters(
42
- cmpnt_fn: Callable[..., Any], # pyre-ignore[2]
42
+ cmpnt_fn: Callable[..., AppDef],
43
43
  parameters: Mapping[str, inspect.Parameter],
44
44
  cmpnt_defaults: Optional[Dict[str, str]] = None,
45
45
  config: Optional[Dict[str, Any]] = None,
@@ -120,7 +120,7 @@ def _merge_config_values_with_args(
120
120
 
121
121
 
122
122
  def parse_args(
123
- cmpnt_fn: Callable[..., Any], # pyre-ignore[2]
123
+ cmpnt_fn: Callable[..., AppDef],
124
124
  cmpnt_args: List[str],
125
125
  cmpnt_defaults: Optional[Dict[str, Any]] = None,
126
126
  config: Optional[Dict[str, Any]] = None,
@@ -149,7 +149,7 @@ def parse_args(
149
149
 
150
150
 
151
151
  def component_args_from_str(
152
- cmpnt_fn: Callable[..., Any], # pyre-fixme[2]: Enforce AppDef type
152
+ cmpnt_fn: Callable[..., AppDef],
153
153
  cmpnt_args: list[str],
154
154
  cmpnt_args_defaults: Optional[Dict[str, Any]] = None,
155
155
  config: Optional[Dict[str, Any]] = None,
@@ -238,7 +238,7 @@ def component_args_from_str(
238
238
 
239
239
 
240
240
  def materialize_appdef(
241
- cmpnt_fn: Callable[..., Any], # pyre-ignore[2]
241
+ cmpnt_fn: Callable[..., AppDef],
242
242
  cmpnt_args: List[str],
243
243
  cmpnt_defaults: Optional[Dict[str, Any]] = None,
244
244
  config: Optional[Dict[str, Any]] = None,
torchx/specs/finder.py CHANGED
@@ -17,7 +17,9 @@ from dataclasses import dataclass
17
17
  from inspect import getmembers, isfunction
18
18
  from pathlib import Path
19
19
  from types import ModuleType
20
- from typing import Any, Callable, Dict, Generator, List, Optional, Union
20
+ from typing import Callable, Dict, Generator, List, Optional, Union
21
+
22
+ from torchx.specs import AppDef
21
23
 
22
24
  from torchx.specs.file_linter import (
23
25
  ComponentFunctionValidator,
@@ -59,8 +61,7 @@ class _Component:
59
61
  description: str
60
62
  fn_name: str
61
63
 
62
- # pyre-ignore[4] TODO temporary until PipelineDef is decoupled and can be exposed as type to OSS
63
- fn: Callable[..., Any]
64
+ fn: Callable[..., AppDef]
64
65
 
65
66
  validation_errors: List[str]
66
67
 
torchx/util/types.py CHANGED
@@ -8,6 +8,7 @@
8
8
 
9
9
  import inspect
10
10
  import re
11
+ from types import UnionType
11
12
  from typing import Any, Callable, Optional, Tuple, TypeVar, Union
12
13
 
13
14
 
@@ -234,10 +235,20 @@ def decode_optional(param_type: Any) -> Any:
234
235
  If ``param_type`` is type Optional[INNER_TYPE], method returns INNER_TYPE
235
236
  Otherwise returns ``param_type``
236
237
  """
238
+
237
239
  if not hasattr(param_type, "__origin__"):
238
- return param_type
240
+ if isinstance(param_type, UnionType):
241
+ # handle BinOp style Optional (e.g. `T | None`)
242
+ if len(param_type.__args__) == 2 and param_type.__args__[1] is type(None):
243
+ return param_type.__args__[0]
244
+ else:
245
+ return param_type
246
+ else:
247
+ return param_type
248
+
239
249
  if param_type.__origin__ is not Union:
240
250
  return param_type
251
+
241
252
  args = param_type.__args__
242
253
  if len(args) == 2 and args[1] is type(None):
243
254
  return args[0]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: torchx-nightly
3
- Version: 2025.9.19
3
+ Version: 2025.9.21
4
4
  Summary: TorchX SDK and Components
5
5
  Home-page: https://github.com/pytorch/torchx
6
6
  Author: TorchX Devs
@@ -72,9 +72,9 @@ torchx/schedulers/slurm_scheduler.py,sha256=vZt102OxuTGj0ZE-V9dWbldtOyL2VbHcxADm
72
72
  torchx/schedulers/streams.py,sha256=8_SLezgnWgfv_zXUsJCUM34-h2dtv25NmZuxEwkzmxw,2007
73
73
  torchx/specs/__init__.py,sha256=HU7OoXs7aBBi0IenB49QIONRzoG1Ovs1Qlm9KnsvqfE,6609
74
74
  torchx/specs/api.py,sha256=Rzv_Yx8yyseARbC928ZvqAZbvaXhJRDAbcyPsxiblF4,41543
75
- torchx/specs/builders.py,sha256=aozVl4q3h0mY5DDJCY1M1CyLC9SW66KJy8JIih8bZJo,13810
75
+ torchx/specs/builders.py,sha256=Ye3of4MupJ-da8vLaX6_-nzGo_FRw1BFpYsX6dAZCNk,13730
76
76
  torchx/specs/file_linter.py,sha256=6_aoeuS5d9UwXseKKfPgWNTwxj-f7G1i3uO9mQepti4,14402
77
- torchx/specs/finder.py,sha256=FcB6jQTNwnpc4OMV0F349kk0leu6O7JYjH_GW2d6GXE,17503
77
+ torchx/specs/finder.py,sha256=KbtyQ2ZUIgg4vgIUdmvAis7es5CCnLtdbvxdusWkv3c,17433
78
78
  torchx/specs/named_resources_aws.py,sha256=ISjHtifRJqB8u7PeAMiyLyO_S0WCaZiK-CFF3qe6JDU,11415
79
79
  torchx/specs/named_resources_generic.py,sha256=Sg4tAdqiiWDrDz2Lj_pnfsjzGIXKTou73wPseh6j55w,2646
80
80
  torchx/specs/test/components/__init__.py,sha256=J8qjUOysmcMAek2KFN13mViOXZxTYc5vCrF02t3VuFU,223
@@ -98,14 +98,14 @@ torchx/util/modules.py,sha256=o4y_d07gTpJ4nIVBcoUVJ0JtXIHEsEC5kbgBM6NGpgA,2135
98
98
  torchx/util/session.py,sha256=r6M_nyzXgcbk1GgYGZ324F_ehRGCqjjdVk4YgKxMj8M,1214
99
99
  torchx/util/shlex.py,sha256=eXEKu8KC3zIcd8tEy9_s8Ds5oma8BORr-0VGWNpG2dk,463
100
100
  torchx/util/strings.py,sha256=GkLWCmYS89Uv6bWc5hH0XwvHy7oQmprv2U7axC4A2e8,678
101
- torchx/util/types.py,sha256=xelu9gOUQ540GvvzDqk1wYb4csB09OgYQJwlVz62O5o,8889
101
+ torchx/util/types.py,sha256=E9dxAWQnsJkIDuHtg-poeOJ4etucSI_xP_Z5kNJX8uI,9229
102
102
  torchx/workspace/__init__.py,sha256=cZsKVvUWwDYcGhe6SCXQGBQfbk_yTnKEImOkI6xmu30,809
103
103
  torchx/workspace/api.py,sha256=Ct_75VU94fsH9Rf1WRe-wJGpVgl5O05S_Dq_t2ArJWA,11348
104
104
  torchx/workspace/dir_workspace.py,sha256=npNW_IjUZm_yS5r-8hrRkH46ndDd9a_eApT64m1S1T4,2268
105
105
  torchx/workspace/docker_workspace.py,sha256=PFu2KQNVC-0p2aKJ-W_BKA9ZOmXdCY2ABEkCExp3udQ,10269
106
- torchx_nightly-2025.9.19.dist-info/LICENSE,sha256=WVHfXhFC0Ia8LTKt_nJVYobdqTJVg_4J3Crrfm2A8KQ,1721
107
- torchx_nightly-2025.9.19.dist-info/METADATA,sha256=4S3QpZtzHIUqC2VdZK_czPBhOWnQHdbTvjhFyAdE94s,5693
108
- torchx_nightly-2025.9.19.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
109
- torchx_nightly-2025.9.19.dist-info/entry_points.txt,sha256=T328AMXeKI3JZnnxfkEew2ZcMN1oQDtkXjMz7lkV-P4,169
110
- torchx_nightly-2025.9.19.dist-info/top_level.txt,sha256=pxew3bc2gsiViS0zADs0jb6kC5v8o_Yy_85fhHj_J1A,7
111
- torchx_nightly-2025.9.19.dist-info/RECORD,,
106
+ torchx_nightly-2025.9.21.dist-info/LICENSE,sha256=WVHfXhFC0Ia8LTKt_nJVYobdqTJVg_4J3Crrfm2A8KQ,1721
107
+ torchx_nightly-2025.9.21.dist-info/METADATA,sha256=0KvbX8m2uQZVgOBL_JiKB8nVyXDWBCVFRAypM61NWQU,5693
108
+ torchx_nightly-2025.9.21.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
109
+ torchx_nightly-2025.9.21.dist-info/entry_points.txt,sha256=T328AMXeKI3JZnnxfkEew2ZcMN1oQDtkXjMz7lkV-P4,169
110
+ torchx_nightly-2025.9.21.dist-info/top_level.txt,sha256=pxew3bc2gsiViS0zADs0jb6kC5v8o_Yy_85fhHj_J1A,7
111
+ torchx_nightly-2025.9.21.dist-info/RECORD,,