lamindb_setup 1.2.0__tar.gz → 1.3.0__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.2.0 → lamindb_setup-1.3.0}/PKG-INFO +2 -2
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/README.md +1 -1
- lamindb_setup-1.2.0/docs/hub-prod/test-connect-anonymously.ipynb → lamindb_setup-1.3.0/docs/hub-prod/test-connect-anonymously-set-token.ipynb +19 -2
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/lamindb_setup/__init__.py +1 -1
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/lamindb_setup/core/django.py +25 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/.github/workflows/build.yml +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/.github/workflows/doc-changes.yml +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/.gitignore +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/.pre-commit-config.yaml +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/LICENSE +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/docs/changelog.md +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/docs/hub-cloud/01-init-local-instance.ipynb +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/docs/hub-cloud/02-connect-local-instance.ipynb +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/docs/hub-cloud/03-add-managed-storage.ipynb +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/docs/hub-cloud/04-test-bionty.ipynb +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/docs/hub-cloud/05-init-hosted-instance.ipynb +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/docs/hub-cloud/06-connect-hosted-instance.ipynb +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/docs/hub-cloud/07-keep-artifacts-local.ipynb +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/docs/hub-cloud/08-test-multi-session.ipynb +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/docs/hub-cloud/test_notebooks.py +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/docs/hub-prod/test-cache-management.ipynb +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/docs/hub-prod/test-cloud-sync.ipynb +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/docs/hub-prod/test-empty-init.ipynb +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/docs/hub-prod/test-import-schema.ipynb +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/docs/hub-prod/test-init-load-local-anonymously.ipynb +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/docs/hub-prod/test-insufficient-user-info.ipynb +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/docs/hub-prod/test-invalid-schema.ipynb +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/docs/hub-prod/test-sqlite-lock.ipynb +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/docs/hub-prod/test_notebooks2.py +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/docs/index.md +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/docs/notebooks.md +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/docs/reference.md +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/lamindb_setup/_cache.py +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/lamindb_setup/_check.py +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/lamindb_setup/_check_setup.py +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/lamindb_setup/_close.py +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/lamindb_setup/_connect_instance.py +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/lamindb_setup/_delete.py +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/lamindb_setup/_django.py +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/lamindb_setup/_entry_points.py +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/lamindb_setup/_exportdb.py +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/lamindb_setup/_importdb.py +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/lamindb_setup/_init_instance.py +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/lamindb_setup/_migrate.py +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/lamindb_setup/_register_instance.py +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/lamindb_setup/_schema.py +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/lamindb_setup/_schema_metadata.py +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/lamindb_setup/_set_managed_storage.py +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/lamindb_setup/_setup_user.py +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/lamindb_setup/_silence_loggers.py +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/lamindb_setup/core/__init__.py +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/lamindb_setup/core/_aws_options.py +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/lamindb_setup/core/_aws_storage.py +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/lamindb_setup/core/_deprecated.py +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/lamindb_setup/core/_docs.py +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/lamindb_setup/core/_hub_client.py +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/lamindb_setup/core/_hub_core.py +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/lamindb_setup/core/_hub_crud.py +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/lamindb_setup/core/_hub_utils.py +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/lamindb_setup/core/_private_django_api.py +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/lamindb_setup/core/_settings.py +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/lamindb_setup/core/_settings_instance.py +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/lamindb_setup/core/_settings_load.py +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/lamindb_setup/core/_settings_save.py +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/lamindb_setup/core/_settings_storage.py +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/lamindb_setup/core/_settings_store.py +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/lamindb_setup/core/_settings_user.py +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/lamindb_setup/core/_setup_bionty_sources.py +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/lamindb_setup/core/cloud_sqlite_locker.py +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/lamindb_setup/core/exceptions.py +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/lamindb_setup/core/hashing.py +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/lamindb_setup/core/types.py +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/lamindb_setup/core/upath.py +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/noxfile.py +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/pyproject.toml +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/tests/hub-cloud/scripts/script-init-pass-user-no-writes.py +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/tests/hub-cloud/scripts/script-to-fail-managed-storage.py +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/tests/hub-cloud/test_connect_instance.py +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/tests/hub-cloud/test_delete_instance.py +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/tests/hub-cloud/test_edge_request.py +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/tests/hub-cloud/test_fail_managed_storage.py +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/tests/hub-cloud/test_init_instance.py +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/tests/hub-cloud/test_init_pass_user_no_writes.py +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/tests/hub-cloud/test_login.py +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/tests/hub-cloud/test_migrate.py +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/tests/hub-cloud/test_set_storage.py +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/tests/hub-local/conftest.py +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/tests/hub-local/test_all.py +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/tests/hub-local/test_update_schema_in_hub.py +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/tests/hub-prod/conftest.py +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/tests/hub-prod/test_aws_options_manager.py +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/tests/hub-prod/test_django.py +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/tests/hub-prod/test_global_settings.py +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/tests/hub-prod/test_switch_and_fallback_env.py +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/tests/hub-prod/test_upath.py +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/tests/storage/test_entry_point.py +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/tests/storage/test_hashing.py +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/tests/storage/test_storage_access.py +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/tests/storage/test_storage_basis.py +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/tests/storage/test_storage_settings.py +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/tests/storage/test_storage_stats.py +0 -0
- {lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/tests/storage/test_to_url.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: lamindb_setup
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.3.0
|
|
4
4
|
Summary: Setup & configure LaminDB.
|
|
5
5
|
Author-email: Lamin Labs <open-source@lamin.ai>
|
|
6
6
|
Requires-Python: >=3.10
|
|
@@ -40,7 +40,7 @@ Provides-Extra: gcp
|
|
|
40
40
|
|
|
41
41
|
[](https://codecov.io/gh/laminlabs/lamindb-setup)
|
|
42
42
|
|
|
43
|
-
# lamindb-setup:
|
|
43
|
+
# lamindb-setup: Setting up `lamindb`
|
|
44
44
|
|
|
45
45
|
- User [docs](https://lamin.ai/docs)
|
|
46
46
|
- Developer [docs](https://lamindb-setup-htry.netlify.app/)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[](https://codecov.io/gh/laminlabs/lamindb-setup)
|
|
2
2
|
|
|
3
|
-
# lamindb-setup:
|
|
3
|
+
# lamindb-setup: Setting up `lamindb`
|
|
4
4
|
|
|
5
5
|
- User [docs](https://lamin.ai/docs)
|
|
6
6
|
- Developer [docs](https://lamindb-setup-htry.netlify.app/)
|
|
@@ -13,7 +13,10 @@
|
|
|
13
13
|
"metadata": {},
|
|
14
14
|
"outputs": [],
|
|
15
15
|
"source": [
|
|
16
|
-
"import
|
|
16
|
+
"import pytest\n",
|
|
17
|
+
"import lamindb_setup as ln_setup\n",
|
|
18
|
+
"from lamindb_setup.core.django import set_token\n",
|
|
19
|
+
"from psycopg2.errors import UndefinedFunction"
|
|
17
20
|
]
|
|
18
21
|
},
|
|
19
22
|
{
|
|
@@ -44,6 +47,20 @@
|
|
|
44
47
|
"assert ln_setup.settings.storage._root is None"
|
|
45
48
|
]
|
|
46
49
|
},
|
|
50
|
+
{
|
|
51
|
+
"cell_type": "code",
|
|
52
|
+
"execution_count": null,
|
|
53
|
+
"metadata": {},
|
|
54
|
+
"outputs": [],
|
|
55
|
+
"source": [
|
|
56
|
+
"# this just tests that the function is setup properly\n",
|
|
57
|
+
"# the actual functionality is tested in lamindb\n",
|
|
58
|
+
"set_token(None)\n",
|
|
59
|
+
"# set_token sql function is not defined\n",
|
|
60
|
+
"with pytest.raises(UndefinedFunction):\n",
|
|
61
|
+
" set_token(\"test\")"
|
|
62
|
+
]
|
|
63
|
+
},
|
|
47
64
|
{
|
|
48
65
|
"cell_type": "code",
|
|
49
66
|
"execution_count": null,
|
|
@@ -79,7 +96,7 @@
|
|
|
79
96
|
"name": "python",
|
|
80
97
|
"nbconvert_exporter": "python",
|
|
81
98
|
"pygments_lexer": "ipython3",
|
|
82
|
-
"version": "3.
|
|
99
|
+
"version": "3.10.16"
|
|
83
100
|
}
|
|
84
101
|
},
|
|
85
102
|
"nbformat": 4,
|
|
@@ -14,6 +14,31 @@ IS_MIGRATING = False
|
|
|
14
14
|
CONN_MAX_AGE = 299
|
|
15
15
|
|
|
16
16
|
|
|
17
|
+
def set_token(token: str | None, connection_name: str = "default"):
|
|
18
|
+
# None to reset
|
|
19
|
+
from django.db import connections
|
|
20
|
+
from django.db.backends.base.base import BaseDatabaseWrapper
|
|
21
|
+
|
|
22
|
+
connection = connections[connection_name]
|
|
23
|
+
assert connection.vendor == "postgresql"
|
|
24
|
+
|
|
25
|
+
if token is not None:
|
|
26
|
+
|
|
27
|
+
def connect(self):
|
|
28
|
+
BaseDatabaseWrapper.connect(self)
|
|
29
|
+
# now the connection should be set
|
|
30
|
+
# Use a psycopg cursor directly, bypassing Django's utilities.
|
|
31
|
+
with self.connection.cursor() as cursor:
|
|
32
|
+
cursor.execute("SELECT set_token(%s, false);", (token,))
|
|
33
|
+
else:
|
|
34
|
+
connect = BaseDatabaseWrapper.connect
|
|
35
|
+
|
|
36
|
+
connection.connect = connect.__get__(connection, connection.__class__)
|
|
37
|
+
# execute this to initially set or reset the token
|
|
38
|
+
connection.close()
|
|
39
|
+
connection.connect()
|
|
40
|
+
|
|
41
|
+
|
|
17
42
|
def close_if_health_check_failed(self) -> None:
|
|
18
43
|
if self.close_at is not None:
|
|
19
44
|
if time.monotonic() >= self.close_at:
|
|
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.2.0 → lamindb_setup-1.3.0}/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
|
{lamindb_setup-1.2.0 → lamindb_setup-1.3.0}/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
|