lamindb_setup 1.19.0__py3-none-any.whl → 1.19.1__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/_cache.py +87 -87
- lamindb_setup/_check.py +7 -7
- lamindb_setup/_check_setup.py +131 -131
- lamindb_setup/_connect_instance.py +443 -441
- lamindb_setup/_delete.py +155 -155
- lamindb_setup/_disconnect.py +38 -38
- lamindb_setup/_django.py +39 -39
- lamindb_setup/_entry_points.py +19 -19
- lamindb_setup/_init_instance.py +423 -423
- lamindb_setup/_migrate.py +331 -331
- lamindb_setup/_register_instance.py +32 -32
- lamindb_setup/_schema.py +27 -27
- lamindb_setup/_schema_metadata.py +451 -451
- lamindb_setup/_set_managed_storage.py +81 -81
- lamindb_setup/_setup_user.py +198 -198
- lamindb_setup/_silence_loggers.py +46 -46
- lamindb_setup/core/__init__.py +25 -34
- lamindb_setup/core/_aws_options.py +276 -276
- lamindb_setup/core/_aws_storage.py +57 -57
- lamindb_setup/core/_clone.py +50 -50
- lamindb_setup/core/_deprecated.py +62 -62
- lamindb_setup/core/_docs.py +14 -14
- lamindb_setup/core/_hub_client.py +288 -288
- lamindb_setup/core/_hub_crud.py +247 -247
- lamindb_setup/core/_hub_utils.py +100 -100
- lamindb_setup/core/_private_django_api.py +80 -80
- lamindb_setup/core/_settings.py +440 -434
- lamindb_setup/core/_settings_instance.py +22 -1
- lamindb_setup/core/_settings_load.py +162 -162
- lamindb_setup/core/_settings_save.py +108 -108
- lamindb_setup/core/_settings_storage.py +433 -433
- lamindb_setup/core/_settings_store.py +162 -162
- lamindb_setup/core/_settings_user.py +55 -55
- lamindb_setup/core/_setup_bionty_sources.py +44 -44
- lamindb_setup/core/cloud_sqlite_locker.py +240 -240
- lamindb_setup/core/django.py +414 -413
- lamindb_setup/core/exceptions.py +1 -1
- lamindb_setup/core/hashing.py +134 -134
- lamindb_setup/core/types.py +1 -1
- lamindb_setup/core/upath.py +1031 -1028
- lamindb_setup/errors.py +72 -72
- lamindb_setup/io.py +423 -423
- lamindb_setup/types.py +17 -17
- {lamindb_setup-1.19.0.dist-info → lamindb_setup-1.19.1.dist-info}/METADATA +3 -2
- lamindb_setup-1.19.1.dist-info/RECORD +51 -0
- {lamindb_setup-1.19.0.dist-info → lamindb_setup-1.19.1.dist-info}/WHEEL +1 -1
- {lamindb_setup-1.19.0.dist-info → lamindb_setup-1.19.1.dist-info/licenses}/LICENSE +201 -201
- lamindb_setup-1.19.0.dist-info/RECORD +0 -51
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
from lamin_utils import logger
|
|
4
|
-
|
|
5
|
-
from .core._settings import settings
|
|
6
|
-
from .core._settings_storage import base62
|
|
7
|
-
from .core.django import setup_django
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
def register(_test: bool = False):
|
|
11
|
-
"""Register an instance on the hub."""
|
|
12
|
-
from ._check_setup import _check_instance_setup
|
|
13
|
-
from .core._hub_core import init_instance_hub, init_storage_hub
|
|
14
|
-
|
|
15
|
-
logger.warning("note that register() is only for testing purposes")
|
|
16
|
-
|
|
17
|
-
isettings = settings.instance
|
|
18
|
-
if not _check_instance_setup() and not _test:
|
|
19
|
-
setup_django(isettings)
|
|
20
|
-
|
|
21
|
-
ssettings = settings.instance.storage
|
|
22
|
-
if ssettings._uid is None and _test:
|
|
23
|
-
# because django isn't up, we can't get it from the database
|
|
24
|
-
ssettings._uid = base62(12)
|
|
25
|
-
init_instance_hub(isettings)
|
|
26
|
-
init_storage_hub(ssettings, is_default=True)
|
|
27
|
-
isettings._is_on_hub = True
|
|
28
|
-
isettings._persist()
|
|
29
|
-
if isettings.dialect != "sqlite" and not _test:
|
|
30
|
-
from ._schema_metadata import update_schema_in_hub
|
|
31
|
-
|
|
32
|
-
update_schema_in_hub()
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from lamin_utils import logger
|
|
4
|
+
|
|
5
|
+
from .core._settings import settings
|
|
6
|
+
from .core._settings_storage import base62
|
|
7
|
+
from .core.django import setup_django
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def register(_test: bool = False):
|
|
11
|
+
"""Register an instance on the hub."""
|
|
12
|
+
from ._check_setup import _check_instance_setup
|
|
13
|
+
from .core._hub_core import init_instance_hub, init_storage_hub
|
|
14
|
+
|
|
15
|
+
logger.warning("note that register() is only for testing purposes")
|
|
16
|
+
|
|
17
|
+
isettings = settings.instance
|
|
18
|
+
if not _check_instance_setup() and not _test:
|
|
19
|
+
setup_django(isettings)
|
|
20
|
+
|
|
21
|
+
ssettings = settings.instance.storage
|
|
22
|
+
if ssettings._uid is None and _test:
|
|
23
|
+
# because django isn't up, we can't get it from the database
|
|
24
|
+
ssettings._uid = base62(12)
|
|
25
|
+
init_instance_hub(isettings)
|
|
26
|
+
init_storage_hub(ssettings, is_default=True)
|
|
27
|
+
isettings._is_on_hub = True
|
|
28
|
+
isettings._persist()
|
|
29
|
+
if isettings.dialect != "sqlite" and not _test:
|
|
30
|
+
from ._schema_metadata import update_schema_in_hub
|
|
31
|
+
|
|
32
|
+
update_schema_in_hub()
|
lamindb_setup/_schema.py
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
from django.urls import path
|
|
4
|
-
from lamin_utils import logger
|
|
5
|
-
|
|
6
|
-
try:
|
|
7
|
-
from schema_graph.views import Schema
|
|
8
|
-
except ImportError:
|
|
9
|
-
logger.error("to view the schema: pip install django-schema-graph")
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
urlpatterns = [
|
|
13
|
-
path("schema/", Schema.as_view()),
|
|
14
|
-
]
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
def view():
|
|
18
|
-
from django.core.management import call_command
|
|
19
|
-
|
|
20
|
-
from ._check_setup import _check_instance_setup
|
|
21
|
-
from .core._settings import settings
|
|
22
|
-
from .core.django import setup_django
|
|
23
|
-
|
|
24
|
-
if _check_instance_setup():
|
|
25
|
-
raise RuntimeError("Restart Python session or use CLI!")
|
|
26
|
-
setup_django(settings.instance, view_schema=True)
|
|
27
|
-
call_command("runserver")
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from django.urls import path
|
|
4
|
+
from lamin_utils import logger
|
|
5
|
+
|
|
6
|
+
try:
|
|
7
|
+
from schema_graph.views import Schema
|
|
8
|
+
except ImportError:
|
|
9
|
+
logger.error("to view the schema: pip install django-schema-graph")
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
urlpatterns = [
|
|
13
|
+
path("schema/", Schema.as_view()),
|
|
14
|
+
]
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def view():
|
|
18
|
+
from django.core.management import call_command
|
|
19
|
+
|
|
20
|
+
from ._check_setup import _check_instance_setup
|
|
21
|
+
from .core._settings import settings
|
|
22
|
+
from .core.django import setup_django
|
|
23
|
+
|
|
24
|
+
if _check_instance_setup():
|
|
25
|
+
raise RuntimeError("Restart Python session or use CLI!")
|
|
26
|
+
setup_django(settings.instance, view_schema=True)
|
|
27
|
+
call_command("runserver")
|