lamindb_setup 0.71.1__tar.gz → 0.71.2__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 (89) hide show
  1. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/.github/workflows/build.yml +5 -3
  2. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/PKG-INFO +1 -1
  3. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/docs/changelog.md +3 -0
  4. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/lamindb_setup/__init__.py +1 -1
  5. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/lamindb_setup/_connect_instance.py +4 -4
  6. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/lamindb_setup/_init_instance.py +1 -1
  7. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/lamindb_setup/core/_hub_core.py +1 -1
  8. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/lamindb_setup/core/_settings_user.py +6 -2
  9. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/lamindb_setup/core/upath.py +7 -6
  10. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/.github/workflows/latest-changes.jinja2 +0 -0
  11. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/.github/workflows/latest-changes.yml +0 -0
  12. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/.gitignore +0 -0
  13. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/.pre-commit-config.yaml +0 -0
  14. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/LICENSE +0 -0
  15. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/README.md +0 -0
  16. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/docs/hub-cloud/01-init-local-instance.ipynb +0 -0
  17. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/docs/hub-cloud/02-connect-local-instance.ipynb +0 -0
  18. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/docs/hub-cloud/03-add-managed-storage.ipynb +0 -0
  19. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/docs/hub-cloud/04-test-bionty.ipynb +0 -0
  20. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/docs/hub-cloud/05-init-hosted-instance.ipynb +0 -0
  21. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/docs/hub-cloud/06-connect-hosted-instance.ipynb +0 -0
  22. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/docs/hub-cloud/07-keep-artifacts-local.ipynb +0 -0
  23. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/docs/hub-cloud/test-multi-session.ipynb +0 -0
  24. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/docs/hub-cloud/test_notebooks.py +0 -0
  25. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/docs/hub-prod/test-cache-management.ipynb +0 -0
  26. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/docs/hub-prod/test-cloud-sync.ipynb +0 -0
  27. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/docs/hub-prod/test-connect-anonymously.ipynb +0 -0
  28. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/docs/hub-prod/test-empty-init.ipynb +0 -0
  29. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/docs/hub-prod/test-import-schema.ipynb +0 -0
  30. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/docs/hub-prod/test-insufficient-user-info.ipynb +0 -0
  31. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/docs/hub-prod/test-invalid-schema.ipynb +0 -0
  32. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/docs/hub-prod/test-sqlite-lock.ipynb +0 -0
  33. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/docs/hub-prod/test_notebooks2.py +0 -0
  34. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/docs/index.md +0 -0
  35. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/docs/notebooks.md +0 -0
  36. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/docs/reference.md +0 -0
  37. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/lamindb_setup/_cache.py +0 -0
  38. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/lamindb_setup/_check.py +0 -0
  39. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/lamindb_setup/_check_setup.py +0 -0
  40. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/lamindb_setup/_close.py +0 -0
  41. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/lamindb_setup/_delete.py +0 -0
  42. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/lamindb_setup/_django.py +0 -0
  43. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/lamindb_setup/_exportdb.py +0 -0
  44. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/lamindb_setup/_importdb.py +0 -0
  45. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/lamindb_setup/_migrate.py +0 -0
  46. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/lamindb_setup/_register_instance.py +0 -0
  47. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/lamindb_setup/_schema.py +0 -0
  48. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/lamindb_setup/_set_managed_storage.py +0 -0
  49. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/lamindb_setup/_setup_user.py +0 -0
  50. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/lamindb_setup/_silence_loggers.py +0 -0
  51. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/lamindb_setup/core/__init__.py +0 -0
  52. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/lamindb_setup/core/_aws_storage.py +0 -0
  53. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/lamindb_setup/core/_deprecated.py +0 -0
  54. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/lamindb_setup/core/_docs.py +0 -0
  55. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/lamindb_setup/core/_hub_client.py +0 -0
  56. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/lamindb_setup/core/_hub_crud.py +0 -0
  57. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/lamindb_setup/core/_hub_utils.py +0 -0
  58. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/lamindb_setup/core/_settings.py +0 -0
  59. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/lamindb_setup/core/_settings_instance.py +0 -0
  60. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/lamindb_setup/core/_settings_load.py +0 -0
  61. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/lamindb_setup/core/_settings_save.py +0 -0
  62. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/lamindb_setup/core/_settings_storage.py +0 -0
  63. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/lamindb_setup/core/_settings_store.py +0 -0
  64. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/lamindb_setup/core/_setup_bionty_sources.py +0 -0
  65. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/lamindb_setup/core/cloud_sqlite_locker.py +0 -0
  66. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/lamindb_setup/core/django.py +0 -0
  67. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/lamindb_setup/core/exceptions.py +0 -0
  68. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/lamindb_setup/core/hashing.py +0 -0
  69. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/lamindb_setup/core/types.py +0 -0
  70. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/noxfile.py +0 -0
  71. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/pyproject.toml +0 -0
  72. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/tests/hub-cloud/test_connect_instance.py +0 -0
  73. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/tests/hub-cloud/test_delete_instance.py +0 -0
  74. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/tests/hub-cloud/test_init_instance.py +0 -0
  75. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/tests/hub-cloud/test_login.py +0 -0
  76. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/tests/hub-cloud/test_migrate.py +0 -0
  77. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/tests/hub-cloud/test_set_storage.py +0 -0
  78. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/tests/hub-local/conftest.py +0 -0
  79. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/tests/hub-local/test_all.py +0 -0
  80. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/tests/hub-prod/conftest.py +0 -0
  81. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/tests/hub-prod/test_auto_connect.py +0 -0
  82. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/tests/hub-prod/test_django.py +0 -0
  83. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/tests/hub-prod/test_switch_and_fallback_env.py +0 -0
  84. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/tests/hub-prod/test_upath.py +0 -0
  85. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/tests/storage/test_hashing.py +0 -0
  86. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/tests/storage/test_storage_access.py +0 -0
  87. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/tests/storage/test_storage_basis.py +0 -0
  88. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/tests/storage/test_storage_stats.py +0 -0
  89. {lamindb_setup-0.71.1 → lamindb_setup-0.71.2}/tests/storage/test_to_url.py +0 -0
@@ -12,6 +12,7 @@ jobs:
12
12
  # tests only on production hub
13
13
  hub-prod:
14
14
  runs-on: ubuntu-latest
15
+ timeout-minutes: 10
15
16
  steps:
16
17
  - uses: actions/checkout@v3
17
18
  - uses: actions/setup-python@v4
@@ -60,7 +61,7 @@ jobs:
60
61
  repository: laminlabs/laminapp-ui
61
62
  token: ${{ secrets.GH_TOKEN_DEPLOY_LAMINAPP }}
62
63
  path: laminhub
63
- ref: main
64
+ ref: 11b0e5065d6f1a05484e1ef8ab8413f3c65bfa5a
64
65
  - uses: actions/cache@v3
65
66
  with:
66
67
  path: ~/.cache/pre-commit
@@ -91,6 +92,7 @@ jobs:
91
92
  # test user access to storage
92
93
  storage:
93
94
  runs-on: ubuntu-latest
95
+ timeout-minutes: 10
94
96
  steps:
95
97
  - uses: actions/checkout@v4
96
98
  - uses: actions/setup-python@v4
@@ -114,7 +116,7 @@ jobs:
114
116
  # test low-level hub functionality
115
117
  hub-local:
116
118
  runs-on: ubuntu-latest
117
- timeout-minutes: 15
119
+ timeout-minutes: 10
118
120
  steps:
119
121
  - uses: aws-actions/configure-aws-credentials@v2
120
122
  with:
@@ -128,7 +130,7 @@ jobs:
128
130
  repository: laminlabs/laminapp-ui
129
131
  token: ${{ secrets.GH_TOKEN_DEPLOY_LAMINAPP }}
130
132
  path: laminhub
131
- ref: main
133
+ ref: 11b0e5065d6f1a05484e1ef8ab8413f3c65bfa5a
132
134
  - name: Set env file for local test of edge functions
133
135
  run: |
134
136
  touch .env.local
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: lamindb_setup
3
- Version: 0.71.1
3
+ Version: 0.71.2
4
4
  Summary: Setup & configure LaminDB.
5
5
  Author-email: Lamin Labs <laminlabs@gmail.com>
6
6
  Description-Content-Type: text/markdown
@@ -3,6 +3,9 @@
3
3
  <!-- prettier-ignore -->
4
4
  Name | PR | Developer | Date | Version
5
5
  --- | --- | --- | --- | ---
6
+ ♻️ Actually use local db | [751](https://github.com/laminlabs/lamindb-setup/pull/751) | [falexwolf](https://github.com/falexwolf) | 2024-05-06 | 0.71.2
7
+ ✏️ Restore view_tree py3.9 compatibility | [750](https://github.com/laminlabs/lamindb-setup/pull/750) | [sunnyosun](https://github.com/sunnyosun) | 2024-05-06 |
8
+ 💚 Pin laminapp-ui | [749](https://github.com/laminlabs/lamindb-setup/pull/749) | [falexwolf](https://github.com/falexwolf) | 2024-05-06 |
6
9
  ♻️ Extend valid suffixes to composite suffixes | [746](https://github.com/laminlabs/lamindb-setup/pull/746) | [falexwolf](https://github.com/falexwolf) | 2024-05-03 | 0.71.1
7
10
  🐛 Fix test failures | [745](https://github.com/laminlabs/lamindb-setup/pull/745) | [Koncopd](https://github.com/Koncopd) | 2024-05-03 |
8
11
  ♻️ Persist keep-artifacts-local in settings.env | [743](https://github.com/laminlabs/lamindb-setup/pull/743) | [falexwolf](https://github.com/falexwolf) | 2024-05-03 |
@@ -34,7 +34,7 @@ Modules & settings:
34
34
 
35
35
  """
36
36
 
37
- __version__ = "0.71.1" # denote a release candidate for 0.1.0 with 0.1rc1
37
+ __version__ = "0.71.2" # denote a release candidate for 0.1.0 with 0.1rc1
38
38
 
39
39
  import sys
40
40
  from os import name as _os_name
@@ -107,7 +107,7 @@ def connect(
107
107
  *,
108
108
  db: str | None = None,
109
109
  storage: UPathStr | None = None,
110
- _raise_not_reachable_error: bool = True,
110
+ _raise_not_found_error: bool = True,
111
111
  _test: bool = False,
112
112
  ) -> str | tuple | None:
113
113
  """Connect to instance.
@@ -181,12 +181,12 @@ def connect(
181
181
  if settings_file.exists():
182
182
  isettings = load_instance_settings(settings_file)
183
183
  if isettings.is_remote:
184
- if _raise_not_reachable_error:
184
+ if _raise_not_found_error:
185
185
  raise InstanceNotFoundError(message)
186
186
  return "instance-not-found"
187
187
 
188
188
  else:
189
- if _raise_not_reachable_error:
189
+ if _raise_not_found_error:
190
190
  raise InstanceNotFoundError(message)
191
191
  return "instance-not-found"
192
192
 
@@ -209,7 +209,7 @@ def connect(
209
209
  f" {isettings._sqlite_file_local}\nTo push the file to the cloud,"
210
210
  " call: lamin close"
211
211
  )
212
- elif _raise_not_reachable_error:
212
+ elif _raise_not_found_error:
213
213
  raise SystemExit(msg)
214
214
  else:
215
215
  logger.warning(
@@ -184,7 +184,7 @@ def validate_init_args(
184
184
  name_str = infer_instance_name(storage=storage, name=name, db=db)
185
185
  # test whether instance exists by trying to load it
186
186
  instance_slug = f"{settings.user.handle}/{name_str}"
187
- response = connect(instance_slug, _raise_not_reachable_error=False, _test=_test)
187
+ response = connect(instance_slug, db=db, _raise_not_found_error=False, _test=_test)
188
188
  instance_state: Literal[
189
189
  "connected",
190
190
  "instance-corrupted-or-deleted",
@@ -290,7 +290,7 @@ def _init_instance(isettings: InstanceSettings, client: Client) -> None:
290
290
  client.table("storage").update(
291
291
  {"instance_id": isettings._id.hex, "is_default": True}
292
292
  ).eq("id", isettings.storage._uuid.hex).execute() # type: ignore
293
- logger.save(f"browse to: https://lamin.ai/{isettings.owner}/{isettings.name}")
293
+ logger.important(f"go to: https://lamin.ai/{isettings.owner}/{isettings.name}")
294
294
 
295
295
 
296
296
  def connect_instance(
@@ -46,6 +46,10 @@ class UserSettings:
46
46
  @property
47
47
  def id(self):
48
48
  """Integer id valid in current intance."""
49
- from lnschema_core.users import current_user_id
49
+ # do NOT use the function below because this
50
+ # doesn't error - it needs to be this way to have
51
+ # a user id available in migrations
52
+ # from lnschema_core.users import current_user_id
53
+ from lnschema_core.models import User
50
54
 
51
- return current_user_id()
55
+ return User.objects.get(uid=self.uid).id
@@ -471,7 +471,8 @@ def compute_file_tree(
471
471
  contents = [d for d in contents if d.is_dir()]
472
472
  pointers = [tee] * (len(contents) - 1) + [last]
473
473
  n_files_per_dir_and_type = defaultdict(lambda: 0) # type: ignore
474
- for pointer, child_path in zip(pointers, contents, strict=False): # type: ignore
474
+ # TODO: pass strict=False to zip with python > 3.9
475
+ for pointer, child_path in zip(pointers, contents): # type: ignore
475
476
  if child_path.is_dir():
476
477
  if include_dirs and child_path not in include_dirs:
477
478
  continue
@@ -504,8 +505,8 @@ def compute_file_tree(
504
505
  display_suffixes = ", ".join([f"{suffix!r}" for suffix in suffixes])
505
506
  suffix_message = f" with suffixes {display_suffixes}" if n_objects > 0 else ""
506
507
  message = (
507
- f"{path.name} ({n_directories} sub-{directory_info} &"
508
- f" {n_objects} files{suffix_message}): {folder_tree}"
508
+ f"{n_directories} sub-{directory_info} &"
509
+ f" {n_objects} files{suffix_message}\n{path.resolve()}{folder_tree}"
509
510
  )
510
511
  return message, n_objects
511
512
 
@@ -810,12 +811,12 @@ def check_storage_is_empty(
810
811
  if raise_error
811
812
  else "consider deleting them"
812
813
  )
813
- hint = "'./lamindb/_is_initialized' "
814
+ hint = "'_is_initialized'"
814
815
  if n_offset_objects == 2:
815
- hint += "& SQLite file"
816
+ hint += " & SQLite file"
816
817
  hint += " ignored"
817
818
  message = (
818
- f"Storage {directory_string} contains {n_objects} objects "
819
+ f"Storage {directory_string} contains {n_objects - n_offset_objects} objects "
819
820
  f"({hint}) - {ask_for_deletion}\n{objects}"
820
821
  )
821
822
  if n_diff > 0:
File without changes
File without changes