nucliadb-utils 3.0.3.post483__py3-none-any.whl → 3.0.3.post484__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.
@@ -244,15 +244,15 @@ class LocalStorage(Storage):
244
244
  created = False
245
245
  return created
246
246
 
247
- async def delete_kb(self, kbid: str):
247
+ async def delete_kb(self, kbid: str) -> tuple[bool, bool]:
248
248
  bucket = self.get_bucket_name(kbid)
249
249
  path = self.get_bucket_path(bucket)
250
250
  try:
251
251
  shutil.rmtree(path)
252
252
  deleted = True
253
- except Exception:
253
+ except FileNotFoundError:
254
254
  deleted = False
255
- return deleted
255
+ return deleted, False
256
256
 
257
257
  async def delete_upload(self, uri: str, bucket_name: str):
258
258
  file_path = self.get_file_path(bucket_name, uri)
@@ -168,6 +168,14 @@ async def get_storage(
168
168
  return MAIN[Utility.STORAGE]
169
169
 
170
170
 
171
+ async def teardown_storage():
172
+ storage: Optional[Storage] = get_utility(Utility.STORAGE)
173
+ if storage is None:
174
+ return
175
+ await storage.finalize()
176
+ clean_utility(Utility.STORAGE)
177
+
178
+
171
179
  def get_local_storage() -> LocalStorage:
172
180
  if Utility.LOCAL_STORAGE not in MAIN:
173
181
  from nucliadb_utils.storages.local import LocalStorage
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: nucliadb-utils
3
- Version: 3.0.3.post483
3
+ Version: 3.0.3.post484
4
4
  Home-page: https://nuclia.com
5
5
  License: BSD
6
6
  Classifier: Development Status :: 4 - Beta
@@ -21,8 +21,8 @@ Requires-Dist: nats-py[nkeys] >=2.6.0
21
21
  Requires-Dist: pyjwt >=2.4.0
22
22
  Requires-Dist: memorylru >=1.1.2
23
23
  Requires-Dist: mrflagly
24
- Requires-Dist: nucliadb-protos >=3.0.3.post483
25
- Requires-Dist: nucliadb-telemetry >=3.0.3.post483
24
+ Requires-Dist: nucliadb-protos >=3.0.3.post484
25
+ Requires-Dist: nucliadb-telemetry >=3.0.3.post484
26
26
  Provides-Extra: cache
27
27
  Requires-Dist: redis >=4.3.4 ; extra == 'cache'
28
28
  Requires-Dist: orjson >=3.6.7 ; extra == 'cache'
@@ -16,7 +16,7 @@ nucliadb_utils/settings.py,sha256=87sH3lSKvXhMVBvCkJYDRj_6MYvc5mWcqFUYcS740f0,72
16
16
  nucliadb_utils/signals.py,sha256=KxV4UUNWf4wrEbt1iJzy6PxYuTEhi6IRisKlYlq5OtM,2702
17
17
  nucliadb_utils/store.py,sha256=kQ35HemE0v4_Qg6xVqNIJi8vSFAYQtwI3rDtMsNy62Y,890
18
18
  nucliadb_utils/transaction.py,sha256=CQpsuF-E2omh4gGMxXCn0dv7vL9ctxooWpSgWGbGfBA,7212
19
- nucliadb_utils/utilities.py,sha256=sR-GXi1oc1D9Hxs3vLS2PTNYRLi8U_NWJZTfm9b8iv0,13981
19
+ nucliadb_utils/utilities.py,sha256=s5MVXDj4DTtc1VPFBRxMjud3HB0xkadyQ0f7QQLb0NM,14178
20
20
  nucliadb_utils/audit/__init__.py,sha256=cp15ZcFnHvpcu_5-aK2A4uUyvuZVV_MJn4bIXMa20ks,835
21
21
  nucliadb_utils/audit/audit.py,sha256=v-e9R4hc6iVjtN2JeZk1MAhV5x_OC5s59uSv-kF3qFk,2698
22
22
  nucliadb_utils/audit/basic.py,sha256=grlJpq5Z2LSkwgxY3PaaLb9e8asuevMPOgrzG1UcUDI,3267
@@ -33,7 +33,7 @@ nucliadb_utils/fastapi/versioning.py,sha256=uOVdKl8GzBt8L1YnU5GjBsNeDdFV2yrjjYFE
33
33
  nucliadb_utils/storages/__init__.py,sha256=5Qc8AUWiJv9_JbGCBpAn88AIJhwDlm0OPQpg2ZdRL4U,872
34
34
  nucliadb_utils/storages/exceptions.py,sha256=n6aBOyurWMo8mXd1XY6Psgno4VfXJ9TRbxCy67c08-g,2417
35
35
  nucliadb_utils/storages/gcs.py,sha256=-M-abojobXGwZaS1kuFXRBxwashsAaTXMStjx3QpX4U,27076
36
- nucliadb_utils/storages/local.py,sha256=fWqcHxpPsjEUMsmge3UXkjDy2hXvxCzvuyS6TaziQuA,10037
36
+ nucliadb_utils/storages/local.py,sha256=JQ4fDAd3AbyQazBtF_0JuGyt6yYyboFEcXGJoQitmgU,10073
37
37
  nucliadb_utils/storages/nuclia.py,sha256=UfvRu92eqG1v-PE-UWH2x8KEJFqDqATMmUGFmEuqSSs,2097
38
38
  nucliadb_utils/storages/pg.py,sha256=vxx8FQIToA_C6CO1uu9W080yZl0SgUVtTEWd6lQhPJc,18610
39
39
  nucliadb_utils/storages/s3.py,sha256=EYfn2CjoVL0tPFUqMaHgJYHjrSQaIUzLeNYoRa1qp-A,18809
@@ -63,8 +63,8 @@ nucliadb_utils/tests/unit/storages/test_aws.py,sha256=GCsB_jwCUNV3Ogt8TZZEmNKAHv
63
63
  nucliadb_utils/tests/unit/storages/test_gcs.py,sha256=2XzJwgNpfjVGjtE-QdZhu3ayuT1EMEXINdM-_SatPCY,3554
64
64
  nucliadb_utils/tests/unit/storages/test_pg.py,sha256=sJfUttMSzq8W1XYolAUcMxl_R5HcEzb5fpCklPeMJiY,17000
65
65
  nucliadb_utils/tests/unit/storages/test_storage.py,sha256=VFpRq6Q6BjnIrBQCumYzR8DQUacwhxt5CzTKSlqqD24,6892
66
- nucliadb_utils-3.0.3.post483.dist-info/METADATA,sha256=D13wwiP6QFpFEOgpED_p-mb1en6vu95GuP696VbZKxs,1975
67
- nucliadb_utils-3.0.3.post483.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
68
- nucliadb_utils-3.0.3.post483.dist-info/top_level.txt,sha256=fE3vJtALTfgh7bcAWcNhcfXkNPp_eVVpbKK-2IYua3E,15
69
- nucliadb_utils-3.0.3.post483.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
70
- nucliadb_utils-3.0.3.post483.dist-info/RECORD,,
66
+ nucliadb_utils-3.0.3.post484.dist-info/METADATA,sha256=EJ1IGJjzS6nUHQbUmX_rdDAZlUWk1iCmvlbd6zizgGw,1975
67
+ nucliadb_utils-3.0.3.post484.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
68
+ nucliadb_utils-3.0.3.post484.dist-info/top_level.txt,sha256=fE3vJtALTfgh7bcAWcNhcfXkNPp_eVVpbKK-2IYua3E,15
69
+ nucliadb_utils-3.0.3.post484.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
70
+ nucliadb_utils-3.0.3.post484.dist-info/RECORD,,