lamindb_setup 1.7.0__tar.gz → 1.7.1__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-1.7.0 → lamindb_setup-1.7.1}/PKG-INFO +1 -1
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/docs/hub-cloud/08-test-multi-session.ipynb +37 -10
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/lamindb_setup/__init__.py +1 -1
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/lamindb_setup/_connect_instance.py +7 -4
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/lamindb_setup/_init_instance.py +11 -3
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/.github/workflows/build.yml +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/.github/workflows/doc-changes.yml +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/.gitignore +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/.pre-commit-config.yaml +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/LICENSE +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/README.md +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/docs/changelog.md +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/docs/hub-cloud/01-init-local-instance.ipynb +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/docs/hub-cloud/02-connect-local-instance.ipynb +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/docs/hub-cloud/03-add-managed-storage.ipynb +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/docs/hub-cloud/04-test-bionty.ipynb +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/docs/hub-cloud/05-init-hosted-instance.ipynb +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/docs/hub-cloud/06-connect-hosted-instance.ipynb +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/docs/hub-cloud/07-keep-artifacts-local.ipynb +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/docs/hub-cloud/test_notebooks.py +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/docs/hub-prod/test-cache-management.ipynb +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/docs/hub-prod/test-cloud-sync.ipynb +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/docs/hub-prod/test-connect-anonymously.ipynb +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/docs/hub-prod/test-empty-init.ipynb +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/docs/hub-prod/test-import-schema.ipynb +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/docs/hub-prod/test-init-load-local-anonymously.ipynb +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/docs/hub-prod/test-insufficient-user-info.ipynb +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/docs/hub-prod/test-invalid-schema.ipynb +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/docs/hub-prod/test-sqlite-lock.ipynb +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/docs/hub-prod/test_notebooks2.py +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/docs/index.md +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/docs/notebooks.md +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/docs/reference.md +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/lamindb_setup/_cache.py +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/lamindb_setup/_check.py +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/lamindb_setup/_check_setup.py +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/lamindb_setup/_delete.py +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/lamindb_setup/_disconnect.py +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/lamindb_setup/_django.py +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/lamindb_setup/_entry_points.py +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/lamindb_setup/_exportdb.py +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/lamindb_setup/_importdb.py +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/lamindb_setup/_migrate.py +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/lamindb_setup/_register_instance.py +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/lamindb_setup/_schema.py +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/lamindb_setup/_schema_metadata.py +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/lamindb_setup/_set_managed_storage.py +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/lamindb_setup/_setup_user.py +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/lamindb_setup/_silence_loggers.py +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/lamindb_setup/core/__init__.py +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/lamindb_setup/core/_aws_options.py +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/lamindb_setup/core/_aws_storage.py +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/lamindb_setup/core/_deprecated.py +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/lamindb_setup/core/_docs.py +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/lamindb_setup/core/_hub_client.py +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/lamindb_setup/core/_hub_core.py +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/lamindb_setup/core/_hub_crud.py +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/lamindb_setup/core/_hub_utils.py +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/lamindb_setup/core/_private_django_api.py +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/lamindb_setup/core/_settings.py +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/lamindb_setup/core/_settings_instance.py +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/lamindb_setup/core/_settings_load.py +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/lamindb_setup/core/_settings_save.py +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/lamindb_setup/core/_settings_storage.py +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/lamindb_setup/core/_settings_store.py +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/lamindb_setup/core/_settings_user.py +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/lamindb_setup/core/_setup_bionty_sources.py +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/lamindb_setup/core/cloud_sqlite_locker.py +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/lamindb_setup/core/django.py +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/lamindb_setup/core/exceptions.py +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/lamindb_setup/core/hashing.py +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/lamindb_setup/core/types.py +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/lamindb_setup/core/upath.py +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/lamindb_setup/errors.py +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/lamindb_setup/py.typed +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/lamindb_setup/types.py +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/noxfile.py +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/pyproject.toml +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/tests/hub-cloud/scripts/script-init-pass-user-no-writes.py +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/tests/hub-cloud/scripts/script-to-fail-managed-storage.py +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/tests/hub-cloud/test_connect_instance.py +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/tests/hub-cloud/test_delete_instance.py +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/tests/hub-cloud/test_edge_request.py +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/tests/hub-cloud/test_fail_managed_storage.py +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/tests/hub-cloud/test_init_instance.py +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/tests/hub-cloud/test_init_pass_user_no_writes.py +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/tests/hub-cloud/test_login.py +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/tests/hub-cloud/test_migrate.py +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/tests/hub-cloud/test_set_storage.py +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/tests/hub-local/conftest.py +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/tests/hub-local/scripts/script-connect-fine-grained-access.py +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/tests/hub-local/test_all.py +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/tests/hub-local/test_update_schema_in_hub.py +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/tests/hub-prod/conftest.py +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/tests/hub-prod/test_aws_options_manager.py +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/tests/hub-prod/test_django.py +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/tests/hub-prod/test_global_settings.py +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/tests/hub-prod/test_switch_and_fallback_env.py +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/tests/hub-prod/test_upath.py +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/tests/storage/test_entry_point.py +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/tests/storage/test_hashing.py +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/tests/storage/test_storage_access.py +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/tests/storage/test_storage_basis.py +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/tests/storage/test_storage_settings.py +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/tests/storage/test_storage_stats.py +0 -0
- {lamindb_setup-1.7.0 → lamindb_setup-1.7.1}/tests/storage/test_to_url.py +0 -0
|
@@ -54,15 +54,6 @@
|
|
|
54
54
|
"ln_setup.init(storage=\"./testsetup\")"
|
|
55
55
|
]
|
|
56
56
|
},
|
|
57
|
-
{
|
|
58
|
-
"cell_type": "code",
|
|
59
|
-
"execution_count": null,
|
|
60
|
-
"metadata": {},
|
|
61
|
-
"outputs": [],
|
|
62
|
-
"source": [
|
|
63
|
-
"assert ln_setup.settings.instance.slug == \"testuser1/testsetup\""
|
|
64
|
-
]
|
|
65
|
-
},
|
|
66
57
|
{
|
|
67
58
|
"cell_type": "code",
|
|
68
59
|
"execution_count": null,
|
|
@@ -120,7 +111,43 @@
|
|
|
120
111
|
"cell_type": "markdown",
|
|
121
112
|
"metadata": {},
|
|
122
113
|
"source": [
|
|
123
|
-
"
|
|
114
|
+
"Let us try to init another instance in the same Python session:"
|
|
115
|
+
]
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"cell_type": "code",
|
|
119
|
+
"execution_count": null,
|
|
120
|
+
"metadata": {},
|
|
121
|
+
"outputs": [],
|
|
122
|
+
"source": [
|
|
123
|
+
"from lamindb_setup._init_instance import CannotSwitchDefaultInstance\n",
|
|
124
|
+
"\n",
|
|
125
|
+
"with pytest.raises(CannotSwitchDefaultInstance):\n",
|
|
126
|
+
" ln_setup.init(storage=\"./testsetup2\")\n",
|
|
127
|
+
"with pytest.raises(CannotSwitchDefaultInstance):\n",
|
|
128
|
+
" ln_setup.connect(\"testsetup\")\n",
|
|
129
|
+
"with pytest.raises(RuntimeError):\n",
|
|
130
|
+
" ln_setup.migrate.create()\n",
|
|
131
|
+
"with pytest.raises(RuntimeError):\n",
|
|
132
|
+
" ln_setup.migrate.deploy()\n",
|
|
133
|
+
"\n",
|
|
134
|
+
"assert ln_setup.settings.instance.slug == \"testuser1/testsetup\""
|
|
135
|
+
]
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"cell_type": "markdown",
|
|
139
|
+
"metadata": {},
|
|
140
|
+
"source": [
|
|
141
|
+
"Reset `django` and connect to another instance:"
|
|
142
|
+
]
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"cell_type": "code",
|
|
146
|
+
"execution_count": null,
|
|
147
|
+
"metadata": {},
|
|
148
|
+
"outputs": [],
|
|
149
|
+
"source": [
|
|
150
|
+
"ln_setup.core.django.reset_django()"
|
|
124
151
|
]
|
|
125
152
|
},
|
|
126
153
|
{
|
|
@@ -9,7 +9,10 @@ from lamin_utils import logger
|
|
|
9
9
|
|
|
10
10
|
from ._check_setup import _check_instance_setup, _get_current_instance_settings
|
|
11
11
|
from ._disconnect import disconnect
|
|
12
|
-
from ._init_instance import
|
|
12
|
+
from ._init_instance import (
|
|
13
|
+
MESSAGE_CANNOT_SWITCH_DEFAULT_INSTANCE,
|
|
14
|
+
load_from_isettings,
|
|
15
|
+
)
|
|
13
16
|
from ._silence_loggers import silence_loggers
|
|
14
17
|
from .core._hub_core import connect_instance_hub
|
|
15
18
|
from .core._hub_utils import (
|
|
@@ -238,9 +241,9 @@ def connect(instance: str | None = None, **kwargs: Any) -> str | tuple | None:
|
|
|
238
241
|
logger.important(f"connected lamindb: {settings.instance.slug}")
|
|
239
242
|
return None
|
|
240
243
|
else:
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
+
raise CannotSwitchDefaultInstance(
|
|
245
|
+
MESSAGE_CANNOT_SWITCH_DEFAULT_INSTANCE
|
|
246
|
+
)
|
|
244
247
|
elif (
|
|
245
248
|
_write_settings
|
|
246
249
|
and settings._instance_exists
|
|
@@ -215,6 +215,16 @@ def validate_init_args(
|
|
|
215
215
|
return name_str, instance_id, instance_state, instance_slug
|
|
216
216
|
|
|
217
217
|
|
|
218
|
+
MESSAGE_CANNOT_SWITCH_DEFAULT_INSTANCE = """
|
|
219
|
+
You cannot write to different instances in the same Python session.
|
|
220
|
+
|
|
221
|
+
Do you want to read from another instance via `SQLRecord.using()`? For example:
|
|
222
|
+
|
|
223
|
+
ln.Artifact.using("laminlabs/cellxgene").filter()
|
|
224
|
+
|
|
225
|
+
Or do you want to switch off auto-connect via `lamin settings set auto-connect false`?
|
|
226
|
+
"""
|
|
227
|
+
|
|
218
228
|
DOC_STORAGE_ARG = "A local or remote folder (`'s3://...'` or `'gs://...'`). Defaults to current working directory."
|
|
219
229
|
DOC_INSTANCE_NAME = (
|
|
220
230
|
"Instance name. If not passed, it will equal the folder name passed to `storage`."
|
|
@@ -262,9 +272,7 @@ def init(
|
|
|
262
272
|
from ._check_setup import _check_instance_setup
|
|
263
273
|
|
|
264
274
|
if _check_instance_setup() and not _test:
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
reset_django()
|
|
275
|
+
raise CannotSwitchDefaultInstance(MESSAGE_CANNOT_SWITCH_DEFAULT_INSTANCE)
|
|
268
276
|
elif _write_settings:
|
|
269
277
|
disconnect(mute=True)
|
|
270
278
|
from .core._hub_core import init_instance_hub
|
|
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-1.7.0 → lamindb_setup-1.7.1}/docs/hub-prod/test-init-load-local-anonymously.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
|
|
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-1.7.0 → lamindb_setup-1.7.1}/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
|
|
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
|