lamindb_setup 0.77.5__tar.gz → 0.77.6__tar.gz
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-0.77.5 → lamindb_setup-0.77.6}/PKG-INFO +3 -2
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/lamindb_setup/__init__.py +1 -2
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/lamindb_setup/_check_setup.py +20 -7
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/lamindb_setup/_connect_instance.py +6 -12
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/lamindb_setup/_init_instance.py +5 -11
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/lamindb_setup/_migrate.py +3 -3
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/lamindb_setup/core/_hub_client.py +1 -1
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/lamindb_setup/core/_hub_core.py +8 -4
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/lamindb_setup/core/_settings.py +9 -2
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/lamindb_setup/core/_settings_user.py +2 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/lamindb_setup/core/django.py +1 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/noxfile.py +2 -2
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/pyproject.toml +2 -1
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/.github/workflows/build.yml +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/.github/workflows/doc-changes.yml +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/.gitignore +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/.pre-commit-config.yaml +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/LICENSE +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/README.md +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/docs/changelog.md +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/docs/hub-cloud/01-init-local-instance.ipynb +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/docs/hub-cloud/02-connect-local-instance.ipynb +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/docs/hub-cloud/03-add-managed-storage.ipynb +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/docs/hub-cloud/04-test-bionty.ipynb +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/docs/hub-cloud/05-init-hosted-instance.ipynb +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/docs/hub-cloud/06-connect-hosted-instance.ipynb +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/docs/hub-cloud/07-keep-artifacts-local.ipynb +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/docs/hub-cloud/08-test-multi-session.ipynb +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/docs/hub-cloud/test_notebooks.py +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/docs/hub-prod/test-cache-management.ipynb +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/docs/hub-prod/test-cloud-sync.ipynb +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/docs/hub-prod/test-connect-anonymously.ipynb +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/docs/hub-prod/test-empty-init.ipynb +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/docs/hub-prod/test-import-schema.ipynb +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/docs/hub-prod/test-init-load-local-anonymously.ipynb +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/docs/hub-prod/test-insufficient-user-info.ipynb +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/docs/hub-prod/test-invalid-schema.ipynb +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/docs/hub-prod/test-sqlite-lock.ipynb +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/docs/hub-prod/test_notebooks2.py +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/docs/index.md +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/docs/notebooks.md +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/docs/reference.md +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/lamindb_setup/_cache.py +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/lamindb_setup/_check.py +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/lamindb_setup/_close.py +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/lamindb_setup/_delete.py +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/lamindb_setup/_django.py +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/lamindb_setup/_entry_points.py +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/lamindb_setup/_exportdb.py +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/lamindb_setup/_importdb.py +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/lamindb_setup/_register_instance.py +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/lamindb_setup/_schema.py +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/lamindb_setup/_schema_metadata.py +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/lamindb_setup/_set_managed_storage.py +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/lamindb_setup/_setup_user.py +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/lamindb_setup/_silence_loggers.py +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/lamindb_setup/core/__init__.py +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/lamindb_setup/core/_aws_credentials.py +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/lamindb_setup/core/_aws_storage.py +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/lamindb_setup/core/_deprecated.py +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/lamindb_setup/core/_docs.py +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/lamindb_setup/core/_hub_crud.py +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/lamindb_setup/core/_hub_utils.py +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/lamindb_setup/core/_private_django_api.py +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/lamindb_setup/core/_settings_instance.py +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/lamindb_setup/core/_settings_load.py +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/lamindb_setup/core/_settings_save.py +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/lamindb_setup/core/_settings_storage.py +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/lamindb_setup/core/_settings_store.py +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/lamindb_setup/core/_setup_bionty_sources.py +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/lamindb_setup/core/cloud_sqlite_locker.py +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/lamindb_setup/core/exceptions.py +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/lamindb_setup/core/hashing.py +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/lamindb_setup/core/types.py +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/lamindb_setup/core/upath.py +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/tests/hub-cloud/scripts/script-init-pass-user-no-writes.py +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/tests/hub-cloud/scripts/script-to-fail-managed-storage.py +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/tests/hub-cloud/test_connect_instance.py +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/tests/hub-cloud/test_delete_instance.py +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/tests/hub-cloud/test_fail_managed_storage.py +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/tests/hub-cloud/test_init_instance.py +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/tests/hub-cloud/test_init_pass_user_no_writes.py +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/tests/hub-cloud/test_login.py +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/tests/hub-cloud/test_migrate.py +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/tests/hub-cloud/test_set_storage.py +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/tests/hub-local/conftest.py +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/tests/hub-local/test_all.py +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/tests/hub-local/test_update_schema_in_hub.py +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/tests/hub-prod/conftest.py +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/tests/hub-prod/test_django.py +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/tests/hub-prod/test_global_settings.py +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/tests/hub-prod/test_switch_and_fallback_env.py +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/tests/hub-prod/test_upath.py +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/tests/storage/test_entry_point.py +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/tests/storage/test_hashing.py +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/tests/storage/test_storage_access.py +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/tests/storage/test_storage_basis.py +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/tests/storage/test_storage_stats.py +0 -0
- {lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/tests/storage/test_to_url.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: lamindb_setup
|
|
3
|
-
Version: 0.77.
|
|
3
|
+
Version: 0.77.6
|
|
4
4
|
Summary: Setup & configure LaminDB.
|
|
5
5
|
Author-email: Lamin Labs <open-source@lamin.ai>
|
|
6
6
|
Description-Content-Type: text/markdown
|
|
@@ -13,12 +13,13 @@ Requires-Dist: appdirs<2.0.0
|
|
|
13
13
|
Requires-Dist: requests
|
|
14
14
|
Requires-Dist: universal_pathlib==0.2.2
|
|
15
15
|
Requires-Dist: botocore<2.0.0
|
|
16
|
-
Requires-Dist: gotrue>=2.1.0
|
|
16
|
+
Requires-Dist: gotrue>=2.1.0,<2.9.0
|
|
17
17
|
Requires-Dist: supabase==2.2.1
|
|
18
18
|
Requires-Dist: psutil
|
|
19
19
|
Requires-Dist: urllib3<2 ; extra == "aws"
|
|
20
20
|
Requires-Dist: aiobotocore[boto3]>=2.5.4,<3.0.0 ; extra == "aws"
|
|
21
21
|
Requires-Dist: s3fs>=2023.12.2,<=2024.6.1 ; extra == "aws"
|
|
22
|
+
Requires-Dist: line_profiler ; extra == "dev"
|
|
22
23
|
Requires-Dist: pyjwt<3.0.0 ; extra == "dev"
|
|
23
24
|
Requires-Dist: psycopg2-binary ; extra == "dev"
|
|
24
25
|
Requires-Dist: python-dotenv ; extra == "dev"
|
|
@@ -21,7 +21,6 @@ Instance operations:
|
|
|
21
21
|
:toctree:
|
|
22
22
|
|
|
23
23
|
migrate
|
|
24
|
-
register
|
|
25
24
|
|
|
26
25
|
Modules & settings:
|
|
27
26
|
|
|
@@ -34,7 +33,7 @@ Modules & settings:
|
|
|
34
33
|
|
|
35
34
|
"""
|
|
36
35
|
|
|
37
|
-
__version__ = "0.77.
|
|
36
|
+
__version__ = "0.77.6" # denote a release candidate for 0.1.0 with 0.1rc1
|
|
38
37
|
|
|
39
38
|
import os as _os
|
|
40
39
|
import sys as _sys
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
+
import importlib as il
|
|
3
4
|
import os
|
|
4
5
|
from typing import TYPE_CHECKING, Optional
|
|
5
6
|
|
|
@@ -52,9 +53,18 @@ def _get_current_instance_settings() -> InstanceSettings | None:
|
|
|
52
53
|
|
|
53
54
|
|
|
54
55
|
# we make this a private function because in all the places it's used,
|
|
55
|
-
# users should see it
|
|
56
|
-
def _check_instance_setup(
|
|
56
|
+
# users should not see it
|
|
57
|
+
def _check_instance_setup(
|
|
58
|
+
from_lamindb: bool = False, from_module: str | None = None
|
|
59
|
+
) -> bool:
|
|
60
|
+
reload_module = from_lamindb or from_module is not None
|
|
61
|
+
from ._init_instance import get_schema_module_name, reload_schema_modules
|
|
62
|
+
|
|
57
63
|
if django.IS_SETUP:
|
|
64
|
+
# reload logic here because module might not yet have been imported
|
|
65
|
+
# upon first setup
|
|
66
|
+
if from_module is not None:
|
|
67
|
+
il.reload(il.import_module(from_module))
|
|
58
68
|
return True
|
|
59
69
|
silence_loggers()
|
|
60
70
|
if os.environ.get("LAMINDB_MULTI_INSTANCE") == "true":
|
|
@@ -65,15 +75,18 @@ def _check_instance_setup(from_lamindb: bool = False) -> bool:
|
|
|
65
75
|
return True
|
|
66
76
|
isettings = _get_current_instance_settings()
|
|
67
77
|
if isettings is not None:
|
|
68
|
-
if
|
|
78
|
+
if reload_module and settings.auto_connect:
|
|
69
79
|
if not django.IS_SETUP:
|
|
70
|
-
from ._init_instance import reload_schema_modules
|
|
71
|
-
|
|
72
80
|
django.setup_django(isettings)
|
|
73
|
-
|
|
81
|
+
if from_module is not None:
|
|
82
|
+
# this only reloads `from_module`
|
|
83
|
+
il.reload(il.import_module(from_module))
|
|
84
|
+
else:
|
|
85
|
+
# this bulk reloads all schema modules
|
|
86
|
+
reload_schema_modules(isettings)
|
|
74
87
|
logger.important(f"connected lamindb: {isettings.slug}")
|
|
75
88
|
return django.IS_SETUP
|
|
76
89
|
else:
|
|
77
|
-
if
|
|
90
|
+
if reload_module and settings.auto_connect:
|
|
78
91
|
logger.warning(InstanceNotSetupError.default_message)
|
|
79
92
|
return False
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
import os
|
|
4
|
+
import sys
|
|
4
5
|
from typing import TYPE_CHECKING
|
|
5
6
|
from uuid import UUID
|
|
6
7
|
|
|
@@ -9,10 +10,8 @@ from lamin_utils import logger
|
|
|
9
10
|
from ._check_setup import _check_instance_setup
|
|
10
11
|
from ._close import close as close_instance
|
|
11
12
|
from ._init_instance import MESSAGE_NO_MULTIPLE_INSTANCE, load_from_isettings
|
|
12
|
-
from ._migrate import check_whether_migrations_in_sync
|
|
13
13
|
from ._silence_loggers import silence_loggers
|
|
14
|
-
from .core._hub_core import connect_instance as
|
|
15
|
-
from .core._hub_core import connect_instance_new as load_instance_from_hub_edge
|
|
14
|
+
from .core._hub_core import connect_instance as connect_instance_from_hub
|
|
16
15
|
from .core._hub_utils import (
|
|
17
16
|
LaminDsn,
|
|
18
17
|
LaminDsnModel,
|
|
@@ -129,14 +128,9 @@ def _connect_instance(
|
|
|
129
128
|
# on the hub
|
|
130
129
|
# do not call hub if the user is anonymous
|
|
131
130
|
if owner != "anonymous":
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
)
|
|
136
|
-
else:
|
|
137
|
-
hub_result = load_instance_from_hub(
|
|
138
|
-
owner=owner, name=name, access_token=access_token
|
|
139
|
-
)
|
|
131
|
+
hub_result = connect_instance_from_hub(
|
|
132
|
+
owner=owner, name=name, access_token=access_token
|
|
133
|
+
)
|
|
140
134
|
else:
|
|
141
135
|
hub_result = "anonymous-user"
|
|
142
136
|
# if hub_result is not a string, it means it made a request
|
|
@@ -167,7 +161,6 @@ def _connect_instance(
|
|
|
167
161
|
keep_artifacts_local=bool(instance_result["keep_artifacts_local"]),
|
|
168
162
|
is_on_hub=True,
|
|
169
163
|
)
|
|
170
|
-
check_whether_migrations_in_sync(instance_result["lamindb_version"])
|
|
171
164
|
else:
|
|
172
165
|
if hub_result != "anonymous-user":
|
|
173
166
|
message = INSTANCE_NOT_FOUND_MESSAGE.format(
|
|
@@ -313,6 +306,7 @@ def load(slug: str) -> str | tuple | None:
|
|
|
313
306
|
This is exactly the same as ``ln.connect()`` except for that
|
|
314
307
|
``ln.connect()`` doesn't change the state of ``auto-connect``.
|
|
315
308
|
"""
|
|
309
|
+
print("Warning: This is deprecated and will be removed.")
|
|
316
310
|
result = connect(slug)
|
|
317
311
|
settings.auto_connect = True
|
|
318
312
|
return result
|
|
@@ -97,8 +97,9 @@ def register_user_and_storage_in_instance(isettings: InstanceSettings, usettings
|
|
|
97
97
|
logger.warning(f"instance seems not set up ({error})")
|
|
98
98
|
|
|
99
99
|
|
|
100
|
-
def reload_schema_modules(isettings: InstanceSettings):
|
|
101
|
-
schema_names = ["core"]
|
|
100
|
+
def reload_schema_modules(isettings: InstanceSettings, include_core: bool = True):
|
|
101
|
+
schema_names = ["core"] if include_core else []
|
|
102
|
+
# schema_names += list(isettings.schema)
|
|
102
103
|
schema_module_names = [get_schema_module_name(n) for n in schema_names]
|
|
103
104
|
|
|
104
105
|
for schema_module_name in schema_module_names:
|
|
@@ -114,16 +115,10 @@ def reload_lamindb_itself(isettings) -> bool:
|
|
|
114
115
|
|
|
115
116
|
importlib.reload(lamindb)
|
|
116
117
|
reloaded = True
|
|
117
|
-
if "bionty" in isettings.schema and "bionty" in sys.modules:
|
|
118
|
-
schema_module = importlib.import_module("bionty")
|
|
119
|
-
importlib.reload(schema_module)
|
|
120
|
-
reloaded = True
|
|
121
118
|
return reloaded
|
|
122
119
|
|
|
123
120
|
|
|
124
121
|
def reload_lamindb(isettings: InstanceSettings):
|
|
125
|
-
# only touch lamindb if we're operating from lamindb
|
|
126
|
-
reload_schema_modules(isettings)
|
|
127
122
|
log_message = settings.auto_connect
|
|
128
123
|
if not reload_lamindb_itself(isettings):
|
|
129
124
|
log_message = True
|
|
@@ -214,7 +209,7 @@ def validate_init_args(
|
|
|
214
209
|
MESSAGE_NO_MULTIPLE_INSTANCE = """
|
|
215
210
|
Currently don't support subsequent connection to different databases in the same
|
|
216
211
|
Python session.\n
|
|
217
|
-
Try running on the CLI: lamin set auto-connect false
|
|
212
|
+
Try running on the CLI: lamin settings set auto-connect false
|
|
218
213
|
"""
|
|
219
214
|
|
|
220
215
|
|
|
@@ -352,7 +347,7 @@ def load_from_isettings(
|
|
|
352
347
|
user: UserSettings | None = None,
|
|
353
348
|
write_settings: bool = True,
|
|
354
349
|
) -> None:
|
|
355
|
-
from .core._setup_bionty_sources import
|
|
350
|
+
from .core._setup_bionty_sources import write_bionty_sources
|
|
356
351
|
|
|
357
352
|
user = settings.user if user is None else user
|
|
358
353
|
|
|
@@ -370,7 +365,6 @@ def load_from_isettings(
|
|
|
370
365
|
# yet be registered
|
|
371
366
|
if not isettings._get_settings_file().exists():
|
|
372
367
|
register_user(user)
|
|
373
|
-
load_bionty_sources(isettings)
|
|
374
368
|
isettings._persist(write_to_disk=write_settings)
|
|
375
369
|
reload_lamindb(isettings)
|
|
376
370
|
|
|
@@ -30,7 +30,7 @@ def check_whether_migrations_in_sync(db_version_str: str):
|
|
|
30
30
|
db_version_lower = f"{db_version.major}.{db_version.minor}"
|
|
31
31
|
db_version_upper = f"{db_version.major}.{db_version.minor + 1}"
|
|
32
32
|
logger.warning(
|
|
33
|
-
f"
|
|
33
|
+
f"the database ({db_version_str}) is ahead of your installed lamindb"
|
|
34
34
|
f" package ({installed_version_str})"
|
|
35
35
|
)
|
|
36
36
|
logger.important(
|
|
@@ -42,10 +42,10 @@ def check_whether_migrations_in_sync(db_version_str: str):
|
|
|
42
42
|
or installed_version.minor > db_version.minor
|
|
43
43
|
):
|
|
44
44
|
logger.warning(
|
|
45
|
-
f"
|
|
45
|
+
f"the database ({db_version_str}) is behind your installed lamindb package"
|
|
46
46
|
f" ({installed_version_str})"
|
|
47
47
|
)
|
|
48
|
-
logger.important("
|
|
48
|
+
logger.important("consider migrating your database: lamin migrate deploy")
|
|
49
49
|
|
|
50
50
|
|
|
51
51
|
# for tests, see lamin-cli
|
|
@@ -10,6 +10,8 @@ from uuid import UUID
|
|
|
10
10
|
from lamin_utils import logger
|
|
11
11
|
from postgrest.exceptions import APIError
|
|
12
12
|
|
|
13
|
+
from lamindb_setup._migrate import check_whether_migrations_in_sync
|
|
14
|
+
|
|
13
15
|
from ._hub_client import (
|
|
14
16
|
call_with_fallback,
|
|
15
17
|
call_with_fallback_auth,
|
|
@@ -381,6 +383,7 @@ def _connect_instance(
|
|
|
381
383
|
database=instance["db_database"],
|
|
382
384
|
)
|
|
383
385
|
instance["db"] = db_dsn
|
|
386
|
+
check_whether_migrations_in_sync(instance["lamindb_version"])
|
|
384
387
|
return instance, storage # type: ignore
|
|
385
388
|
|
|
386
389
|
|
|
@@ -390,7 +393,8 @@ def _connect_instance_new(
|
|
|
390
393
|
client: Client,
|
|
391
394
|
) -> tuple[dict, dict] | str:
|
|
392
395
|
response = client.functions.invoke(
|
|
393
|
-
"get-instance-settings",
|
|
396
|
+
"get-instance-settings-v1",
|
|
397
|
+
invoke_options={"body": {"owner": owner, "name": name}},
|
|
394
398
|
)
|
|
395
399
|
# no instance found, check why is that
|
|
396
400
|
if response == b"{}":
|
|
@@ -471,7 +475,7 @@ def _access_aws(*, storage_root: str, client: Client) -> dict[str, dict]:
|
|
|
471
475
|
|
|
472
476
|
storage_root_info: dict[str, dict] = {"credentials": {}, "accessibility": {}}
|
|
473
477
|
response = client.functions.invoke(
|
|
474
|
-
"access-
|
|
478
|
+
"get-cloud-access-v1",
|
|
475
479
|
invoke_options={"body": {"storage_root": storage_root}},
|
|
476
480
|
)
|
|
477
481
|
if response is not None and response != b"{}":
|
|
@@ -563,7 +567,7 @@ def sign_in_hub(
|
|
|
563
567
|
|
|
564
568
|
def _sign_in_hub_api_key(api_key: str, client: Client):
|
|
565
569
|
response = client.functions.invoke(
|
|
566
|
-
"
|
|
570
|
+
"get-jwt-v1",
|
|
567
571
|
invoke_options={"body": {"api_key": api_key}},
|
|
568
572
|
)
|
|
569
573
|
access_token = json.loads(response)["accessToken"]
|
|
@@ -599,7 +603,7 @@ def sign_in_hub_api_key(
|
|
|
599
603
|
|
|
600
604
|
def _create_api_key(body: dict, client: Client) -> str:
|
|
601
605
|
response = client.functions.invoke(
|
|
602
|
-
"create-api-key",
|
|
606
|
+
"create-api-key-v1",
|
|
603
607
|
invoke_options={"body": body},
|
|
604
608
|
)
|
|
605
609
|
api_key = json.loads(response)["apiKey"]
|
|
@@ -40,11 +40,18 @@ class SetupSettings:
|
|
|
40
40
|
|
|
41
41
|
@property
|
|
42
42
|
def auto_connect(self) -> bool:
|
|
43
|
-
"""Auto-connect to
|
|
43
|
+
"""Auto-connect to current instance upon `import lamindb`.
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
Upon installing `lamindb`, this setting is `False`.
|
|
46
|
+
|
|
47
|
+
Upon calling `lamin init` or `lamin connect` on the CLI, this setting is switched to `True`.
|
|
46
48
|
|
|
47
49
|
`ln.connect()` doesn't change the value of this setting.
|
|
50
|
+
|
|
51
|
+
You can manually change this setting
|
|
52
|
+
|
|
53
|
+
- in Python: `ln.setup.settings.auto_connect = True/False`
|
|
54
|
+
- via the CLI: `lamin settings set auto-connect true/false`
|
|
48
55
|
"""
|
|
49
56
|
return self._auto_connect_path.exists()
|
|
50
57
|
|
|
@@ -27,8 +27,8 @@ def lint(session: nox.Session) -> None:
|
|
|
27
27
|
["hub-local", "hub-prod", "hub-cloud", "storage", "docs"],
|
|
28
28
|
)
|
|
29
29
|
def install(session: nox.Session, group: str) -> None:
|
|
30
|
-
no_deps_packages = "git+https://github.com/laminlabs/lnschema-core git+https://github.com/laminlabs/wetlab git+https://github.com/laminlabs/lamin-cli"
|
|
31
|
-
schema_deps = f"""uv pip install --system git+https://github.com/laminlabs/bionty git+https://github.com/laminlabs/lamindb@
|
|
30
|
+
no_deps_packages = "git+https://github.com/laminlabs/lnschema-core git+https://github.com/laminlabs/wetlab@lazyreload git+https://github.com/laminlabs/lamin-cli"
|
|
31
|
+
schema_deps = f"""uv pip install --system git+https://github.com/laminlabs/bionty@lazyconnect git+https://github.com/laminlabs/lamindb@improvelaminconnect
|
|
32
32
|
uv pip install --system --no-deps {no_deps_packages}
|
|
33
33
|
"""
|
|
34
34
|
if group == "hub-cloud":
|
|
@@ -18,7 +18,7 @@ dependencies = [
|
|
|
18
18
|
"requests",
|
|
19
19
|
"universal_pathlib==0.2.2", # is still experimental, need pinning
|
|
20
20
|
"botocore<2.0.0",
|
|
21
|
-
"gotrue>=2.1.0", # for options in auth.sign_out
|
|
21
|
+
"gotrue>=2.1.0,<2.9.0", # lower - for options in auth.sign_out, upper - 2.9.0 fails
|
|
22
22
|
"supabase==2.2.1",
|
|
23
23
|
"psutil"
|
|
24
24
|
]
|
|
@@ -39,6 +39,7 @@ erdiagram = [
|
|
|
39
39
|
"django-schema-graph",
|
|
40
40
|
]
|
|
41
41
|
dev = [
|
|
42
|
+
"line_profiler",
|
|
42
43
|
"pyjwt<3.0.0",
|
|
43
44
|
"psycopg2-binary",
|
|
44
45
|
"python-dotenv",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/docs/hub-cloud/02-connect-local-instance.ipynb
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/docs/hub-cloud/06-connect-hosted-instance.ipynb
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/docs/hub-prod/test-init-load-local-anonymously.ipynb
RENAMED
|
File without changes
|
{lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/docs/hub-prod/test-insufficient-user-info.ipynb
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/tests/hub-cloud/test_init_pass_user_no_writes.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{lamindb_setup-0.77.5 → lamindb_setup-0.77.6}/tests/hub-prod/test_switch_and_fallback_env.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|