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 +2 -2
- fal/cli/profile.py +14 -6
- fal/toolkit/file/providers/fal.py +9 -2
- {fal-1.9.3.dist-info → fal-1.9.4.dist-info}/METADATA +1 -1
- {fal-1.9.3.dist-info → fal-1.9.4.dist-info}/RECORD +8 -8
- {fal-1.9.3.dist-info → fal-1.9.4.dist-info}/WHEEL +0 -0
- {fal-1.9.3.dist-info → fal-1.9.4.dist-info}/entry_points.txt +0 -0
- {fal-1.9.3.dist-info → fal-1.9.4.dist-info}/top_level.txt +0 -0
fal/_fal_version.py
CHANGED
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
|
-
|
|
43
|
-
|
|
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(
|
|
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
|
-
|
|
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
|
fal/__init__.py,sha256=wXs1G0gSc7ZK60-bHe-B2m0l_sA6TrFk4BxY0tMoLe8,784
|
|
2
2
|
fal/__main__.py,sha256=4JMK66Wj4uLZTKbF-sT3LAxOsr6buig77PmOkJCRRxw,83
|
|
3
|
-
fal/_fal_version.py,sha256=
|
|
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=
|
|
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=
|
|
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.
|
|
135
|
-
fal-1.9.
|
|
136
|
-
fal-1.9.
|
|
137
|
-
fal-1.9.
|
|
138
|
-
fal-1.9.
|
|
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
|
|
File without changes
|
|
File without changes
|