lamindb_setup 1.8.2__py3-none-any.whl → 1.8.3__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.
- lamindb_setup/__init__.py +1 -1
- lamindb_setup/_check_setup.py +3 -0
- lamindb_setup/core/_aws_options.py +1 -5
- lamindb_setup/core/_hub_core.py +4 -4
- lamindb_setup/core/_settings_instance.py +19 -4
- lamindb_setup/core/_settings_user.py +1 -1
- lamindb_setup/core/django.py +1 -1
- {lamindb_setup-1.8.2.dist-info → lamindb_setup-1.8.3.dist-info}/METADATA +1 -1
- {lamindb_setup-1.8.2.dist-info → lamindb_setup-1.8.3.dist-info}/RECORD +11 -11
- {lamindb_setup-1.8.2.dist-info → lamindb_setup-1.8.3.dist-info}/LICENSE +0 -0
- {lamindb_setup-1.8.2.dist-info → lamindb_setup-1.8.3.dist-info}/WHEEL +0 -0
lamindb_setup/__init__.py
CHANGED
lamindb_setup/_check_setup.py
CHANGED
|
@@ -147,6 +147,9 @@ def _check_instance_setup(from_module: str | None = None) -> bool:
|
|
|
147
147
|
else:
|
|
148
148
|
django_lamin.setup_django(isettings)
|
|
149
149
|
logger.important(f"connected lamindb: {isettings.slug}")
|
|
150
|
+
settings._instance_settings = (
|
|
151
|
+
isettings # update of local storage location
|
|
152
|
+
)
|
|
150
153
|
return django_lamin.IS_SETUP
|
|
151
154
|
else:
|
|
152
155
|
if from_module is not None and settings.auto_connect:
|
|
@@ -172,11 +172,7 @@ class AWSOptionsManager:
|
|
|
172
172
|
from ._hub_core import access_aws
|
|
173
173
|
from ._settings import settings
|
|
174
174
|
|
|
175
|
-
|
|
176
|
-
storage_root_info = access_aws(path_str, access_token=access_token)
|
|
177
|
-
else:
|
|
178
|
-
storage_root_info = {"credentials": {}, "accessibility": {}}
|
|
179
|
-
|
|
175
|
+
storage_root_info = access_aws(path_str, access_token=access_token)
|
|
180
176
|
accessibility = storage_root_info["accessibility"]
|
|
181
177
|
is_managed = accessibility.get("is_managed", False)
|
|
182
178
|
if is_managed:
|
lamindb_setup/core/_hub_core.py
CHANGED
|
@@ -460,9 +460,9 @@ def access_aws(storage_root: str, access_token: str | None = None) -> dict[str,
|
|
|
460
460
|
storage_root_info = call_with_fallback_auth(
|
|
461
461
|
_access_aws, storage_root=storage_root, access_token=access_token
|
|
462
462
|
)
|
|
463
|
-
return storage_root_info
|
|
464
463
|
else:
|
|
465
|
-
|
|
464
|
+
storage_root_info = call_with_fallback(_access_aws, storage_root=storage_root)
|
|
465
|
+
return storage_root_info
|
|
466
466
|
|
|
467
467
|
|
|
468
468
|
def _access_aws(*, storage_root: str, client: Client) -> dict[str, dict]:
|
|
@@ -497,8 +497,8 @@ def access_db(
|
|
|
497
497
|
instance_slug: str
|
|
498
498
|
instance_api_url: str | None
|
|
499
499
|
if (
|
|
500
|
-
"
|
|
501
|
-
and (env_db_token := os.environ["
|
|
500
|
+
"LAMIN_DB_TOKEN" in os.environ
|
|
501
|
+
and (env_db_token := os.environ["LAMIN_DB_TOKEN"]) != ""
|
|
502
502
|
):
|
|
503
503
|
return env_db_token
|
|
504
504
|
|
|
@@ -104,8 +104,20 @@ class InstanceSettings:
|
|
|
104
104
|
for attr in attrs:
|
|
105
105
|
value = getattr(self, attr)
|
|
106
106
|
if attr == "storage":
|
|
107
|
-
|
|
108
|
-
|
|
107
|
+
if self.keep_artifacts_local:
|
|
108
|
+
import lamindb as ln
|
|
109
|
+
|
|
110
|
+
self._local_storage = ln.setup.settings.instance._local_storage
|
|
111
|
+
if self._local_storage is not None:
|
|
112
|
+
value_local = self.local_storage
|
|
113
|
+
representation += f"\n - local storage: {value_local.root_as_str} ({value_local.region})"
|
|
114
|
+
representation += (
|
|
115
|
+
f"\n - cloud storage: {value.root_as_str} ({value.region})"
|
|
116
|
+
)
|
|
117
|
+
else:
|
|
118
|
+
representation += (
|
|
119
|
+
f"\n - storage: {value.root_as_str} ({value.region})"
|
|
120
|
+
)
|
|
109
121
|
elif attr == "db":
|
|
110
122
|
if self.dialect != "sqlite":
|
|
111
123
|
model = LaminDsnModel(db=value)
|
|
@@ -190,8 +202,9 @@ class InstanceSettings:
|
|
|
190
202
|
if len(found) > 1:
|
|
191
203
|
found_display = "\n - ".join([f"{record.root}" for record in found])
|
|
192
204
|
logger.important(f"found locations:\n - {found_display}")
|
|
205
|
+
record = found[0]
|
|
193
206
|
logger.important(f"defaulting to local storage: {record.root}")
|
|
194
|
-
return StorageSettings(record.root)
|
|
207
|
+
return StorageSettings(record.root, region=record.region)
|
|
195
208
|
elif not mute_warning:
|
|
196
209
|
start = LOCAL_STORAGE_MESSAGE[0].lower()
|
|
197
210
|
logger.warning(f"{start}{LOCAL_STORAGE_MESSAGE[1:]}")
|
|
@@ -229,7 +242,9 @@ class InstanceSettings:
|
|
|
229
242
|
Guide: :doc:`faq/keep-artifacts-local`
|
|
230
243
|
"""
|
|
231
244
|
if not self.keep_artifacts_local:
|
|
232
|
-
raise ValueError(
|
|
245
|
+
raise ValueError(
|
|
246
|
+
"`keep_artifacts_local` is False, switch via: ln.setup.settings.instance.keep_artifacts_local = True"
|
|
247
|
+
)
|
|
233
248
|
if self._local_storage is None:
|
|
234
249
|
self._local_storage = self._search_local_root()
|
|
235
250
|
if self._local_storage is None:
|
|
@@ -39,7 +39,7 @@ class UserSettings:
|
|
|
39
39
|
def __repr__(self) -> str:
|
|
40
40
|
"""Rich string representation."""
|
|
41
41
|
representation = "Current user:"
|
|
42
|
-
attrs = ["handle", "
|
|
42
|
+
attrs = ["handle", "uid"]
|
|
43
43
|
for attr in attrs:
|
|
44
44
|
value = getattr(self, attr)
|
|
45
45
|
representation += f"\n - {attr}: {value}"
|
lamindb_setup/core/django.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
lamindb_setup/__init__.py,sha256=
|
|
1
|
+
lamindb_setup/__init__.py,sha256=Pdh2-wDgY4x06M23rDIrY4XP4QrMck8SOSU00SAoSsw,2782
|
|
2
2
|
lamindb_setup/_cache.py,sha256=5o749NuW6zi6uP4rmBtwxg7ifWpAHXVngzC0tEgXLgo,2776
|
|
3
3
|
lamindb_setup/_check.py,sha256=28PcG8Kp6OpjSLSi1r2boL2Ryeh6xkaCL87HFbjs6GA,129
|
|
4
|
-
lamindb_setup/_check_setup.py,sha256=
|
|
4
|
+
lamindb_setup/_check_setup.py,sha256=eeg7Vr7tUaTDObxq1X7J3TDPQZeitb_Uy6dxqa9xfzs,5707
|
|
5
5
|
lamindb_setup/_connect_instance.py,sha256=PDvtAEHYJQVy-aMPNupN1u6PG9Rb_85JNKcjrOeHNy0,13478
|
|
6
6
|
lamindb_setup/_delete.py,sha256=2KnZOqd5Kgr45XzjiDE9der35LODDUajZD6_hcurGtQ,5676
|
|
7
7
|
lamindb_setup/_disconnect.py,sha256=p6tRLhixU4CuSxMKqzGTr-ovKmTRlZ8aID5dWQxOsg8,1092
|
|
@@ -21,30 +21,30 @@ lamindb_setup/errors.py,sha256=H1UM-bii0U2vPyjprOBgZK4ijZJgzgCViyGWPd8v5yU,1493
|
|
|
21
21
|
lamindb_setup/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
22
22
|
lamindb_setup/types.py,sha256=XlXLb4nmbc68uBj5Hp3xpDRezYGJIBZv6jAAqqN0p10,614
|
|
23
23
|
lamindb_setup/core/__init__.py,sha256=5M4A6CVHBO_T5Rr9MeLaPW3WTk4-y00cgRYEgUJVU5U,410
|
|
24
|
-
lamindb_setup/core/_aws_options.py,sha256=
|
|
24
|
+
lamindb_setup/core/_aws_options.py,sha256=b8gAk9B1kjxhf73kTJpnM-uMre1koL0MPTCq9uwpEaE,7558
|
|
25
25
|
lamindb_setup/core/_aws_storage.py,sha256=nEjeUv4xUVpoV0Lx-zjjmyb9w804bDyaeiM-OqbfwM0,1799
|
|
26
26
|
lamindb_setup/core/_deprecated.py,sha256=HN7iUBdEgahw5e4NHCd1VJooUfieNb6GRzS5x8jU-q8,2549
|
|
27
27
|
lamindb_setup/core/_docs.py,sha256=3k-YY-oVaJd_9UIY-LfBg_u8raKOCNfkZQPA73KsUhs,276
|
|
28
28
|
lamindb_setup/core/_hub_client.py,sha256=jICkfWW1eZoxh3ycviztBGqCJH53uVve5Xawbj8RZR4,8433
|
|
29
|
-
lamindb_setup/core/_hub_core.py,sha256=
|
|
29
|
+
lamindb_setup/core/_hub_core.py,sha256=S3XjVA-bBchvyzTr-jNae4oLuN2Ho8A30me0MMswln0,23917
|
|
30
30
|
lamindb_setup/core/_hub_crud.py,sha256=Jz0d8wFKM1Pv9B9byyUJPlCIMkIzk56Jd-c3Awpm9Xw,5730
|
|
31
31
|
lamindb_setup/core/_hub_utils.py,sha256=6dyDGyzYFgVfR_lE3VN3CP1jGp98gxPtr-T91PAP05U,2687
|
|
32
32
|
lamindb_setup/core/_private_django_api.py,sha256=By63l3vIEtK1pq246FhHq3tslxsaTJGKm5VakYluWp4,2656
|
|
33
33
|
lamindb_setup/core/_settings.py,sha256=EtlxhtAdclS6rDRh5mrwh_q3gA7SJ1eF2rO1QtOYnnE,12949
|
|
34
|
-
lamindb_setup/core/_settings_instance.py,sha256=
|
|
34
|
+
lamindb_setup/core/_settings_instance.py,sha256=coGnDwQaqhviVV7wJnCWpL4uMz8IvY5sFALpYdh6wTc,21869
|
|
35
35
|
lamindb_setup/core/_settings_load.py,sha256=JWd0_hBy04xjKo-tH4y8C9RkaywjrmoT0PsKzVme0n4,5176
|
|
36
36
|
lamindb_setup/core/_settings_save.py,sha256=XZx-vow7BT6y3JpRBB2UOJp2vwc7jOGea4wSgOPqjPU,3262
|
|
37
37
|
lamindb_setup/core/_settings_storage.py,sha256=S9AvKLzJX0M_RsYcBKZB_P84CYtTY0hyeffYE3UqrQA,15478
|
|
38
38
|
lamindb_setup/core/_settings_store.py,sha256=QmeWIGdIyq7UmjfHiEB_0xRD8hY-8-ZR2WntIKfwTKI,2714
|
|
39
|
-
lamindb_setup/core/_settings_user.py,sha256=
|
|
39
|
+
lamindb_setup/core/_settings_user.py,sha256=gFfyMf-738onbh1Mf4wsmLlenQJPtjQfpUgKnOlqc2o,1453
|
|
40
40
|
lamindb_setup/core/_setup_bionty_sources.py,sha256=ox3X-SHiHa2lNPSWjwZhINypbLacX6kGwH6hVVrSFZc,1505
|
|
41
41
|
lamindb_setup/core/cloud_sqlite_locker.py,sha256=H_CTUCjURFXwD1cCtV_Jn0_60iztZTkaesLLXIBgIxc,7204
|
|
42
|
-
lamindb_setup/core/django.py,sha256=
|
|
42
|
+
lamindb_setup/core/django.py,sha256=MPBcapHL6mH_ebin32aales0JL3AMYqHXUut8ggVFtY,9664
|
|
43
43
|
lamindb_setup/core/exceptions.py,sha256=qjMzqy_uzPA7mCOdnoWnS_fdA6OWbdZGftz-YYplrY0,84
|
|
44
44
|
lamindb_setup/core/hashing.py,sha256=Y8Uc5uSGTfU6L2R_gb5w8DdHhGRog7RnkK-e9FEMjPY,3680
|
|
45
45
|
lamindb_setup/core/types.py,sha256=T7NwspfRHgIIpYsXDcApks8jkOlGeGRW-YbVLB7jNIo,67
|
|
46
46
|
lamindb_setup/core/upath.py,sha256=W47O9-Y205j29iWJ3RKKdomA587hGvoiD6_krASGFcM,35315
|
|
47
|
-
lamindb_setup-1.8.
|
|
48
|
-
lamindb_setup-1.8.
|
|
49
|
-
lamindb_setup-1.8.
|
|
50
|
-
lamindb_setup-1.8.
|
|
47
|
+
lamindb_setup-1.8.3.dist-info/LICENSE,sha256=UOZ1F5fFDe3XXvG4oNnkL1-Ecun7zpHzRxjp-XsMeAo,11324
|
|
48
|
+
lamindb_setup-1.8.3.dist-info/WHEEL,sha256=CpUCUxeHQbRN5UGRQHYRJorO5Af-Qy_fHMctcQ8DSGI,82
|
|
49
|
+
lamindb_setup-1.8.3.dist-info/METADATA,sha256=nua4OQ80w2e2G-gik39js5-KCXteq9hINyHknrw0NGI,1797
|
|
50
|
+
lamindb_setup-1.8.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|