lamindb_setup 0.72.1__tar.gz → 0.72.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 (90) hide show
  1. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/PKG-INFO +1 -1
  2. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/docs/changelog.md +2 -0
  3. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/lamindb_setup/__init__.py +1 -1
  4. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/lamindb_setup/core/_aws_credentials.py +9 -2
  5. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/lamindb_setup/core/_settings_instance.py +9 -1
  6. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/.github/workflows/build.yml +0 -0
  7. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/.github/workflows/latest-changes.jinja2 +0 -0
  8. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/.github/workflows/latest-changes.yml +0 -0
  9. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/.gitignore +0 -0
  10. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/.pre-commit-config.yaml +0 -0
  11. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/LICENSE +0 -0
  12. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/README.md +0 -0
  13. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/docs/hub-cloud/01-init-local-instance.ipynb +0 -0
  14. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/docs/hub-cloud/02-connect-local-instance.ipynb +0 -0
  15. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/docs/hub-cloud/03-add-managed-storage.ipynb +0 -0
  16. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/docs/hub-cloud/04-test-bionty.ipynb +0 -0
  17. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/docs/hub-cloud/05-init-hosted-instance.ipynb +0 -0
  18. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/docs/hub-cloud/06-connect-hosted-instance.ipynb +0 -0
  19. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/docs/hub-cloud/07-keep-artifacts-local.ipynb +0 -0
  20. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/docs/hub-cloud/test-multi-session.ipynb +0 -0
  21. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/docs/hub-cloud/test_notebooks.py +0 -0
  22. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/docs/hub-prod/test-cache-management.ipynb +0 -0
  23. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/docs/hub-prod/test-cloud-sync.ipynb +0 -0
  24. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/docs/hub-prod/test-connect-anonymously.ipynb +0 -0
  25. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/docs/hub-prod/test-empty-init.ipynb +0 -0
  26. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/docs/hub-prod/test-import-schema.ipynb +0 -0
  27. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/docs/hub-prod/test-insufficient-user-info.ipynb +0 -0
  28. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/docs/hub-prod/test-invalid-schema.ipynb +0 -0
  29. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/docs/hub-prod/test-sqlite-lock.ipynb +0 -0
  30. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/docs/hub-prod/test_notebooks2.py +0 -0
  31. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/docs/index.md +0 -0
  32. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/docs/notebooks.md +0 -0
  33. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/docs/reference.md +0 -0
  34. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/lamindb_setup/_cache.py +0 -0
  35. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/lamindb_setup/_check.py +0 -0
  36. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/lamindb_setup/_check_setup.py +0 -0
  37. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/lamindb_setup/_close.py +0 -0
  38. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/lamindb_setup/_connect_instance.py +0 -0
  39. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/lamindb_setup/_delete.py +0 -0
  40. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/lamindb_setup/_django.py +0 -0
  41. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/lamindb_setup/_exportdb.py +0 -0
  42. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/lamindb_setup/_importdb.py +0 -0
  43. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/lamindb_setup/_init_instance.py +0 -0
  44. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/lamindb_setup/_migrate.py +0 -0
  45. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/lamindb_setup/_register_instance.py +0 -0
  46. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/lamindb_setup/_schema.py +0 -0
  47. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/lamindb_setup/_set_managed_storage.py +0 -0
  48. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/lamindb_setup/_setup_user.py +0 -0
  49. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/lamindb_setup/_silence_loggers.py +0 -0
  50. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/lamindb_setup/core/__init__.py +0 -0
  51. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/lamindb_setup/core/_aws_storage.py +0 -0
  52. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/lamindb_setup/core/_deprecated.py +0 -0
  53. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/lamindb_setup/core/_docs.py +0 -0
  54. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/lamindb_setup/core/_hub_client.py +0 -0
  55. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/lamindb_setup/core/_hub_core.py +0 -0
  56. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/lamindb_setup/core/_hub_crud.py +0 -0
  57. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/lamindb_setup/core/_hub_utils.py +0 -0
  58. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/lamindb_setup/core/_settings.py +0 -0
  59. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/lamindb_setup/core/_settings_load.py +0 -0
  60. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/lamindb_setup/core/_settings_save.py +0 -0
  61. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/lamindb_setup/core/_settings_storage.py +0 -0
  62. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/lamindb_setup/core/_settings_store.py +0 -0
  63. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/lamindb_setup/core/_settings_user.py +0 -0
  64. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/lamindb_setup/core/_setup_bionty_sources.py +0 -0
  65. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/lamindb_setup/core/cloud_sqlite_locker.py +0 -0
  66. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/lamindb_setup/core/django.py +0 -0
  67. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/lamindb_setup/core/exceptions.py +0 -0
  68. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/lamindb_setup/core/hashing.py +0 -0
  69. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/lamindb_setup/core/types.py +0 -0
  70. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/lamindb_setup/core/upath.py +0 -0
  71. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/noxfile.py +0 -0
  72. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/pyproject.toml +0 -0
  73. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/tests/hub-cloud/test_connect_instance.py +0 -0
  74. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/tests/hub-cloud/test_delete_instance.py +0 -0
  75. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/tests/hub-cloud/test_init_instance.py +0 -0
  76. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/tests/hub-cloud/test_login.py +0 -0
  77. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/tests/hub-cloud/test_migrate.py +0 -0
  78. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/tests/hub-cloud/test_set_storage.py +0 -0
  79. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/tests/hub-local/conftest.py +0 -0
  80. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/tests/hub-local/test_all.py +0 -0
  81. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/tests/hub-prod/conftest.py +0 -0
  82. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/tests/hub-prod/test_auto_connect.py +0 -0
  83. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/tests/hub-prod/test_django.py +0 -0
  84. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/tests/hub-prod/test_switch_and_fallback_env.py +0 -0
  85. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/tests/hub-prod/test_upath.py +0 -0
  86. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/tests/storage/test_hashing.py +0 -0
  87. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/tests/storage/test_storage_access.py +0 -0
  88. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/tests/storage/test_storage_basis.py +0 -0
  89. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/tests/storage/test_storage_stats.py +0 -0
  90. {lamindb_setup-0.72.1 → lamindb_setup-0.72.2}/tests/storage/test_to_url.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: lamindb_setup
3
- Version: 0.72.1
3
+ Version: 0.72.2
4
4
  Summary: Setup & configure LaminDB.
5
5
  Author-email: Lamin Labs <laminlabs@gmail.com>
6
6
  Description-Content-Type: text/markdown
@@ -3,7 +3,9 @@
3
3
  <!-- prettier-ignore -->
4
4
  Name | PR | Developer | Date | Version
5
5
  --- | --- | --- | --- | ---
6
+ 🐛 Deal with migration errors when keep-artifacts-local is true | [767](https://github.com/laminlabs/lamindb-setup/pull/767) | [falexwolf](https://github.com/falexwolf) | 2024-05-20 | 0.72.2
6
7
  ♻️ Do not error if empty dict in `access_aws` | [764](https://github.com/laminlabs/lamindb-setup/pull/764) | [falexwolf](https://github.com/falexwolf) | 2024-05-19 | 0.72.1
8
+ 🐛 Keep training slash in aws cache keys | [766](https://github.com/laminlabs/lamindb-setup/pull/766) | [Koncopd](https://github.com/Koncopd) | 2024-05-19 |
7
9
  🐛 Check empty after storage record root init in delete | [763](https://github.com/laminlabs/lamindb-setup/pull/763) | [Koncopd](https://github.com/Koncopd) | 2024-05-18 |
8
10
  ✨ Call `access_aws` for all paths and cache | [762](https://github.com/laminlabs/lamindb-setup/pull/762) | [Koncopd](https://github.com/Koncopd) | 2024-05-18 | 0.72.0
9
11
  ⚡️ Speed-up file hash | [761](https://github.com/laminlabs/lamindb-setup/pull/761) | [Koncopd](https://github.com/Koncopd) | 2024-05-11 | 0.71.4
@@ -34,7 +34,7 @@ Modules & settings:
34
34
 
35
35
  """
36
36
 
37
- __version__ = "0.72.1" # denote a release candidate for 0.1.0 with 0.1rc1
37
+ __version__ = "0.72.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
@@ -22,6 +22,10 @@ else:
22
22
  HOSTED_BUCKETS = ("s3://lamin-hosted-test",) # type: ignore
23
23
 
24
24
 
25
+ def _keep_trailing_slash(path_str: str):
26
+ return path_str if path_str[-1] == "/" else path_str + "/"
27
+
28
+
25
29
  AWS_CREDENTIALS_EXPIRATION = 11 * 60 * 60 # refresh credentials after 11 hours
26
30
 
27
31
 
@@ -81,7 +85,10 @@ class AWSCredentialsManager:
81
85
  return S3Path(path, cache_regions=cache_regions, **connection_options)
82
86
 
83
87
  def enrich_path(self, path: S3Path, access_token: str | None = None) -> S3Path:
84
- path_str = path.as_posix().rstrip("/")
88
+ # trailing slash is needed to avoid returning incorrect results
89
+ # with .startswith
90
+ # for example s3://lamindata-eu should not receive cache for s3://lamindata
91
+ path_str = _keep_trailing_slash(path.as_posix())
85
92
  root = self._find_root(path_str)
86
93
 
87
94
  if root is not None:
@@ -127,7 +134,7 @@ class AWSCredentialsManager:
127
134
  # write the bucket for everything else
128
135
  root = path._url.netloc
129
136
  root = "s3://" + root
130
- self._set_cached_credentials(root, credentials)
137
+ self._set_cached_credentials(_keep_trailing_slash(root), credentials)
131
138
 
132
139
  return self._path_inject_options(path, credentials)
133
140
 
@@ -5,6 +5,7 @@ import shutil
5
5
  from pathlib import Path
6
6
  from typing import TYPE_CHECKING, Literal
7
7
 
8
+ from django.db.utils import ProgrammingError
8
9
  from lamin_utils import logger
9
10
 
10
11
  from ._hub_client import call_with_fallback
@@ -106,8 +107,15 @@ class InstanceSettings:
106
107
  local_records = Storage.objects.filter(root=local_root)
107
108
  else:
108
109
  local_records = Storage.objects.filter(type="local")
110
+ all_local_records = local_records.all()
111
+ try:
112
+ # trigger an error in case of a migration issue
113
+ all_local_records.first()
114
+ except ProgrammingError:
115
+ logger.error("not able to load Storage registry: please migrate")
116
+ return None
109
117
  found = False
110
- for record in local_records.all():
118
+ for record in all_local_records:
111
119
  root_path = Path(record.root)
112
120
  if root_path.exists():
113
121
  marker_path = root_path / ".lamindb/_is_initialized"
File without changes
File without changes