fal 1.17.1__py3-none-any.whl → 1.18.0__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/apps.py +2 -0
- fal/cli/files.py +14 -0
- fal/files.py +28 -8
- fal/sdk.py +2 -0
- {fal-1.17.1.dist-info → fal-1.18.0.dist-info}/METADATA +2 -2
- {fal-1.17.1.dist-info → fal-1.18.0.dist-info}/RECORD +10 -10
- {fal-1.17.1.dist-info → fal-1.18.0.dist-info}/WHEEL +0 -0
- {fal-1.17.1.dist-info → fal-1.18.0.dist-info}/entry_points.txt +0 -0
- {fal-1.17.1.dist-info → fal-1.18.0.dist-info}/top_level.txt +0 -0
fal/_fal_version.py
CHANGED
fal/cli/apps.py
CHANGED
|
@@ -102,6 +102,7 @@ def _app_rev_table(revs: list[ApplicationInfo]):
|
|
|
102
102
|
table.add_column("Machine Type")
|
|
103
103
|
table.add_column("Runners")
|
|
104
104
|
table.add_column("Regions")
|
|
105
|
+
table.add_column("Created")
|
|
105
106
|
|
|
106
107
|
for rev in revs:
|
|
107
108
|
table.add_row(
|
|
@@ -115,6 +116,7 @@ def _app_rev_table(revs: list[ApplicationInfo]):
|
|
|
115
116
|
" ".join(rev.machine_types),
|
|
116
117
|
str(rev.active_runners),
|
|
117
118
|
" ".join(rev.valid_regions),
|
|
119
|
+
str(rev.created_at),
|
|
118
120
|
)
|
|
119
121
|
|
|
120
122
|
return table
|
fal/cli/files.py
CHANGED
|
@@ -28,6 +28,13 @@ def _upload(args):
|
|
|
28
28
|
fs.put(args.local_path, args.remote_path, recursive=True)
|
|
29
29
|
|
|
30
30
|
|
|
31
|
+
def _upload_url(args):
|
|
32
|
+
from fal.files import FalFileSystem
|
|
33
|
+
|
|
34
|
+
fs = FalFileSystem()
|
|
35
|
+
fs.put_file_from_url(args.url, args.remote_path)
|
|
36
|
+
|
|
37
|
+
|
|
31
38
|
def add_parser(main_subparsers, parents):
|
|
32
39
|
files_help = "Manage fal files."
|
|
33
40
|
parser = main_subparsers.add_parser(
|
|
@@ -68,3 +75,10 @@ def add_parser(main_subparsers, parents):
|
|
|
68
75
|
upload_parser.add_argument("local_path", type=str, help="Local path to upload")
|
|
69
76
|
upload_parser.add_argument("remote_path", type=str, help="Remote path to upload to")
|
|
70
77
|
upload_parser.set_defaults(func=_upload)
|
|
78
|
+
|
|
79
|
+
upload_url_parser = subparsers.add_parser("upload-url", parents=parents)
|
|
80
|
+
upload_url_parser.add_argument("url", type=str, help="URL to upload")
|
|
81
|
+
upload_url_parser.add_argument(
|
|
82
|
+
"remote_path", type=str, help="Remote path to upload to"
|
|
83
|
+
)
|
|
84
|
+
upload_url_parser.set_defaults(func=_upload_url)
|
fal/files.py
CHANGED
|
@@ -28,9 +28,20 @@ class FalFileSystem(AbstractFileSystem):
|
|
|
28
28
|
},
|
|
29
29
|
)
|
|
30
30
|
|
|
31
|
+
def _request(self, method, path, **kwargs):
|
|
32
|
+
from fal.exceptions import FalServerlessException
|
|
33
|
+
|
|
34
|
+
response = self._client.request(method, path, **kwargs)
|
|
35
|
+
if response.status_code != 200:
|
|
36
|
+
try:
|
|
37
|
+
detail = response.json()["detail"]
|
|
38
|
+
except Exception:
|
|
39
|
+
detail = response.text
|
|
40
|
+
raise FalServerlessException(detail)
|
|
41
|
+
return response
|
|
42
|
+
|
|
31
43
|
def _ls(self, path):
|
|
32
|
-
response = self.
|
|
33
|
-
response.raise_for_status()
|
|
44
|
+
response = self._request("GET", f"/files/list/{path}")
|
|
34
45
|
files = response.json()
|
|
35
46
|
return sorted(
|
|
36
47
|
(
|
|
@@ -81,8 +92,7 @@ class FalFileSystem(AbstractFileSystem):
|
|
|
81
92
|
return
|
|
82
93
|
|
|
83
94
|
with open(lpath, "wb") as fobj:
|
|
84
|
-
response = self.
|
|
85
|
-
response.raise_for_status()
|
|
95
|
+
response = self._request("GET", f"/files/file/{rpath}")
|
|
86
96
|
fobj.write(response.content)
|
|
87
97
|
|
|
88
98
|
def put_file(self, lpath, rpath, mode="overwrite", **kwargs):
|
|
@@ -90,14 +100,24 @@ class FalFileSystem(AbstractFileSystem):
|
|
|
90
100
|
return
|
|
91
101
|
|
|
92
102
|
with open(lpath, "rb") as fobj:
|
|
93
|
-
|
|
103
|
+
self._request(
|
|
104
|
+
"POST",
|
|
94
105
|
f"/files/file/local/{rpath}",
|
|
95
106
|
files={"file_upload": (posixpath.basename(lpath), fobj, "text/plain")},
|
|
96
107
|
)
|
|
97
|
-
|
|
108
|
+
self.dircache.clear()
|
|
109
|
+
|
|
110
|
+
def put_file_from_url(self, url, rpath, mode="overwrite", **kwargs):
|
|
111
|
+
self._request(
|
|
112
|
+
"POST",
|
|
113
|
+
f"/files/file/url/{rpath}",
|
|
114
|
+
json={"url": url},
|
|
115
|
+
)
|
|
98
116
|
self.dircache.clear()
|
|
99
117
|
|
|
100
118
|
def rm(self, path, **kwargs):
|
|
101
|
-
|
|
102
|
-
|
|
119
|
+
self._request(
|
|
120
|
+
"DELETE",
|
|
121
|
+
f"/files/file/{path}",
|
|
122
|
+
)
|
|
103
123
|
self.dircache.clear()
|
fal/sdk.py
CHANGED
|
@@ -238,6 +238,7 @@ class ApplicationInfo:
|
|
|
238
238
|
request_timeout: int
|
|
239
239
|
startup_timeout: int
|
|
240
240
|
valid_regions: list[str]
|
|
241
|
+
created_at: datetime
|
|
241
242
|
|
|
242
243
|
|
|
243
244
|
@dataclass
|
|
@@ -368,6 +369,7 @@ def _from_grpc_application_info(
|
|
|
368
369
|
request_timeout=message.request_timeout,
|
|
369
370
|
startup_timeout=message.startup_timeout,
|
|
370
371
|
valid_regions=list(message.valid_regions),
|
|
372
|
+
created_at=isolate_proto.datetime_from_timestamp(message.created_at),
|
|
371
373
|
)
|
|
372
374
|
|
|
373
375
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fal
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.18.0
|
|
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
8
|
Requires-Dist: isolate[build]<0.17.0,>=0.16.2
|
|
9
|
-
Requires-Dist: isolate-proto<0.
|
|
9
|
+
Requires-Dist: isolate-proto<0.10.0,>=0.9.0
|
|
10
10
|
Requires-Dist: grpcio==1.64.0
|
|
11
11
|
Requires-Dist: dill==0.3.7
|
|
12
12
|
Requires-Dist: cloudpickle==3.0.0
|
|
@@ -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=xW7VOyCLWkvDW_9sKSgQUAES7NRhHtnyuER244xfxF4,513
|
|
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=moDNT8wt20uzsI-NTEsbVTpjFXFkSuuRXJx7Apux3SI,46329
|
|
@@ -8,12 +8,12 @@ fal/app.py,sha256=S5VHxDaj5J9YVC8ECenHCZJlTHalapHyOyHbCBNsDfs,24153
|
|
|
8
8
|
fal/apps.py,sha256=pzCd2mrKl5J_4oVc40_pggvPtFahXBCdrZXWpnaEJVs,12130
|
|
9
9
|
fal/config.py,sha256=BEMH10B2bfWJ9yNawnLG6v3kBLnLmkhMe201EAODzs4,3124
|
|
10
10
|
fal/container.py,sha256=OvR-Zq-NPbYFHTnw0SBUUFxr890Fgbe68J2kSJEpLOk,1905
|
|
11
|
-
fal/files.py,sha256=
|
|
11
|
+
fal/files.py,sha256=1eOyrj1M0hTixZdbtQ1ogJqWpLd7UfiOt1Rxihnqh8g,3565
|
|
12
12
|
fal/flags.py,sha256=48pgtc9xb4LMpR9RE5KG2A2sH7zQRk_VjrgpND-H4Tc,942
|
|
13
13
|
fal/project.py,sha256=QgfYfMKmNobMPufrAP_ga1FKcIAlSbw18Iar1-0qepo,2650
|
|
14
14
|
fal/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
15
15
|
fal/rest_client.py,sha256=kGBGmuyHfX1lR910EoKCYPjsyU8MdXawT_cW2q8Sajc,568
|
|
16
|
-
fal/sdk.py,sha256=
|
|
16
|
+
fal/sdk.py,sha256=_ixL1r8siRi-h7n56Tyn1NaiyWz2CEhbvWu2NBW8LOc,25919
|
|
17
17
|
fal/sync.py,sha256=ZuIJA2-hTPNANG9B_NNJZUsO68EIdTH0dc9MzeVE2VU,4340
|
|
18
18
|
fal/utils.py,sha256=iQTBG3-i6JZgHkkwbY_I4210g0xoW-as51yrke608u0,2208
|
|
19
19
|
fal/workflows.py,sha256=Zl4f6Bs085hY40zmqScxDUyCu7zXkukDbW02iYOLTTI,14805
|
|
@@ -23,14 +23,14 @@ fal/auth/local.py,sha256=sndkM6vKpeVny6NHTacVlTbiIFqaksOmw0Viqs_RN1U,1790
|
|
|
23
23
|
fal/cli/__init__.py,sha256=padK4o0BFqq61kxAA1qQ0jYr2SuhA2mf90B3AaRkmJA,37
|
|
24
24
|
fal/cli/_utils.py,sha256=anFfy6qouB8QzH0Yho41GulGiJu3q1KKIwgyVQCzgRQ,1593
|
|
25
25
|
fal/cli/api.py,sha256=ZuDE_PIC-czzneTAWMwvC7P7WnwIyluNZSuJqzCFhqI,2640
|
|
26
|
-
fal/cli/apps.py,sha256=
|
|
26
|
+
fal/cli/apps.py,sha256=FSd6uhNlmJUSToeG89gq2159RBkg9ImXquTCrvxTfQo,10283
|
|
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
30
|
fal/cli/debug.py,sha256=u_urnyFzSlNnrq93zz_GXE9FX4VyVxDoamJJyrZpFI0,1312
|
|
31
31
|
fal/cli/deploy.py,sha256=CWf0Y56w-hNCrht-qrfgiOi9nuvve1Kl5NFZJpt_oRA,7770
|
|
32
32
|
fal/cli/doctor.py,sha256=U4ne9LX5gQwNblsYQ27XdO8AYDgbYjTO39EtxhwexRM,983
|
|
33
|
-
fal/cli/files.py,sha256=
|
|
33
|
+
fal/cli/files.py,sha256=DnCVWUFmdxVU-ADIAOjG8mFcnc7xjOTuliFJHNYJZzo,2424
|
|
34
34
|
fal/cli/keys.py,sha256=7Sf4DT4le89G42eAOt0ltRjbZAtE70AVQ62hmjZhUy0,3059
|
|
35
35
|
fal/cli/main.py,sha256=ao8EEV_Fkd7AdN5En6k_dZWp158Et5DrqNRutl98MHY,3273
|
|
36
36
|
fal/cli/parser.py,sha256=jYsGQ0BLQuKI7KtN1jnLVYKMbLtez7hPjwTNfG3UPSk,2964
|
|
@@ -137,8 +137,8 @@ openapi_fal_rest/models/workflow_node_type.py,sha256=-FzyeY2bxcNmizKbJI8joG7byRi
|
|
|
137
137
|
openapi_fal_rest/models/workflow_schema.py,sha256=4K5gsv9u9pxx2ItkffoyHeNjBBYf6ur5bN4m_zePZNY,2019
|
|
138
138
|
openapi_fal_rest/models/workflow_schema_input.py,sha256=2OkOXWHTNsCXHWS6EGDFzcJKkW5FIap-2gfO233EvZQ,1191
|
|
139
139
|
openapi_fal_rest/models/workflow_schema_output.py,sha256=EblwSPAGfWfYVWw_WSSaBzQVju296is9o28rMBAd0mc,1196
|
|
140
|
-
fal-1.
|
|
141
|
-
fal-1.
|
|
142
|
-
fal-1.
|
|
143
|
-
fal-1.
|
|
144
|
-
fal-1.
|
|
140
|
+
fal-1.18.0.dist-info/METADATA,sha256=QEhfdIrssx_gXUubgXWAWqF6lAvJdi4nlao0b4REVE4,4085
|
|
141
|
+
fal-1.18.0.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
|
|
142
|
+
fal-1.18.0.dist-info/entry_points.txt,sha256=32zwTUC1U1E7nSTIGCoANQOQ3I7-qHG5wI6gsVz5pNU,37
|
|
143
|
+
fal-1.18.0.dist-info/top_level.txt,sha256=r257X1L57oJL8_lM0tRrfGuXFwm66i1huwQygbpLmHw,21
|
|
144
|
+
fal-1.18.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|