lamindb_setup 1.13.1__tar.gz → 1.14.1__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.
Files changed (110) hide show
  1. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/PKG-INFO +1 -1
  2. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/lamindb_setup/__init__.py +18 -18
  3. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/lamindb_setup/_connect_instance.py +8 -0
  4. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/lamindb_setup/core/__init__.py +6 -11
  5. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/lamindb_setup/core/_hub_core.py +7 -2
  6. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/lamindb_setup/core/_settings.py +57 -22
  7. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/lamindb_setup/core/upath.py +17 -12
  8. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/lamindb_setup/errors.py +8 -11
  9. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/lamindb_setup/types.py +2 -5
  10. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/tests/hub-local/scripts/script-connect-fine-grained-access.py +3 -0
  11. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/.github/workflows/build.yml +0 -0
  12. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/.github/workflows/doc-changes.yml +0 -0
  13. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/.gitignore +0 -0
  14. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/.pre-commit-config.yaml +0 -0
  15. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/LICENSE +0 -0
  16. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/README.md +0 -0
  17. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/docs/changelog.md +0 -0
  18. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/docs/hub-cloud/01-init-local-instance.ipynb +0 -0
  19. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/docs/hub-cloud/02-connect-local-instance.ipynb +0 -0
  20. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/docs/hub-cloud/03-add-managed-storage.ipynb +0 -0
  21. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/docs/hub-cloud/04-test-bionty.ipynb +0 -0
  22. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/docs/hub-cloud/05-init-hosted-instance.ipynb +0 -0
  23. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/docs/hub-cloud/06-connect-hosted-instance.ipynb +0 -0
  24. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/docs/hub-cloud/07-keep-artifacts-local.ipynb +0 -0
  25. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/docs/hub-cloud/08-test-multi-session.ipynb +0 -0
  26. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/docs/hub-cloud/09-test-migrate.ipynb +0 -0
  27. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/docs/hub-cloud/test_notebooks.py +0 -0
  28. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/docs/hub-prod/test-cache-management.ipynb +0 -0
  29. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/docs/hub-prod/test-cloud-sync.ipynb +0 -0
  30. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/docs/hub-prod/test-connect-anonymously.ipynb +0 -0
  31. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/docs/hub-prod/test-empty-init.ipynb +0 -0
  32. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/docs/hub-prod/test-import-schema.ipynb +0 -0
  33. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/docs/hub-prod/test-init-load-local-anonymously.ipynb +0 -0
  34. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/docs/hub-prod/test-insufficient-user-info.ipynb +0 -0
  35. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/docs/hub-prod/test-invalid-schema.ipynb +0 -0
  36. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/docs/hub-prod/test-sqlite-lock.ipynb +0 -0
  37. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/docs/hub-prod/test_notebooks2.py +0 -0
  38. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/docs/index.md +0 -0
  39. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/docs/notebooks.md +0 -0
  40. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/docs/reference.md +0 -0
  41. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/lamindb_setup/_cache.py +0 -0
  42. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/lamindb_setup/_check.py +0 -0
  43. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/lamindb_setup/_check_setup.py +0 -0
  44. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/lamindb_setup/_delete.py +0 -0
  45. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/lamindb_setup/_disconnect.py +0 -0
  46. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/lamindb_setup/_django.py +0 -0
  47. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/lamindb_setup/_entry_points.py +0 -0
  48. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/lamindb_setup/_exportdb.py +0 -0
  49. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/lamindb_setup/_importdb.py +0 -0
  50. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/lamindb_setup/_init_instance.py +0 -0
  51. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/lamindb_setup/_migrate.py +0 -0
  52. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/lamindb_setup/_register_instance.py +0 -0
  53. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/lamindb_setup/_schema.py +0 -0
  54. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/lamindb_setup/_schema_metadata.py +0 -0
  55. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/lamindb_setup/_set_managed_storage.py +0 -0
  56. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/lamindb_setup/_setup_user.py +0 -0
  57. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/lamindb_setup/_silence_loggers.py +0 -0
  58. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/lamindb_setup/core/_aws_options.py +0 -0
  59. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/lamindb_setup/core/_aws_storage.py +0 -0
  60. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/lamindb_setup/core/_clone.py +0 -0
  61. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/lamindb_setup/core/_deprecated.py +0 -0
  62. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/lamindb_setup/core/_docs.py +0 -0
  63. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/lamindb_setup/core/_hub_client.py +0 -0
  64. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/lamindb_setup/core/_hub_crud.py +0 -0
  65. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/lamindb_setup/core/_hub_utils.py +0 -0
  66. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/lamindb_setup/core/_private_django_api.py +0 -0
  67. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/lamindb_setup/core/_settings_instance.py +0 -0
  68. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/lamindb_setup/core/_settings_load.py +0 -0
  69. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/lamindb_setup/core/_settings_save.py +0 -0
  70. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/lamindb_setup/core/_settings_storage.py +0 -0
  71. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/lamindb_setup/core/_settings_store.py +0 -0
  72. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/lamindb_setup/core/_settings_user.py +0 -0
  73. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/lamindb_setup/core/_setup_bionty_sources.py +0 -0
  74. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/lamindb_setup/core/cloud_sqlite_locker.py +0 -0
  75. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/lamindb_setup/core/django.py +0 -0
  76. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/lamindb_setup/core/exceptions.py +0 -0
  77. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/lamindb_setup/core/hashing.py +0 -0
  78. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/lamindb_setup/core/types.py +0 -0
  79. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/lamindb_setup/py.typed +0 -0
  80. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/noxfile.py +0 -0
  81. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/pyproject.toml +0 -0
  82. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/tests/hub-cloud/scripts/script-init-pass-user-no-writes.py +0 -0
  83. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/tests/hub-cloud/scripts/script-to-fail-managed-storage.py +0 -0
  84. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/tests/hub-cloud/test_clone_instance.py +0 -0
  85. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/tests/hub-cloud/test_connect_instance.py +0 -0
  86. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/tests/hub-cloud/test_delete_instance.py +0 -0
  87. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/tests/hub-cloud/test_edge_request.py +0 -0
  88. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/tests/hub-cloud/test_fail_managed_storage.py +0 -0
  89. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/tests/hub-cloud/test_init_instance.py +0 -0
  90. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/tests/hub-cloud/test_init_pass_user_no_writes.py +0 -0
  91. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/tests/hub-cloud/test_login.py +0 -0
  92. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/tests/hub-cloud/test_set_storage.py +0 -0
  93. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/tests/hub-local/README.md +0 -0
  94. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/tests/hub-local/conftest.py +0 -0
  95. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/tests/hub-local/test_all.py +0 -0
  96. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/tests/hub-local/test_update_schema_in_hub.py +0 -0
  97. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/tests/hub-prod/conftest.py +0 -0
  98. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/tests/hub-prod/test_aws_options_manager.py +0 -0
  99. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/tests/hub-prod/test_django.py +0 -0
  100. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/tests/hub-prod/test_global_settings.py +0 -0
  101. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/tests/hub-prod/test_migrate.py +0 -0
  102. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/tests/hub-prod/test_switch_and_fallback_env.py +0 -0
  103. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/tests/hub-prod/test_upath.py +0 -0
  104. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/tests/storage/test_entry_point.py +0 -0
  105. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/tests/storage/test_hashing.py +0 -0
  106. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/tests/storage/test_storage_access.py +0 -0
  107. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/tests/storage/test_storage_basis.py +0 -0
  108. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/tests/storage/test_storage_settings.py +0 -0
  109. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/tests/storage/test_storage_stats.py +0 -0
  110. {lamindb_setup-1.13.1 → lamindb_setup-1.14.1}/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.13.1
3
+ Version: 1.14.1
4
4
  Summary: Setup & configure LaminDB.
5
5
  Author-email: Lamin Labs <open-source@lamin.ai>
6
6
  Requires-Python: >=3.10
@@ -4,25 +4,17 @@ Many functions in this "setup API" have a matching command in the :doc:`docs:cli
4
4
 
5
5
  Guide: :doc:`docs:setup`.
6
6
 
7
- Basic operations:
7
+ Basic operations
8
+ ----------------
8
9
 
9
- .. autosummary::
10
- :toctree:
10
+ .. autofunction:: login
11
+ .. autofunction:: logout
12
+ .. autofunction:: init
13
+ .. autofunction:: disconnect
14
+ .. autofunction:: delete
11
15
 
12
- login
13
- logout
14
- init
15
- disconnect
16
- delete
17
-
18
- Instance operations:
19
-
20
- .. autosummary::
21
- :toctree:
22
-
23
- migrate
24
-
25
- Modules & settings:
16
+ Modules & settings
17
+ ------------------
26
18
 
27
19
  .. autosummary::
28
20
  :toctree:
@@ -33,9 +25,17 @@ Modules & settings:
33
25
  errors
34
26
  types
35
27
 
28
+ Migration management
29
+ --------------------
30
+
31
+ .. autosummary::
32
+ :toctree:
33
+
34
+ migrate
35
+
36
36
  """
37
37
 
38
- __version__ = "1.13.1" # denote a release candidate for 0.1.0 with 0.1rc1
38
+ __version__ = "1.14.1" # denote a release candidate for 0.1.0 with 0.1rc1
39
39
 
40
40
  import os
41
41
  import warnings
@@ -260,6 +260,10 @@ def _connect_cli(
260
260
  connect(_write_settings=False, _reload_lamindb=False)
261
261
  else:
262
262
  logger.important(f"connected lamindb: {isettings.slug}")
263
+ if settings_.dev_dir is None:
264
+ logger.important_hint(
265
+ "to map a local dev directory, call: lamin settings set dev-dir ."
266
+ )
263
267
  return None
264
268
 
265
269
 
@@ -427,6 +431,10 @@ def connect(instance: str | None = None, **kwargs: Any) -> str | tuple | None:
427
431
  isettings._get_settings_file().unlink(missing_ok=True) # type: ignore
428
432
  settings._instance_settings = None
429
433
  raise e
434
+ if settings.dev_dir is None:
435
+ logger.important_hint(
436
+ "to map a local dev directory, set: ln.setup.settings.dev_dir = '.'"
437
+ )
430
438
  return None
431
439
 
432
440
 
@@ -1,21 +1,16 @@
1
1
  """Core setup library.
2
2
 
3
- Settings:
4
-
5
- .. autosummary::
6
- :toctree:
7
-
8
- SetupSettings
9
- UserSettings
10
- InstanceSettings
11
- StorageSettings
3
+ .. autoclass:: SetupSettings
4
+ .. autoclass:: UserSettings
5
+ .. autoclass:: InstanceSettings
6
+ .. autoclass:: StorageSettings
12
7
 
13
8
  """
14
9
 
15
10
  from . import django, upath
16
11
  from ._clone import connect_local_sqlite, init_local_sqlite
17
- from ._deprecated import deprecated
18
- from ._docs import doc_args
12
+ from ._deprecated import deprecated # documented in lamindb.base
13
+ from ._docs import doc_args # documented in lamindb.base
19
14
  from ._settings import SetupSettings
20
15
  from ._settings_instance import InstanceSettings
21
16
  from ._settings_storage import StorageSettings
@@ -551,6 +551,9 @@ def _connect_instance_hub(
551
551
  db_user["password" if fine_grained_access else "db_user_password"],
552
552
  )
553
553
 
554
+ db_user_name = "none" if db_user_name is None else db_user_name
555
+ db_user_password = "none" if db_user_password is None else db_user_password
556
+
554
557
  if use_proxy_db:
555
558
  host = instance.get("proxy_host", None)
556
559
  assert host is not None, (
@@ -560,14 +563,16 @@ def _connect_instance_hub(
560
563
  assert port is not None, (
561
564
  "Database proxy port is not available, please do not pass 'use_proxy_db'."
562
565
  )
566
+ # remove supabase project id if present
567
+ db_user_name = db_user_name.rsplit(".", 1)[0]
563
568
  else:
564
569
  host = instance["db_host"]
565
570
  port = instance["db_port"]
566
571
 
567
572
  db_dsn = LaminDsn.build(
568
573
  scheme=instance["db_scheme"],
569
- user=db_user_name if db_user_name is not None else "none",
570
- password=db_user_password if db_user_password is not None else "none",
574
+ user=db_user_name,
575
+ password=db_user_password,
571
576
  host=host,
572
577
  port=port,
573
578
  database=instance["db_database"],
@@ -5,6 +5,7 @@ import sys
5
5
  from pathlib import Path
6
6
  from typing import TYPE_CHECKING
7
7
 
8
+ import jwt
8
9
  from lamin_utils import logger
9
10
  from platformdirs import user_cache_dir
10
11
 
@@ -58,7 +59,6 @@ class SetupSettings:
58
59
 
59
60
  _auto_connect_path: Path = settings_dir / "auto_connect"
60
61
  _private_django_api_path: Path = settings_dir / "private_django_api"
61
- _work_dir: Path = settings_dir / "work_dir.txt"
62
62
 
63
63
  _cache_dir: Path | None = None
64
64
 
@@ -69,25 +69,6 @@ class SetupSettings:
69
69
  def _instance_settings_path(self) -> Path:
70
70
  return current_instance_settings_file()
71
71
 
72
- @property
73
- def work_dir(self) -> Path | None:
74
- """Get or set the current working directory.
75
-
76
- If setting it to `None`, the working directory is unset
77
- """
78
- if not self._work_dir.exists():
79
- return None
80
- return Path(self._work_dir.read_text())
81
-
82
- @work_dir.setter
83
- def work_dir(self, value: str | Path | None) -> None:
84
- if value is None:
85
- if self._work_dir.exists():
86
- self._work_dir.unlink()
87
- else:
88
- value_str = Path(value).expanduser().resolve().as_posix()
89
- self._work_dir.write_text(value_str)
90
-
91
72
  @property
92
73
  def settings_dir(self) -> Path:
93
74
  """The directory that holds locally persisted settings."""
@@ -111,6 +92,31 @@ class SetupSettings:
111
92
  else:
112
93
  self._auto_connect_path.unlink(missing_ok=True)
113
94
 
95
+ @property
96
+ def _dev_dir_path(self) -> Path:
97
+ return (
98
+ settings_dir / f"dev-dir--{self.instance.owner}--{self.instance.name}.txt"
99
+ )
100
+
101
+ @property
102
+ def dev_dir(self) -> Path | None:
103
+ """Get or set the local development directory for the current instance.
104
+
105
+ If setting it to `None`, the working development directory is unset.
106
+ """
107
+ if not self._dev_dir_path.exists():
108
+ return None
109
+ return Path(self._dev_dir_path.read_text())
110
+
111
+ @dev_dir.setter
112
+ def dev_dir(self, value: str | Path | None) -> None:
113
+ if value is None:
114
+ if self._dev_dir_path.exists():
115
+ self._dev_dir_path.unlink()
116
+ else:
117
+ value_str = Path(value).expanduser().resolve().as_posix()
118
+ self._dev_dir_path.write_text(value_str)
119
+
114
120
  @property
115
121
  def _branch_path(self) -> Path:
116
122
  return (
@@ -319,6 +325,35 @@ class SetupSettings:
319
325
  """
320
326
  return SetupPaths
321
327
 
328
+ def _debug_db_access(self):
329
+ """Debug database access problems."""
330
+ instance = self.instance
331
+ db_permissions = instance._db_permissions
332
+ print("db connection: ", instance.db)
333
+ print("db permissions: ", db_permissions)
334
+ if db_permissions != "jwt":
335
+ return
336
+ # sets the token if not present yet
337
+ print("available spaces: ", instance.available_spaces)
338
+
339
+ from lamindb_setup.core.django import db_token_manager
340
+
341
+ tokens = db_token_manager.tokens
342
+ if tokens:
343
+ for conn, token in tokens.items():
344
+ token_encoded = token._token
345
+ if token_encoded is None:
346
+ token._refresh_token()
347
+ token_encoded = token._token
348
+ token_decoded = jwt.decode(
349
+ token_encoded, options={"verify_signature": False}
350
+ )
351
+ print(
352
+ f"db token for the connection '{conn}' is '{token_encoded}': {token_decoded}"
353
+ )
354
+ else:
355
+ print("no db tokens are present")
356
+
322
357
  def __repr__(self) -> str:
323
358
  """Rich string representation."""
324
359
  from lamin_utils import colors
@@ -331,9 +366,9 @@ class SetupSettings:
331
366
  if self._instance_exists:
332
367
  instance_rep = self.instance.__repr__().split("\n")
333
368
  repr += f"{colors.cyan('Instance:')} {instance_rep[0].replace('Instance: ', '')}\n"
334
- repr += f" - work-dir: {self.work_dir}\n"
335
369
  repr += f" - branch: {self._read_branch_idlike_name()[1]}\n"
336
- repr += f" - space: {self._read_space_idlike_name()[1]}"
370
+ repr += f" - space: {self._read_space_idlike_name()[1]}\n"
371
+ repr += f" - dev-dir: {self.dev_dir}"
337
372
  repr += f"\n{colors.yellow('Details:')}\n"
338
373
  repr += "\n".join(instance_rep[1:])
339
374
  else:
@@ -737,25 +737,30 @@ UPath.exists.__doc__ = Path.exists.__doc__
737
737
  UPath.is_dir.__doc__ = Path.is_dir.__doc__
738
738
  UPath.is_file.__doc__ = Path.is_file.__doc__
739
739
  UPath.unlink.__doc__ = Path.unlink.__doc__
740
- UPath.rename.__doc__ = """Move file, see fsspec.AbstractFileSystem.mv.
740
+ UPath.rename.__doc__ = """Move file, see `fsspec.AbstractFileSystem.mv`.
741
741
 
742
- >>> upath = Upath("s3://my-bucket/my-file")
743
- >>> upath.rename(UPath("s3://my-bucket/my-file-renamed"))
744
- >>> upath.rename("my-file-renamed")
742
+ For example::
745
743
 
746
- >>> upath = Upath("local-folder/my-file")
747
- >>> upath.rename("local-folder/my-file-renamed")
744
+ upath = UPath("s3://my-bucket/my-file")
745
+ upath.rename(UPath("s3://my-bucket/my-file-renamed"))
746
+ upath.rename("my-file-renamed")
748
747
  """
749
- UPath.__doc__ = """Paths: low-level key-value access to files/objects.
748
+ UPath.__doc__ = """Paths: low-level key-value access to files.
750
749
 
751
- Paths are based on keys that offer the typical access patterns of file systems
752
- and object stores.
750
+ Offers the typical access patterns of file systems and object stores, for instance::
753
751
 
754
- >>> upath = UPath("s3://my-bucket/my-folder")
755
- >>> upath.exists()
752
+ upath = UPath("s3://my-bucket/my-folder/my-file.txt")
753
+ upath.exists() # file exists in storage
754
+
755
+ LaminDB exposes `universal_pathlib.UPath` and adds functionality related to authentication and the following methods::
756
+
757
+ upath.view_tree() # view a file tree
758
+ upath.upload_from("local-file.txt") # upload a local file
759
+ upath.download_to("local-file.txt") # download a file
760
+ upath.synchronize_to("local-folder/") # synchronize a folder
756
761
 
757
762
  Args:
758
- pathlike: A string or Path to a local/cloud file/directory/folder.
763
+ pathlike: A string or `Path` to a local or cloud file/directory/folder.
759
764
  """
760
765
 
761
766
  logger.debug("upath.UPath has been patched")
@@ -1,16 +1,13 @@
1
1
  """Errors.
2
2
 
3
- .. autosummary::
4
- :toctree: .
5
-
6
- CurrentInstanceNotConfigured
7
- InstanceNotSetupError
8
- ModuleWasntConfigured
9
- StorageAlreadyManaged
10
- StorageNotEmpty
11
- InstanceLockedException
12
- SettingsEnvFileOutdated
13
- CannotSwitchDefaultInstance
3
+ .. autoexception:: CurrentInstanceNotConfigured
4
+ .. autoexception:: InstanceNotSetupError
5
+ .. autoexception:: ModuleWasntConfigured
6
+ .. autoexception:: StorageAlreadyManaged
7
+ .. autoexception:: StorageNotEmpty
8
+ .. autoexception:: InstanceLockedException
9
+ .. autoexception:: SettingsEnvFileOutdated
10
+ .. autoexception:: CannotSwitchDefaultInstance
14
11
 
15
12
  """
16
13
 
@@ -1,10 +1,7 @@
1
1
  """Types.
2
2
 
3
- .. autosummary::
4
- :toctree: .
5
-
6
- UPathStr
7
- StorageType
3
+ .. autoclass:: UPathStr
4
+ .. autoclass:: StorageType
8
5
  """
9
6
 
10
7
  from __future__ import annotations
@@ -41,6 +41,9 @@ with connection.cursor() as cur:
41
41
  # check available spaces call
42
42
  assert ln_setup.settings.instance.available_spaces
43
43
 
44
+ # run debug function for coverage
45
+ ln_setup.settings._debug_db_access()
46
+
44
47
  # check reset
45
48
  db_token_manager.reset()
46
49
  assert not db_token_manager.tokens
File without changes
File without changes