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
lamindb_setup/errors.py CHANGED
@@ -1,70 +1,72 @@
1
- """Errors.
2
-
3
- .. autoexception:: CurrentInstanceNotConfigured
4
- .. autoexception:: ModuleWasntConfigured
5
- .. autoexception:: StorageAlreadyManaged
6
- .. autoexception:: StorageNotEmpty
7
- .. autoexception:: InstanceLockedException
8
- .. autoexception:: SettingsEnvFileOutdated
9
- .. autoexception:: CannotSwitchDefaultInstance
10
- .. autoexception:: InstanceNotFoundError
11
-
12
- """
13
-
14
- from __future__ import annotations
15
-
16
- import click
17
-
18
-
19
- class DefaultMessageException(Exception):
20
- default_message: str | None = None
21
-
22
- def __init__(self, message: str | None = None):
23
- if message is None:
24
- message = self.default_message
25
- super().__init__(message)
26
-
27
-
28
- class CurrentInstanceNotConfigured(DefaultMessageException):
29
- default_message = """\
30
- No instance is connected! Call
31
- - CLI: lamin connect / lamin init
32
- - Python: ln.connect() / ln.setup.init()
33
- - R: ln$connect() / ln$setup$init()"""
34
-
35
-
36
- MODULE_WASNT_CONFIGURED_MESSAGE_TEMPLATE = (
37
- "'{}' wasn't configured for this instance -- "
38
- "if you want it, go to your instance settings page and add it under 'schema modules' (or ask an admin to do so)"
39
- )
40
-
41
-
42
- class ModuleWasntConfigured(Exception):
43
- pass
44
-
45
-
46
- class StorageAlreadyManaged(Exception):
47
- pass
48
-
49
-
50
- class StorageNotEmpty(click.ClickException):
51
- def show(self, file=None):
52
- pass
53
-
54
-
55
- class InstanceNotFoundError(Exception):
56
- pass
57
-
58
-
59
- # raise if a cloud SQLite instance is already locked
60
- # ignored by unlock_cloud_sqlite_upon_exception
61
- class InstanceLockedException(Exception):
62
- pass
63
-
64
-
65
- class SettingsEnvFileOutdated(Exception):
66
- pass
67
-
68
-
69
- class CannotSwitchDefaultInstance(Exception):
70
- pass
1
+ """Errors.
2
+
3
+ .. autoexception:: CurrentInstanceNotConfigured
4
+ .. autoexception:: ModuleWasntConfigured
5
+ .. autoexception:: StorageAlreadyManaged
6
+ .. autoexception:: StorageNotEmpty
7
+ .. autoexception:: InstanceLockedException
8
+ .. autoexception:: SettingsEnvFileOutdated
9
+ .. autoexception:: CannotSwitchDefaultInstance
10
+ .. autoexception:: InstanceNotFoundError
11
+ .. autoexception:: InstanceNotCreated
12
+
13
+ """
14
+
15
+ from __future__ import annotations
16
+
17
+
18
+ class DefaultMessageException(Exception):
19
+ default_message: str | None = None
20
+
21
+ def __init__(self, message: str | None = None):
22
+ if message is None:
23
+ message = self.default_message
24
+ super().__init__(message)
25
+
26
+
27
+ class CurrentInstanceNotConfigured(DefaultMessageException):
28
+ default_message = """\
29
+ No instance is connected! Call
30
+ - CLI: lamin connect / lamin init
31
+ - Python: ln.connect() / ln.setup.init()
32
+ - R: ln$connect() / ln$setup$init()"""
33
+
34
+
35
+ MODULE_WASNT_CONFIGURED_MESSAGE_TEMPLATE = (
36
+ "'{}' wasn't configured for this instance -- "
37
+ "if you want it, go to your instance settings page and add it under 'schema modules' (or ask an admin to do so)"
38
+ )
39
+
40
+
41
+ class ModuleWasntConfigured(Exception):
42
+ pass
43
+
44
+
45
+ class StorageAlreadyManaged(Exception):
46
+ pass
47
+
48
+
49
+ class StorageNotEmpty(Exception):
50
+ pass
51
+
52
+
53
+ class InstanceNotFoundError(Exception):
54
+ pass
55
+
56
+
57
+ class InstanceNotCreated(Exception):
58
+ pass
59
+
60
+
61
+ # raise if a cloud SQLite instance is already locked
62
+ # ignored by unlock_cloud_sqlite_upon_exception
63
+ class InstanceLockedException(Exception):
64
+ pass
65
+
66
+
67
+ class SettingsEnvFileOutdated(Exception):
68
+ pass
69
+
70
+
71
+ class CannotSwitchDefaultInstance(Exception):
72
+ pass