lamindb_setup 1.18.2__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 (50) hide show
  1. lamindb_setup/__init__.py +4 -19
  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 -438
  6. lamindb_setup/_delete.py +155 -151
  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 -429
  11. lamindb_setup/_migrate.py +331 -327
  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 -80
  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 -266
  20. lamindb_setup/core/_aws_storage.py +57 -55
  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 -294
  25. lamindb_setup/core/_hub_core.py +0 -2
  26. lamindb_setup/core/_hub_crud.py +247 -247
  27. lamindb_setup/core/_hub_utils.py +100 -100
  28. lamindb_setup/core/_private_django_api.py +80 -80
  29. lamindb_setup/core/_settings.py +440 -434
  30. lamindb_setup/core/_settings_instance.py +32 -7
  31. lamindb_setup/core/_settings_load.py +162 -159
  32. lamindb_setup/core/_settings_save.py +108 -96
  33. lamindb_setup/core/_settings_storage.py +433 -433
  34. lamindb_setup/core/_settings_store.py +162 -92
  35. lamindb_setup/core/_settings_user.py +55 -55
  36. lamindb_setup/core/_setup_bionty_sources.py +44 -44
  37. lamindb_setup/core/cloud_sqlite_locker.py +240 -240
  38. lamindb_setup/core/django.py +414 -413
  39. lamindb_setup/core/exceptions.py +1 -1
  40. lamindb_setup/core/hashing.py +134 -134
  41. lamindb_setup/core/types.py +1 -1
  42. lamindb_setup/core/upath.py +1031 -1028
  43. lamindb_setup/errors.py +72 -70
  44. lamindb_setup/io.py +423 -416
  45. lamindb_setup/types.py +17 -17
  46. {lamindb_setup-1.18.2.dist-info → lamindb_setup-1.19.1.dist-info}/METADATA +4 -2
  47. lamindb_setup-1.19.1.dist-info/RECORD +51 -0
  48. {lamindb_setup-1.18.2.dist-info → lamindb_setup-1.19.1.dist-info}/WHEEL +1 -1
  49. {lamindb_setup-1.18.2.dist-info → lamindb_setup-1.19.1.dist-info/licenses}/LICENSE +201 -201
  50. lamindb_setup-1.18.2.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")