fal 1.9.3__py3-none-any.whl → 1.9.4__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
@@ -17,5 +17,5 @@ __version__: str
17
17
  __version_tuple__: VERSION_TUPLE
18
18
  version_tuple: VERSION_TUPLE
19
19
 
20
- __version__ = version = '1.9.3'
21
- __version_tuple__ = version_tuple = (1, 9, 3)
20
+ __version__ = version = '1.9.4'
21
+ __version_tuple__ = version_tuple = (1, 9, 4)
fal/cli/profile.py CHANGED
@@ -26,6 +26,10 @@ def _set(args):
26
26
  config.set_internal("profile", args.PROFILE)
27
27
  args.console.print(f"Default profile set to [cyan]{args.PROFILE}[/].")
28
28
  config.profile = args.PROFILE
29
+ if not config.get("key"):
30
+ args.console.print(
31
+ "No key set for profile. Use [bold]fal profile key[/] to set a key."
32
+ )
29
33
  config.save()
30
34
 
31
35
 
@@ -39,8 +43,16 @@ def _unset(args):
39
43
 
40
44
  def _key_set(args):
41
45
  config = Config()
42
- key_id, key_secret = args.KEY.split(":", 1)
43
- config.set("key", f"{key_id}:{key_secret}")
46
+
47
+ while True:
48
+ key = input("Enter the key: ")
49
+ if ":" in key:
50
+ break
51
+ args.console.print(
52
+ "[red]Invalid key. The key must be in the format [bold]key:value[/].[/]"
53
+ )
54
+
55
+ config.set("key", key)
44
56
  args.console.print(f"Key set for profile [cyan]{config.profile}[/].")
45
57
  config.save()
46
58
 
@@ -109,10 +121,6 @@ def add_parser(main_subparsers, parents):
109
121
  help=key_set_help,
110
122
  parents=parents,
111
123
  )
112
- key_set_parser.add_argument(
113
- "KEY",
114
- help="Key ID and secret separated by a colon.",
115
- )
116
124
  key_set_parser.set_defaults(func=_key_set)
117
125
 
118
126
  delete_help = "Delete profile."
@@ -125,7 +125,9 @@ LIFECYCLE_PREFERENCE: VariableReference[dict[str, str] | None] = VariableReferen
125
125
  @dataclass
126
126
  class FalFileRepositoryBase(FileRepository):
127
127
  @retry(max_retries=3, base_delay=1, backoff_type="exponential", jitter=True)
128
- def _save(self, file: FileData, storage_type: str) -> str:
128
+ def _save(
129
+ self, file: FileData, storage_type: str, headers: dict[str, str] | None = None
130
+ ) -> str:
129
131
  key_creds = key_credentials()
130
132
  if not key_creds:
131
133
  raise FileUploadException("FAL_KEY must be set")
@@ -135,6 +137,7 @@ class FalFileRepositoryBase(FileRepository):
135
137
  "Authorization": f"Key {key_id}:{key_secret}",
136
138
  "Accept": "application/json",
137
139
  "Content-Type": "application/json",
140
+ **(headers or {}),
138
141
  }
139
142
 
140
143
  grpc_host = os.environ.get("FAL_HOST", "api.alpha.fal.ai")
@@ -193,7 +196,11 @@ class FalFileRepository(FalFileRepositoryBase):
193
196
  multipart_max_concurrency: int | None = None,
194
197
  object_lifecycle_preference: dict[str, str] | None = None,
195
198
  ) -> str:
196
- return self._save(file, "gcs")
199
+ headers = {}
200
+ if object_lifecycle_preference:
201
+ headers["X-Fal-Object-Lifecycle"] = json.dumps(object_lifecycle_preference)
202
+
203
+ return self._save(file, "gcs", headers=headers)
197
204
 
198
205
 
199
206
  class MultipartUpload:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: fal
3
- Version: 1.9.3
3
+ Version: 1.9.4
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,6 +1,6 @@
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=9iRyJjXIu4ospHHgY6jThnBbx_i0E46WrhiFzzJdLrE,511
3
+ fal/_fal_version.py,sha256=x_dqnWSuZ5m1DFc2qnANNI5KdLpU51P41kIYXxibols,511
4
4
  fal/_serialization.py,sha256=rD2YiSa8iuzCaZohZwN_MPEB-PpSKbWRDeaIDpTEjyY,7653
5
5
  fal/_version.py,sha256=EBGqrknaf1WygENX-H4fBefLvHryvJBBGtVJetaB0NY,266
6
6
  fal/api.py,sha256=i6HnL4sJtwv34N9T5uzXSgwetBLMVJye57CHmdq5m78,43998
@@ -30,7 +30,7 @@ fal/cli/doctor.py,sha256=U4ne9LX5gQwNblsYQ27XdO8AYDgbYjTO39EtxhwexRM,983
30
30
  fal/cli/keys.py,sha256=trDpA3LJu9S27qE_K8Hr6fKLK4vwVzbxUHq8TFrV4pw,3157
31
31
  fal/cli/main.py,sha256=EPqG-Pp71RKkPUHv5QSb8_gWQ1DT8-OdUDNSN1h-TSk,2132
32
32
  fal/cli/parser.py,sha256=edCqFWYAQSOhrxeEK9BtFRlTEUAlG2JUDjS_vhZ_nHE,2868
33
- fal/cli/profile.py,sha256=16uwIHlWLa8G89GDaEUQ9-Y9ao7YQCtjLhGrkh94M_k,3129
33
+ fal/cli/profile.py,sha256=OplQgs8UGQzBH7_BnG0GBMYNQ8jtPnzzX8Q1FM3Y-5s,3320
34
34
  fal/cli/run.py,sha256=nAC12Qss4Fg1XmV0qOS9RdGNLYcdoHeRgQMvbTN4P9I,1202
35
35
  fal/cli/runners.py,sha256=5pXuKq7nSkf0VpnppNnvxwP8XDq0SWkc6mkfizDwWMQ,1046
36
36
  fal/cli/secrets.py,sha256=740msFm7d41HruudlcfqUXlFl53N-WmChsQP9B9M9Po,2572
@@ -53,7 +53,7 @@ fal/toolkit/types.py,sha256=kkbOsDKj1qPGb1UARTBp7yuJ5JUuyy7XQurYUBCdti8,4064
53
53
  fal/toolkit/file/__init__.py,sha256=FbNl6wD-P0aSSTUwzHt4HujBXrbC3ABmaigPQA4hRfg,70
54
54
  fal/toolkit/file/file.py,sha256=Kb-mdR66OiSNTS2EGLLJYUqnAw-KN7diqhxvjS7EAZ0,9353
55
55
  fal/toolkit/file/types.py,sha256=MMAH_AyLOhowQPesOv1V25wB4qgbJ3vYNlnTPbdSv1M,2304
56
- fal/toolkit/file/providers/fal.py,sha256=XH5nPwnFGklWKtecfmWeaPGUwpR4mXmvESikQ5_FBjw,36918
56
+ fal/toolkit/file/providers/fal.py,sha256=j3g63b7ywUuTcesZD86WXSnn8Vuv-Lw5td3zSwHUmRw,37169
57
57
  fal/toolkit/file/providers/gcp.py,sha256=DKeZpm1MjwbvEsYvkdXUtuLIJDr_UNbqXj_Mfv3NTeo,2437
58
58
  fal/toolkit/file/providers/r2.py,sha256=YqnYkkAo_ZKIa-xoSuDnnidUFwJWHdziAR34PE6irdI,3061
59
59
  fal/toolkit/file/providers/s3.py,sha256=EI45T54Mox7lHZKROss_O8o0DIn3CHP9k1iaNYVrxvg,2714
@@ -131,8 +131,8 @@ openapi_fal_rest/models/workflow_node_type.py,sha256=-FzyeY2bxcNmizKbJI8joG7byRi
131
131
  openapi_fal_rest/models/workflow_schema.py,sha256=4K5gsv9u9pxx2ItkffoyHeNjBBYf6ur5bN4m_zePZNY,2019
132
132
  openapi_fal_rest/models/workflow_schema_input.py,sha256=2OkOXWHTNsCXHWS6EGDFzcJKkW5FIap-2gfO233EvZQ,1191
133
133
  openapi_fal_rest/models/workflow_schema_output.py,sha256=EblwSPAGfWfYVWw_WSSaBzQVju296is9o28rMBAd0mc,1196
134
- fal-1.9.3.dist-info/METADATA,sha256=5y7_V3EqnNBq7z7JTsctaIxwmSV8baUclYoqTh2Cb8U,4042
135
- fal-1.9.3.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
136
- fal-1.9.3.dist-info/entry_points.txt,sha256=32zwTUC1U1E7nSTIGCoANQOQ3I7-qHG5wI6gsVz5pNU,37
137
- fal-1.9.3.dist-info/top_level.txt,sha256=r257X1L57oJL8_lM0tRrfGuXFwm66i1huwQygbpLmHw,21
138
- fal-1.9.3.dist-info/RECORD,,
134
+ fal-1.9.4.dist-info/METADATA,sha256=YCKQIxk6JFhLAXYRTUqaWcGUDu4pqN1UIJ9n2liGjtE,4042
135
+ fal-1.9.4.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
136
+ fal-1.9.4.dist-info/entry_points.txt,sha256=32zwTUC1U1E7nSTIGCoANQOQ3I7-qHG5wI6gsVz5pNU,37
137
+ fal-1.9.4.dist-info/top_level.txt,sha256=r257X1L57oJL8_lM0tRrfGuXFwm66i1huwQygbpLmHw,21
138
+ fal-1.9.4.dist-info/RECORD,,
File without changes