fal 1.8.3__py3-none-any.whl → 1.8.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/toolkit/file/file.py +3 -1
- fal/toolkit/file/providers/fal.py +27 -4
- fal/toolkit/file/providers/gcp.py +4 -0
- fal/toolkit/file/providers/r2.py +4 -0
- fal/toolkit/file/providers/s3.py +4 -0
- fal/toolkit/file/types.py +12 -1
- {fal-1.8.3.dist-info → fal-1.8.4.dist-info}/METADATA +1 -1
- {fal-1.8.3.dist-info → fal-1.8.4.dist-info}/RECORD +12 -12
- {fal-1.8.3.dist-info → fal-1.8.4.dist-info}/WHEEL +0 -0
- {fal-1.8.3.dist-info → fal-1.8.4.dist-info}/entry_points.txt +0 -0
- {fal-1.8.3.dist-info → fal-1.8.4.dist-info}/top_level.txt +0 -0
fal/_fal_version.py
CHANGED
fal/toolkit/file/file.py
CHANGED
|
@@ -166,7 +166,9 @@ class File(BaseModel):
|
|
|
166
166
|
fallback_repo = get_builtin_repository(fallback_repository)
|
|
167
167
|
|
|
168
168
|
url = fallback_repo.save(
|
|
169
|
-
fdata,
|
|
169
|
+
fdata,
|
|
170
|
+
object_lifecycle_preference=object_lifecycle_preference,
|
|
171
|
+
**fallback_save_kwargs,
|
|
170
172
|
)
|
|
171
173
|
|
|
172
174
|
return cls(
|
|
@@ -185,7 +185,13 @@ class FalFileRepositoryBase(FileRepository):
|
|
|
185
185
|
@dataclass
|
|
186
186
|
class FalFileRepository(FalFileRepositoryBase):
|
|
187
187
|
def save(
|
|
188
|
-
self,
|
|
188
|
+
self,
|
|
189
|
+
file: FileData,
|
|
190
|
+
multipart: bool | None = None,
|
|
191
|
+
multipart_threshold: int | None = None,
|
|
192
|
+
multipart_chunk_size: int | None = None,
|
|
193
|
+
multipart_max_concurrency: int | None = None,
|
|
194
|
+
object_lifecycle_preference: dict[str, str] | None = None,
|
|
189
195
|
) -> str:
|
|
190
196
|
return self._save(file, "gcs")
|
|
191
197
|
|
|
@@ -834,7 +840,10 @@ class FalFileRepositoryV2(FalFileRepositoryBase):
|
|
|
834
840
|
content_type=content_type,
|
|
835
841
|
file_name=os.path.basename(file_path),
|
|
836
842
|
)
|
|
837
|
-
url = self.save(
|
|
843
|
+
url = self.save(
|
|
844
|
+
data,
|
|
845
|
+
object_lifecycle_preference=object_lifecycle_preference,
|
|
846
|
+
)
|
|
838
847
|
|
|
839
848
|
return url, data
|
|
840
849
|
|
|
@@ -844,6 +853,10 @@ class InMemoryRepository(FileRepository):
|
|
|
844
853
|
def save(
|
|
845
854
|
self,
|
|
846
855
|
file: FileData,
|
|
856
|
+
multipart: bool | None = None,
|
|
857
|
+
multipart_threshold: int | None = None,
|
|
858
|
+
multipart_chunk_size: int | None = None,
|
|
859
|
+
multipart_max_concurrency: int | None = None,
|
|
847
860
|
object_lifecycle_preference: dict[str, str] | None = None,
|
|
848
861
|
) -> str:
|
|
849
862
|
return f'data:{file.content_type};base64,{b64encode(file.data).decode("utf-8")}'
|
|
@@ -865,6 +878,10 @@ class FalCDNFileRepository(FileRepository):
|
|
|
865
878
|
def save(
|
|
866
879
|
self,
|
|
867
880
|
file: FileData,
|
|
881
|
+
multipart: bool | None = None,
|
|
882
|
+
multipart_threshold: int | None = None,
|
|
883
|
+
multipart_chunk_size: int | None = None,
|
|
884
|
+
multipart_max_concurrency: int | None = None,
|
|
868
885
|
object_lifecycle_preference: dict[str, str] | None = None,
|
|
869
886
|
) -> str:
|
|
870
887
|
headers = {
|
|
@@ -1013,7 +1030,10 @@ class FalFileRepositoryV3(FileRepository):
|
|
|
1013
1030
|
content_type=content_type,
|
|
1014
1031
|
file_name=os.path.basename(file_path),
|
|
1015
1032
|
)
|
|
1016
|
-
url = self.save(
|
|
1033
|
+
url = self.save(
|
|
1034
|
+
data,
|
|
1035
|
+
object_lifecycle_preference=object_lifecycle_preference,
|
|
1036
|
+
)
|
|
1017
1037
|
|
|
1018
1038
|
return url, data
|
|
1019
1039
|
|
|
@@ -1119,6 +1139,9 @@ class InternalFalFileRepositoryV3(FileRepository):
|
|
|
1119
1139
|
content_type=content_type,
|
|
1120
1140
|
file_name=os.path.basename(file_path),
|
|
1121
1141
|
)
|
|
1122
|
-
url = self.save(
|
|
1142
|
+
url = self.save(
|
|
1143
|
+
data,
|
|
1144
|
+
object_lifecycle_preference=object_lifecycle_preference,
|
|
1145
|
+
)
|
|
1123
1146
|
|
|
1124
1147
|
return url, data
|
|
@@ -56,6 +56,10 @@ class GoogleStorageRepository(FileRepository):
|
|
|
56
56
|
def save(
|
|
57
57
|
self,
|
|
58
58
|
data: FileData,
|
|
59
|
+
multipart: bool | None = None,
|
|
60
|
+
multipart_threshold: int | None = None,
|
|
61
|
+
multipart_chunk_size: int | None = None,
|
|
62
|
+
multipart_max_concurrency: int | None = None,
|
|
59
63
|
object_lifecycle_preference: Optional[dict[str, str]] = None,
|
|
60
64
|
) -> str:
|
|
61
65
|
destination_path = posixpath.join(
|
fal/toolkit/file/providers/r2.py
CHANGED
|
@@ -73,6 +73,10 @@ class R2Repository(FileRepository):
|
|
|
73
73
|
def save(
|
|
74
74
|
self,
|
|
75
75
|
data: FileData,
|
|
76
|
+
multipart: bool | None = None,
|
|
77
|
+
multipart_threshold: int | None = None,
|
|
78
|
+
multipart_chunk_size: int | None = None,
|
|
79
|
+
multipart_max_concurrency: int | None = None,
|
|
76
80
|
object_lifecycle_preference: Optional[dict[str, str]] = None,
|
|
77
81
|
) -> str:
|
|
78
82
|
destination_path = posixpath.join(
|
fal/toolkit/file/providers/s3.py
CHANGED
|
@@ -57,6 +57,10 @@ class S3Repository(FileRepository):
|
|
|
57
57
|
def save(
|
|
58
58
|
self,
|
|
59
59
|
data: FileData,
|
|
60
|
+
multipart: bool | None = None,
|
|
61
|
+
multipart_threshold: int | None = None,
|
|
62
|
+
multipart_chunk_size: int | None = None,
|
|
63
|
+
multipart_max_concurrency: int | None = None,
|
|
60
64
|
object_lifecycle_preference: Optional[dict[str, str]] = None,
|
|
61
65
|
key: Optional[str] = None,
|
|
62
66
|
) -> str:
|
fal/toolkit/file/types.py
CHANGED
|
@@ -39,6 +39,10 @@ class FileRepository:
|
|
|
39
39
|
def save(
|
|
40
40
|
self,
|
|
41
41
|
data: FileData,
|
|
42
|
+
multipart: bool | None = None,
|
|
43
|
+
multipart_threshold: int | None = None,
|
|
44
|
+
multipart_chunk_size: int | None = None,
|
|
45
|
+
multipart_max_concurrency: int | None = None,
|
|
42
46
|
object_lifecycle_preference: Optional[dict[str, str]] = None,
|
|
43
47
|
) -> str:
|
|
44
48
|
raise NotImplementedError()
|
|
@@ -59,4 +63,11 @@ class FileRepository:
|
|
|
59
63
|
with open(file_path, "rb") as fobj:
|
|
60
64
|
data = FileData(fobj.read(), content_type, Path(file_path).name)
|
|
61
65
|
|
|
62
|
-
return self.save(
|
|
66
|
+
return self.save(
|
|
67
|
+
data,
|
|
68
|
+
multipart=multipart,
|
|
69
|
+
multipart_threshold=multipart_threshold,
|
|
70
|
+
multipart_chunk_size=multipart_chunk_size,
|
|
71
|
+
multipart_max_concurrency=multipart_max_concurrency,
|
|
72
|
+
object_lifecycle_preference=object_lifecycle_preference,
|
|
73
|
+
), data
|
|
@@ -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=RzA6EmFHcrKXdLSPJdLNSA0ru2WnTYAYts_G-ig2BqQ,411
|
|
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=ZbUoe12y6sVg5-bPbzFtqHTqZoQonVDaZRjlGNaHbcs,43983
|
|
@@ -50,12 +50,12 @@ fal/toolkit/exceptions.py,sha256=elHZ7dHCJG5zlHGSBbz-ilkZe9QUvQMomJFi8Pt91LA,198
|
|
|
50
50
|
fal/toolkit/optimize.py,sha256=p75sovF0SmRP6zxzpIaaOmqlxvXB_xEz3XPNf59EF7w,1339
|
|
51
51
|
fal/toolkit/types.py,sha256=kkbOsDKj1qPGb1UARTBp7yuJ5JUuyy7XQurYUBCdti8,4064
|
|
52
52
|
fal/toolkit/file/__init__.py,sha256=FbNl6wD-P0aSSTUwzHt4HujBXrbC3ABmaigPQA4hRfg,70
|
|
53
|
-
fal/toolkit/file/file.py,sha256=
|
|
54
|
-
fal/toolkit/file/types.py,sha256=
|
|
55
|
-
fal/toolkit/file/providers/fal.py,sha256=
|
|
56
|
-
fal/toolkit/file/providers/gcp.py,sha256=
|
|
57
|
-
fal/toolkit/file/providers/r2.py,sha256=
|
|
58
|
-
fal/toolkit/file/providers/s3.py,sha256=
|
|
53
|
+
fal/toolkit/file/file.py,sha256=LyXmcHNsnBNA2MXFJ8UlHL1WHpZrOFYfwn2mfMJrdus,9216
|
|
54
|
+
fal/toolkit/file/types.py,sha256=MMAH_AyLOhowQPesOv1V25wB4qgbJ3vYNlnTPbdSv1M,2304
|
|
55
|
+
fal/toolkit/file/providers/fal.py,sha256=XH5nPwnFGklWKtecfmWeaPGUwpR4mXmvESikQ5_FBjw,36918
|
|
56
|
+
fal/toolkit/file/providers/gcp.py,sha256=DKeZpm1MjwbvEsYvkdXUtuLIJDr_UNbqXj_Mfv3NTeo,2437
|
|
57
|
+
fal/toolkit/file/providers/r2.py,sha256=YqnYkkAo_ZKIa-xoSuDnnidUFwJWHdziAR34PE6irdI,3061
|
|
58
|
+
fal/toolkit/file/providers/s3.py,sha256=EI45T54Mox7lHZKROss_O8o0DIn3CHP9k1iaNYVrxvg,2714
|
|
59
59
|
fal/toolkit/image/__init__.py,sha256=m3OatPbBhcEOYyaTu_dgToxunUKoJu4bJVCWUoN7HX4,1838
|
|
60
60
|
fal/toolkit/image/image.py,sha256=ZSkozciP4XxaGnvrR_mP4utqE3_QhoPN0dau9FJ2Xco,5033
|
|
61
61
|
fal/toolkit/image/safety_checker.py,sha256=S7ow-HuoVxC6ixHWWcBrAUm2dIlgq3sTAIull6xIbAg,3105
|
|
@@ -130,8 +130,8 @@ openapi_fal_rest/models/workflow_node_type.py,sha256=-FzyeY2bxcNmizKbJI8joG7byRi
|
|
|
130
130
|
openapi_fal_rest/models/workflow_schema.py,sha256=4K5gsv9u9pxx2ItkffoyHeNjBBYf6ur5bN4m_zePZNY,2019
|
|
131
131
|
openapi_fal_rest/models/workflow_schema_input.py,sha256=2OkOXWHTNsCXHWS6EGDFzcJKkW5FIap-2gfO233EvZQ,1191
|
|
132
132
|
openapi_fal_rest/models/workflow_schema_output.py,sha256=EblwSPAGfWfYVWw_WSSaBzQVju296is9o28rMBAd0mc,1196
|
|
133
|
-
fal-1.8.
|
|
134
|
-
fal-1.8.
|
|
135
|
-
fal-1.8.
|
|
136
|
-
fal-1.8.
|
|
137
|
-
fal-1.8.
|
|
133
|
+
fal-1.8.4.dist-info/METADATA,sha256=E4R9L0BkZtbTt2mB_UlXNvfWY41mhqn6RW6fxxjg_4g,4002
|
|
134
|
+
fal-1.8.4.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
135
|
+
fal-1.8.4.dist-info/entry_points.txt,sha256=32zwTUC1U1E7nSTIGCoANQOQ3I7-qHG5wI6gsVz5pNU,37
|
|
136
|
+
fal-1.8.4.dist-info/top_level.txt,sha256=r257X1L57oJL8_lM0tRrfGuXFwm66i1huwQygbpLmHw,21
|
|
137
|
+
fal-1.8.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|