fal 1.45.0__py3-none-any.whl → 1.45.2__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.45.0'
32
- __version_tuple__ = version_tuple = (1, 45, 0)
31
+ __version__ = version = '1.45.2'
32
+ __version_tuple__ = version_tuple = (1, 45, 2)
33
33
 
34
34
  __commit_id__ = commit_id = None
fal/app.py CHANGED
@@ -27,6 +27,7 @@ from fal.api import (
27
27
  from fal.api import (
28
28
  function as fal_function,
29
29
  )
30
+ from fal.container import ContainerImage
30
31
  from fal.exceptions import FalServerlessException, RequestCancelledException
31
32
  from fal.logging import get_logger
32
33
  from fal.sdk import AuthModeLiteral
@@ -338,6 +339,8 @@ class App(BaseServable):
338
339
  concurrency_buffer: ClassVar[Optional[int]] = None
339
340
  concurrency_buffer_perc: ClassVar[Optional[int]] = None
340
341
  max_multiplexing: ClassVar[Optional[int]] = None
342
+ kind: ClassVar[Optional[str]] = None
343
+ image: ClassVar[Optional[ContainerImage]] = None
341
344
 
342
345
  isolate_channel: async_grpc.Channel | None = None
343
346
 
@@ -376,7 +379,13 @@ class App(BaseServable):
376
379
  if cls.max_multiplexing is not None:
377
380
  cls.host_kwargs["max_multiplexing"] = cls.max_multiplexing
378
381
 
379
- cls.app_name = getattr(cls, "app_name", app_name)
382
+ if cls.kind is not None:
383
+ cls.host_kwargs["kind"] = cls.kind
384
+
385
+ if cls.image is not None:
386
+ cls.host_kwargs["image"] = cls.image
387
+
388
+ cls.app_name = getattr(cls, "app_name") or app_name
380
389
 
381
390
  if cls.__init__ is not App.__init__:
382
391
  raise ValueError(
fal/file_sync.py CHANGED
@@ -266,9 +266,6 @@ class FileSync:
266
266
  files_context_dir: Optional[str] = None,
267
267
  ) -> Tuple[List[FileMetadata], List[AppFileUploadException]]:
268
268
  files = self.collect_files(paths, files_context_dir)
269
- existing_hashes: List[FileMetadata] = []
270
- uploaded_files: List[Tuple[FileMetadata, str]] = []
271
- errors: List[AppFileUploadException] = []
272
269
 
273
270
  # Filter out ignored files
274
271
  if files_ignore:
@@ -302,24 +299,23 @@ class FileSync:
302
299
  if rel_path not in seen_relative_paths:
303
300
  seen_relative_paths.add(rel_path)
304
301
 
305
- files_to_check: List[FileMetadata] = []
306
- for metadata in unique_files:
307
- files_to_check.append(metadata)
302
+ if not unique_files:
303
+ return [], []
308
304
 
309
- if not files_to_check:
310
- return existing_hashes, errors
311
-
312
- hashes_to_check = [metadata.hash for metadata in files_to_check]
313
- missing_hashes = self.check_hashes_on_server(hashes_to_check)
305
+ hashes_to_check = list({metadata.hash for metadata in unique_files})
306
+ missing_hashes = set(self.check_hashes_on_server(hashes_to_check))
314
307
 
315
308
  # Categorize based on server response
316
309
  files_to_upload: List[FileMetadata] = []
317
- for file in files_to_check:
318
- if file.hash not in missing_hashes:
319
- existing_hashes.append(file)
320
- else:
310
+ for file in unique_files:
311
+ if file.hash in missing_hashes:
312
+ # No longer missing as we are uploading it
313
+ # Removing it avoids duplicate uploads
314
+ missing_hashes.remove(file.hash)
321
315
  files_to_upload.append(file)
322
316
 
317
+ uploaded_files: List[Tuple[FileMetadata, str]] = []
318
+ errors: List[AppFileUploadException] = []
323
319
  # Upload missing files in parallel with bounded concurrency
324
320
  if files_to_upload:
325
321
  # Embed it here to be able to pass it to the executor
@@ -348,13 +344,11 @@ class FileSync:
348
344
  else:
349
345
  uploaded_files.append((metadata, future.result()))
350
346
 
351
- all_files = existing_hashes + [file for file, _ in uploaded_files]
352
-
353
347
  # TODO: hide behind DEBUG flag?
354
348
  console.print("File Structure:")
355
- print_path_tree([m.relative_path for m in all_files])
349
+ print_path_tree([m.relative_path for m in unique_files])
356
350
 
357
- return all_files, errors
351
+ return unique_files, errors
358
352
 
359
353
  def close(self):
360
354
  """Close HTTP client."""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fal
3
- Version: 1.45.0
3
+ Version: 1.45.2
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
@@ -1,14 +1,14 @@
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=Iyuh3mKHNPKuco4HwmcqY3zgtlmEPYk7IpRJMc1IzDw,706
3
+ fal/_fal_version.py,sha256=uGl76iyGOnR9pR6ih3-pGaeb2n85n9pl4b0PUmclDCI,706
4
4
  fal/_serialization.py,sha256=npXNsFJ5G7jzBeBIyVMH01Ww34mGY4XWhHpRbSrTtnQ,7598
5
5
  fal/_version.py,sha256=1BbTFnucNC_6ldKJ_ZoC722_UkW4S9aDBSW9L0fkKAw,2315
6
6
  fal/api.py,sha256=tW3B4AbprSnpKDtGb_mjUwUwImd9VaaxUpMtS0f45ks,51860
7
- fal/app.py,sha256=Ntfdpfv3L92U3ZcIaD_SiR2N8_epQrkChx8uaizHLF4,27737
7
+ fal/app.py,sha256=izlqdqfUtNxKW6oJerJYbVaUIZwxlO-DTtqFrcTleyI,28039
8
8
  fal/apps.py,sha256=pzCd2mrKl5J_4oVc40_pggvPtFahXBCdrZXWpnaEJVs,12130
9
9
  fal/config.py,sha256=1HRaOJFOAjB7fbQoEPCSH85gMvEEMIMPeupVWgrHVgU,3572
10
10
  fal/container.py,sha256=FTsa5hOW4ars-yV1lUoc0BNeIIvAZcpw7Ftyt3A4m_w,2000
11
- fal/file_sync.py,sha256=Ql8mB5tb-qz8z-IK3QmhD_bxWrx2tay8bLdeykzPIr8,12143
11
+ fal/file_sync.py,sha256=fZNZARPaqGH3sLaBXDsUPTnvi26d0r9NnHGysvPc6GE,11977
12
12
  fal/files.py,sha256=9hA7mC3Xm794I-P2_YMf0QRebrnBIDz_kUnUd4O3BiQ,7904
13
13
  fal/flags.py,sha256=QonyDM7R2GqfAB1bJr46oriu-fHJCkpUwXuSdanePWg,987
14
14
  fal/project.py,sha256=QgfYfMKmNobMPufrAP_ga1FKcIAlSbw18Iar1-0qepo,2650
@@ -144,8 +144,8 @@ openapi_fal_rest/models/workflow_node_type.py,sha256=-FzyeY2bxcNmizKbJI8joG7byRi
144
144
  openapi_fal_rest/models/workflow_schema.py,sha256=4K5gsv9u9pxx2ItkffoyHeNjBBYf6ur5bN4m_zePZNY,2019
145
145
  openapi_fal_rest/models/workflow_schema_input.py,sha256=2OkOXWHTNsCXHWS6EGDFzcJKkW5FIap-2gfO233EvZQ,1191
146
146
  openapi_fal_rest/models/workflow_schema_output.py,sha256=EblwSPAGfWfYVWw_WSSaBzQVju296is9o28rMBAd0mc,1196
147
- fal-1.45.0.dist-info/METADATA,sha256=oG5qxrix4DW0h88XDtBkETxo6Y1BO4eZiL-rYDF5DJA,4185
148
- fal-1.45.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
149
- fal-1.45.0.dist-info/entry_points.txt,sha256=32zwTUC1U1E7nSTIGCoANQOQ3I7-qHG5wI6gsVz5pNU,37
150
- fal-1.45.0.dist-info/top_level.txt,sha256=r257X1L57oJL8_lM0tRrfGuXFwm66i1huwQygbpLmHw,21
151
- fal-1.45.0.dist-info/RECORD,,
147
+ fal-1.45.2.dist-info/METADATA,sha256=vdkWyqP3ZEkcT94FXCb9pMvbVeZX0IRvuwufEoMPltc,4185
148
+ fal-1.45.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
149
+ fal-1.45.2.dist-info/entry_points.txt,sha256=32zwTUC1U1E7nSTIGCoANQOQ3I7-qHG5wI6gsVz5pNU,37
150
+ fal-1.45.2.dist-info/top_level.txt,sha256=r257X1L57oJL8_lM0tRrfGuXFwm66i1huwQygbpLmHw,21
151
+ fal-1.45.2.dist-info/RECORD,,
File without changes