fal 1.33.0__py3-none-any.whl → 1.34.1__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 fal might be problematic. Click here for more details.

fal/_fal_version.py CHANGED
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
28
28
  commit_id: COMMIT_ID
29
29
  __commit_id__: COMMIT_ID
30
30
 
31
- __version__ = version = '1.33.0'
32
- __version_tuple__ = version_tuple = (1, 33, 0)
31
+ __version__ = version = '1.34.1'
32
+ __version_tuple__ = version_tuple = (1, 34, 1)
33
33
 
34
34
  __commit_id__ = commit_id = None
fal/api.py CHANGED
@@ -96,7 +96,12 @@ class InternalFalServerlessError(FalServerlessException):
96
96
 
97
97
 
98
98
  @dataclass
99
- class FalMissingDependencyError(FalServerlessError): ...
99
+ class FalSerializationError(FalServerlessException):
100
+ message: str
101
+
102
+
103
+ @dataclass
104
+ class FalMissingDependencyError(FalSerializationError): ...
100
105
 
101
106
 
102
107
  @dataclass
@@ -316,6 +321,8 @@ def _handle_grpc_error():
316
321
  """
317
322
  Wraps grpc errors as fal Serverless Errors.
318
323
  """
324
+ from isolate.connections.common import SerializationError
325
+
319
326
  try:
320
327
  return fn(*args, **kwargs)
321
328
  except grpc.RpcError as e:
@@ -339,6 +346,18 @@ def _handle_grpc_error():
339
346
  raise FalMissingDependencyError(msg) from None
340
347
  else:
341
348
  raise FalServerlessError(msg)
349
+ except SerializationError as e:
350
+ msg = str(e)
351
+ cause = e.__cause__
352
+ if isinstance(cause, ModuleNotFoundError):
353
+ missing_module = cause.name
354
+ msg += (
355
+ f". Could not find module '{missing_module}'. "
356
+ "This is likely due to a missing dependency. "
357
+ "Please make sure to include all dependencies "
358
+ "in the environment configuration."
359
+ )
360
+ raise FalSerializationError(msg) from cause
342
361
 
343
362
  return handler
344
363
 
fal/cli/debug.py CHANGED
@@ -1,3 +1,4 @@
1
+ import argparse
1
2
  from contextlib import ExitStack, contextmanager
2
3
 
3
4
  from .parser import FalParser
@@ -45,17 +46,23 @@ def debugtools(args):
45
46
 
46
47
 
47
48
  def get_debug_parser():
49
+ from fal.flags import DEBUG
50
+
48
51
  parser = FalParser(add_help=False)
49
52
  group = parser.add_argument_group(title="Debug")
50
- group.add_argument("--debug", action="store_true", help="Show verbose errors.")
53
+ group.add_argument(
54
+ "--debug",
55
+ action="store_true",
56
+ help="Show verbose errors." if DEBUG else argparse.SUPPRESS,
57
+ )
51
58
  group.add_argument(
52
59
  "--pdb",
53
60
  action="store_true",
54
- help="Start pdb on error.",
61
+ help="Start pdb on error." if DEBUG else argparse.SUPPRESS,
55
62
  )
56
63
  group.add_argument(
57
64
  "--cprofile",
58
65
  action="store_true",
59
- help="Show cProfile report.",
66
+ help="Show cProfile report." if DEBUG else argparse.SUPPRESS,
60
67
  )
61
68
  return parser
fal/cli/main.py CHANGED
@@ -113,7 +113,7 @@ def _check_latest_version():
113
113
  def main(argv=None) -> int:
114
114
  import grpc
115
115
 
116
- from fal.api import UserFunctionException
116
+ from fal.api import FalSerializationError, UserFunctionException
117
117
 
118
118
  _check_latest_version()
119
119
 
@@ -123,7 +123,7 @@ def main(argv=None) -> int:
123
123
 
124
124
  with debugtools(args):
125
125
  ret = args.func(args)
126
- except UserFunctionException as _exc:
126
+ except (UserFunctionException, FalSerializationError) as _exc:
127
127
  cause = _exc.__cause__
128
128
  exc: BaseException = cause or _exc
129
129
  tb = rich.traceback.Traceback.from_exception(
@@ -132,7 +132,12 @@ def main(argv=None) -> int:
132
132
  exc.__traceback__,
133
133
  )
134
134
  console.print(tb)
135
- _print_error("Unhandled user exception")
135
+
136
+ if isinstance(_exc, UserFunctionException):
137
+ msg = "Unhandled user exception"
138
+ else:
139
+ msg = str(_exc)
140
+ _print_error(msg)
136
141
  except KeyboardInterrupt:
137
142
  _print_error("Aborted.")
138
143
  except grpc.RpcError as exc:
fal/console/__init__.py CHANGED
@@ -3,4 +3,4 @@ from __future__ import annotations
3
3
  from rich.console import Console
4
4
  from rich.theme import Theme
5
5
 
6
- console = Console(theme=Theme())
6
+ console = Console(theme=Theme(), soft_wrap=True)
@@ -1,11 +1,11 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fal
3
- Version: 1.33.0
3
+ Version: 1.34.1
4
4
  Summary: fal is an easy-to-use Serverless Python Framework
5
5
  Author: Features & Labels <support@fal.ai>
6
6
  Requires-Python: >=3.8
7
7
  Description-Content-Type: text/markdown
8
- Requires-Dist: isolate[build]<0.19.0,>=0.18.0
8
+ Requires-Dist: isolate[build]<0.20.0,>=0.18.0
9
9
  Requires-Dist: isolate-proto<0.13.0,>=0.12.0
10
10
  Requires-Dist: grpcio<2,>=1.64.0
11
11
  Requires-Dist: dill==0.3.7
@@ -1,9 +1,9 @@
1
1
  fal/__init__.py,sha256=wXs1G0gSc7ZK60-bHe-B2m0l_sA6TrFk4BxY0tMoLe8,784
2
2
  fal/__main__.py,sha256=4JMK66Wj4uLZTKbF-sT3LAxOsr6buig77PmOkJCRRxw,83
3
- fal/_fal_version.py,sha256=TGqBGWQP93vQ0BN8eWLmRJjMlpGU3SGnIP7uJpCanKk,706
3
+ fal/_fal_version.py,sha256=_uFZOGJT5QOxIS3G6xTkuI1YrjygA21ddyfaiP_UFpc,706
4
4
  fal/_serialization.py,sha256=npXNsFJ5G7jzBeBIyVMH01Ww34mGY4XWhHpRbSrTtnQ,7598
5
5
  fal/_version.py,sha256=1BbTFnucNC_6ldKJ_ZoC722_UkW4S9aDBSW9L0fkKAw,2315
6
- fal/api.py,sha256=U0Le4aqG4ikiNC9_I9Tn7IZkSXVG_FguY_qx95VNcvY,48485
6
+ fal/api.py,sha256=oWSPxefwyYF93s54mtyYGKWYMax9ll9B-wxijOyARb4,49244
7
7
  fal/app.py,sha256=sSWr2pPjaTSJbKuhwp5gCjLEnoumjto08KBNzzGY8og,25978
8
8
  fal/apps.py,sha256=pzCd2mrKl5J_4oVc40_pggvPtFahXBCdrZXWpnaEJVs,12130
9
9
  fal/config.py,sha256=1HRaOJFOAjB7fbQoEPCSH85gMvEEMIMPeupVWgrHVgU,3572
@@ -27,19 +27,19 @@ fal/cli/apps.py,sha256=pty0v0RIihCeKl1xG9NWIUMTWGhGUJf452x58EfBL-M,11242
27
27
  fal/cli/auth.py,sha256=Qe-Z3ycXJnOzHimz5PjCQYoni8MF4csmdL19yGN7a1o,5171
28
28
  fal/cli/cli_nested_json.py,sha256=veSZU8_bYV3Iu1PAoxt-4BMBraNIqgH5nughbs2UKvE,13539
29
29
  fal/cli/create.py,sha256=a8WDq-nJLFTeoIXqpb5cr7GR7YR9ZZrQCawNm34KXXE,627
30
- fal/cli/debug.py,sha256=u_urnyFzSlNnrq93zz_GXE9FX4VyVxDoamJJyrZpFI0,1312
30
+ fal/cli/debug.py,sha256=mTCjSpEZaNKcX225VZtry-BspFKSHURUuxUFuX6x5Cc,1488
31
31
  fal/cli/deploy.py,sha256=JAUi9FtN58pGk3_2JPd84h-RKurLatRjAUxL_Oe0vWo,8701
32
32
  fal/cli/doctor.py,sha256=U4ne9LX5gQwNblsYQ27XdO8AYDgbYjTO39EtxhwexRM,983
33
33
  fal/cli/files.py,sha256=-j0q4g53A7CWSczGLdfeUCTSd4zXoV3pfZFdman7JOw,3450
34
34
  fal/cli/keys.py,sha256=7Sf4DT4le89G42eAOt0ltRjbZAtE70AVQ62hmjZhUy0,3059
35
- fal/cli/main.py,sha256=LnJCe83Fdr5-i3Fkpvrd9BZPjHtcX_H1EEmy6rVlCz8,3180
35
+ fal/cli/main.py,sha256=s_LxEyz9z64dewk3oiGEI33_h3vJ3IVdu8aY3qydkMo,3345
36
36
  fal/cli/parser.py,sha256=jYsGQ0BLQuKI7KtN1jnLVYKMbLtez7hPjwTNfG3UPSk,2964
37
37
  fal/cli/profile.py,sha256=agyGFQRLHOtzJEdN3Pn9317rg044XaszNCZrf0ELK-8,6016
38
38
  fal/cli/run.py,sha256=nAC12Qss4Fg1XmV0qOS9RdGNLYcdoHeRgQMvbTN4P9I,1202
39
39
  fal/cli/runners.py,sha256=4knYZLG5WagdHoBUpjVsh_8BXHebU_rAtlRyRmJDZWI,3976
40
40
  fal/cli/secrets.py,sha256=QKSmazu-wiNF6fOpGL9v2TDYxAjX9KTi7ot7vnv6f5E,2474
41
41
  fal/cli/teams.py,sha256=6fR2rKJtiUJPThP7QsO4NLo9UdhUxraGvQZk3_Di6Ow,1218
42
- fal/console/__init__.py,sha256=ernZ4bzvvliQh5SmrEqQ7lA5eVcbw6Ra2jalKtA7dxg,132
42
+ fal/console/__init__.py,sha256=lGPUuTqIM9IKTa1cyyA-MA2iZJKVHp2YydsITZVlb6g,148
43
43
  fal/console/icons.py,sha256=De9MfFaSkO2Lqfne13n3PrYfTXJVIzYZVqYn5BWsdrA,108
44
44
  fal/console/ux.py,sha256=KMQs3UHQvVHDxDQQqlot-WskVKoMQXOE3jiVkkfmIMY,356
45
45
  fal/exceptions/__init__.py,sha256=m2okJEpax11mnwmoqO_pCGtbt-FvzKiiuMhKo2ok-_8,270
@@ -143,8 +143,8 @@ openapi_fal_rest/models/workflow_node_type.py,sha256=-FzyeY2bxcNmizKbJI8joG7byRi
143
143
  openapi_fal_rest/models/workflow_schema.py,sha256=4K5gsv9u9pxx2ItkffoyHeNjBBYf6ur5bN4m_zePZNY,2019
144
144
  openapi_fal_rest/models/workflow_schema_input.py,sha256=2OkOXWHTNsCXHWS6EGDFzcJKkW5FIap-2gfO233EvZQ,1191
145
145
  openapi_fal_rest/models/workflow_schema_output.py,sha256=EblwSPAGfWfYVWw_WSSaBzQVju296is9o28rMBAd0mc,1196
146
- fal-1.33.0.dist-info/METADATA,sha256=KbtxDDEpgfBIdjY2wTGdPoyqiS0VqWF-nbWhJU7obpI,4054
147
- fal-1.33.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
148
- fal-1.33.0.dist-info/entry_points.txt,sha256=32zwTUC1U1E7nSTIGCoANQOQ3I7-qHG5wI6gsVz5pNU,37
149
- fal-1.33.0.dist-info/top_level.txt,sha256=r257X1L57oJL8_lM0tRrfGuXFwm66i1huwQygbpLmHw,21
150
- fal-1.33.0.dist-info/RECORD,,
146
+ fal-1.34.1.dist-info/METADATA,sha256=5Nk8HfYsuGmwVbGCV_5CFBCBMwXhb9dQgp9k42Nz2eE,4054
147
+ fal-1.34.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
148
+ fal-1.34.1.dist-info/entry_points.txt,sha256=32zwTUC1U1E7nSTIGCoANQOQ3I7-qHG5wI6gsVz5pNU,37
149
+ fal-1.34.1.dist-info/top_level.txt,sha256=r257X1L57oJL8_lM0tRrfGuXFwm66i1huwQygbpLmHw,21
150
+ fal-1.34.1.dist-info/RECORD,,
File without changes