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.
Files changed (49) hide show
  1. lamindb_setup/__init__.py +1 -1
  2. lamindb_setup/_cache.py +87 -87
  3. lamindb_setup/_check.py +7 -7
  4. lamindb_setup/_check_setup.py +131 -131
  5. lamindb_setup/_connect_instance.py +443 -441
  6. lamindb_setup/_delete.py +155 -155
  7. lamindb_setup/_disconnect.py +38 -38
  8. lamindb_setup/_django.py +39 -39
  9. lamindb_setup/_entry_points.py +19 -19
  10. lamindb_setup/_init_instance.py +423 -423
  11. lamindb_setup/_migrate.py +331 -331
  12. lamindb_setup/_register_instance.py +32 -32
  13. lamindb_setup/_schema.py +27 -27
  14. lamindb_setup/_schema_metadata.py +451 -451
  15. lamindb_setup/_set_managed_storage.py +81 -81
  16. lamindb_setup/_setup_user.py +198 -198
  17. lamindb_setup/_silence_loggers.py +46 -46
  18. lamindb_setup/core/__init__.py +25 -34
  19. lamindb_setup/core/_aws_options.py +276 -276
  20. lamindb_setup/core/_aws_storage.py +57 -57
  21. lamindb_setup/core/_clone.py +50 -50
  22. lamindb_setup/core/_deprecated.py +62 -62
  23. lamindb_setup/core/_docs.py +14 -14
  24. lamindb_setup/core/_hub_client.py +288 -288
  25. lamindb_setup/core/_hub_crud.py +247 -247
  26. lamindb_setup/core/_hub_utils.py +100 -100
  27. lamindb_setup/core/_private_django_api.py +80 -80
  28. lamindb_setup/core/_settings.py +440 -434
  29. lamindb_setup/core/_settings_instance.py +22 -1
  30. lamindb_setup/core/_settings_load.py +162 -162
  31. lamindb_setup/core/_settings_save.py +108 -108
  32. lamindb_setup/core/_settings_storage.py +433 -433
  33. lamindb_setup/core/_settings_store.py +162 -162
  34. lamindb_setup/core/_settings_user.py +55 -55
  35. lamindb_setup/core/_setup_bionty_sources.py +44 -44
  36. lamindb_setup/core/cloud_sqlite_locker.py +240 -240
  37. lamindb_setup/core/django.py +414 -413
  38. lamindb_setup/core/exceptions.py +1 -1
  39. lamindb_setup/core/hashing.py +134 -134
  40. lamindb_setup/core/types.py +1 -1
  41. lamindb_setup/core/upath.py +1031 -1028
  42. lamindb_setup/errors.py +72 -72
  43. lamindb_setup/io.py +423 -423
  44. lamindb_setup/types.py +17 -17
  45. {lamindb_setup-1.19.0.dist-info → lamindb_setup-1.19.1.dist-info}/METADATA +3 -2
  46. lamindb_setup-1.19.1.dist-info/RECORD +51 -0
  47. {lamindb_setup-1.19.0.dist-info → lamindb_setup-1.19.1.dist-info}/WHEEL +1 -1
  48. {lamindb_setup-1.19.0.dist-info → lamindb_setup-1.19.1.dist-info/licenses}/LICENSE +201 -201
  49. 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")