lamindb_setup 0.81.3__tar.gz → 0.81.5__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.81.3 → lamindb_setup-0.81.5}/PKG-INFO +2 -2
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/lamindb_setup/__init__.py +1 -1
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/lamindb_setup/_check_setup.py +44 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/lamindb_setup/_migrate.py +5 -8
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/.github/workflows/build.yml +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/.github/workflows/doc-changes.yml +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/.gitignore +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/.pre-commit-config.yaml +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/LICENSE +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/README.md +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/docs/changelog.md +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/docs/hub-cloud/01-init-local-instance.ipynb +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/docs/hub-cloud/02-connect-local-instance.ipynb +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/docs/hub-cloud/03-add-managed-storage.ipynb +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/docs/hub-cloud/04-test-bionty.ipynb +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/docs/hub-cloud/05-init-hosted-instance.ipynb +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/docs/hub-cloud/06-connect-hosted-instance.ipynb +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/docs/hub-cloud/07-keep-artifacts-local.ipynb +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/docs/hub-cloud/08-test-multi-session.ipynb +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/docs/hub-cloud/test_notebooks.py +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/docs/hub-prod/test-cache-management.ipynb +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/docs/hub-prod/test-cloud-sync.ipynb +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/docs/hub-prod/test-connect-anonymously.ipynb +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/docs/hub-prod/test-empty-init.ipynb +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/docs/hub-prod/test-import-schema.ipynb +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/docs/hub-prod/test-init-load-local-anonymously.ipynb +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/docs/hub-prod/test-insufficient-user-info.ipynb +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/docs/hub-prod/test-invalid-schema.ipynb +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/docs/hub-prod/test-sqlite-lock.ipynb +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/docs/hub-prod/test_notebooks2.py +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/docs/index.md +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/docs/notebooks.md +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/docs/reference.md +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/lamindb_setup/_cache.py +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/lamindb_setup/_check.py +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/lamindb_setup/_close.py +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/lamindb_setup/_connect_instance.py +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/lamindb_setup/_delete.py +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/lamindb_setup/_django.py +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/lamindb_setup/_entry_points.py +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/lamindb_setup/_exportdb.py +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/lamindb_setup/_importdb.py +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/lamindb_setup/_init_instance.py +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/lamindb_setup/_register_instance.py +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/lamindb_setup/_schema.py +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/lamindb_setup/_schema_metadata.py +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/lamindb_setup/_set_managed_storage.py +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/lamindb_setup/_setup_user.py +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/lamindb_setup/_silence_loggers.py +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/lamindb_setup/core/__init__.py +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/lamindb_setup/core/_aws_credentials.py +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/lamindb_setup/core/_aws_storage.py +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/lamindb_setup/core/_deprecated.py +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/lamindb_setup/core/_docs.py +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/lamindb_setup/core/_hub_client.py +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/lamindb_setup/core/_hub_core.py +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/lamindb_setup/core/_hub_crud.py +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/lamindb_setup/core/_hub_utils.py +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/lamindb_setup/core/_private_django_api.py +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/lamindb_setup/core/_settings.py +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/lamindb_setup/core/_settings_instance.py +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/lamindb_setup/core/_settings_load.py +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/lamindb_setup/core/_settings_save.py +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/lamindb_setup/core/_settings_storage.py +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/lamindb_setup/core/_settings_store.py +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/lamindb_setup/core/_settings_user.py +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/lamindb_setup/core/_setup_bionty_sources.py +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/lamindb_setup/core/cloud_sqlite_locker.py +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/lamindb_setup/core/django.py +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/lamindb_setup/core/exceptions.py +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/lamindb_setup/core/hashing.py +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/lamindb_setup/core/types.py +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/lamindb_setup/core/upath.py +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/noxfile.py +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/pyproject.toml +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/tests/hub-cloud/scripts/script-init-pass-user-no-writes.py +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/tests/hub-cloud/scripts/script-to-fail-managed-storage.py +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/tests/hub-cloud/test_connect_instance.py +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/tests/hub-cloud/test_delete_instance.py +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/tests/hub-cloud/test_edge_request.py +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/tests/hub-cloud/test_fail_managed_storage.py +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/tests/hub-cloud/test_init_instance.py +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/tests/hub-cloud/test_init_pass_user_no_writes.py +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/tests/hub-cloud/test_login.py +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/tests/hub-cloud/test_migrate.py +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/tests/hub-cloud/test_set_storage.py +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/tests/hub-local/conftest.py +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/tests/hub-local/test_all.py +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/tests/hub-local/test_update_schema_in_hub.py +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/tests/hub-prod/conftest.py +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/tests/hub-prod/test_aws_credentials_manager.py +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/tests/hub-prod/test_django.py +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/tests/hub-prod/test_global_settings.py +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/tests/hub-prod/test_switch_and_fallback_env.py +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/tests/hub-prod/test_upath.py +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/tests/storage/test_entry_point.py +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/tests/storage/test_hashing.py +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/tests/storage/test_storage_access.py +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/tests/storage/test_storage_basis.py +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/tests/storage/test_storage_stats.py +0 -0
- {lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/tests/storage/test_to_url.py +0 -0
|
@@ -52,6 +52,49 @@ def _get_current_instance_settings() -> InstanceSettings | None:
|
|
|
52
52
|
return None
|
|
53
53
|
|
|
54
54
|
|
|
55
|
+
def check_connecting_to_v1_instance(isettings: InstanceSettings):
|
|
56
|
+
from urllib.parse import urlparse
|
|
57
|
+
|
|
58
|
+
# we need to do this because the sqlite file should be already synced
|
|
59
|
+
# has no effect if not cloud sqlite
|
|
60
|
+
# errors if the sqlite file is not in the cloud and doesn't exist locally
|
|
61
|
+
# isettings.db syncs but doesn't error in this case due to error_no_origin=False
|
|
62
|
+
isettings._update_local_sqlite_file()
|
|
63
|
+
|
|
64
|
+
parsed_uri = urlparse(isettings.db)
|
|
65
|
+
db_type = parsed_uri.scheme
|
|
66
|
+
|
|
67
|
+
if db_type == "sqlite":
|
|
68
|
+
import sqlite3
|
|
69
|
+
|
|
70
|
+
conn = sqlite3.connect(parsed_uri.path)
|
|
71
|
+
elif db_type in ["postgresql", "postgres"]:
|
|
72
|
+
import psycopg2
|
|
73
|
+
|
|
74
|
+
conn = psycopg2.connect(isettings.db)
|
|
75
|
+
else:
|
|
76
|
+
raise ValueError("Unsupported database type. Use 'sqlite' or 'postgresql' URI.")
|
|
77
|
+
|
|
78
|
+
cur = conn.cursor()
|
|
79
|
+
|
|
80
|
+
if db_type == "sqlite":
|
|
81
|
+
cur.execute(
|
|
82
|
+
"SELECT name FROM sqlite_master WHERE type='table' AND name='lamindb_user'"
|
|
83
|
+
)
|
|
84
|
+
isv1 = cur.fetchone() is not None
|
|
85
|
+
|
|
86
|
+
else: # postgres
|
|
87
|
+
cur.execute(
|
|
88
|
+
"SELECT EXISTS (SELECT FROM information_schema.tables WHERE table_name = 'lamindb_user')"
|
|
89
|
+
)
|
|
90
|
+
isv1 = cur.fetchone()[0]
|
|
91
|
+
|
|
92
|
+
if isv1:
|
|
93
|
+
raise SystemExit(
|
|
94
|
+
"This instance runs lamindb v1. Please run: pip install 'lamindb[bionty,wetlab,clinicore,ourprojects]'>1.0.0"
|
|
95
|
+
)
|
|
96
|
+
|
|
97
|
+
|
|
55
98
|
# we make this a private function because in all the places it's used,
|
|
56
99
|
# users should not see it
|
|
57
100
|
def _check_instance_setup(
|
|
@@ -77,6 +120,7 @@ def _check_instance_setup(
|
|
|
77
120
|
if isettings is not None:
|
|
78
121
|
if reload_module and settings.auto_connect:
|
|
79
122
|
if not django.IS_SETUP:
|
|
123
|
+
check_connecting_to_v1_instance(isettings)
|
|
80
124
|
django.setup_django(isettings)
|
|
81
125
|
if from_module is not None:
|
|
82
126
|
# this only reloads `from_module`
|
|
@@ -28,14 +28,11 @@ def check_whether_migrations_in_sync(db_version_str: str):
|
|
|
28
28
|
or installed_version.minor < db_version.minor
|
|
29
29
|
):
|
|
30
30
|
db_version_lower = f"{db_version.major}.{db_version.minor}"
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
f"
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
logger.important(
|
|
37
|
-
"please update lamindb: pip install"
|
|
38
|
-
f' "lamindb>={db_version_lower},<{db_version_upper}"'
|
|
31
|
+
raise SystemExit(
|
|
32
|
+
f"The database ({db_version_str}) is ahead of your installed lamindb"
|
|
33
|
+
f" package ({installed_version_str})\n"
|
|
34
|
+
"Please update lamindb: pip install"
|
|
35
|
+
f" 'lamindb[bionty,wetlab,clinicore,ourprojects]'>={db_version_lower}"
|
|
39
36
|
)
|
|
40
37
|
elif (
|
|
41
38
|
installed_version.major > db_version.major
|
|
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.81.3 → lamindb_setup-0.81.5}/docs/hub-cloud/02-connect-local-instance.ipynb
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/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.81.3 → lamindb_setup-0.81.5}/docs/hub-prod/test-init-load-local-anonymously.ipynb
RENAMED
|
File without changes
|
{lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/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
|
|
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.81.3 → lamindb_setup-0.81.5}/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
|
{lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/tests/hub-prod/test_aws_credentials_manager.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{lamindb_setup-0.81.3 → lamindb_setup-0.81.5}/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
|