lamindb_setup 0.75.0__tar.gz → 0.76.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 (92) hide show
  1. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/.pre-commit-config.yaml +1 -1
  2. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/PKG-INFO +1 -1
  3. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/docs/hub-cloud/01-init-local-instance.ipynb +4 -1
  4. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/docs/hub-cloud/04-test-bionty.ipynb +1 -1
  5. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/lamindb_setup/__init__.py +1 -1
  6. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/lamindb_setup/_init_instance.py +11 -4
  7. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/lamindb_setup/core/__init__.py +1 -0
  8. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/lamindb_setup/core/_hub_core.py +3 -1
  9. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/lamindb_setup/core/_settings_instance.py +11 -10
  10. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/lamindb_setup/core/_settings_storage.py +10 -5
  11. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/lamindb_setup/core/_setup_bionty_sources.py +16 -1
  12. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/lamindb_setup/core/hashing.py +6 -4
  13. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/lamindb_setup/core/upath.py +1 -1
  14. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/noxfile.py +2 -2
  15. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/tests/hub-local/test_update_schema_in_hub.py +22 -8
  16. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/.github/workflows/build.yml +0 -0
  17. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/.github/workflows/doc-changes.yml +0 -0
  18. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/.gitignore +0 -0
  19. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/LICENSE +0 -0
  20. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/README.md +0 -0
  21. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/docs/changelog.md +0 -0
  22. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/docs/hub-cloud/02-connect-local-instance.ipynb +0 -0
  23. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/docs/hub-cloud/03-add-managed-storage.ipynb +0 -0
  24. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/docs/hub-cloud/05-init-hosted-instance.ipynb +0 -0
  25. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/docs/hub-cloud/06-connect-hosted-instance.ipynb +0 -0
  26. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/docs/hub-cloud/07-keep-artifacts-local.ipynb +0 -0
  27. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/docs/hub-cloud/test-multi-session.ipynb +0 -0
  28. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/docs/hub-cloud/test_notebooks.py +0 -0
  29. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/docs/hub-prod/test-cache-management.ipynb +0 -0
  30. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/docs/hub-prod/test-cloud-sync.ipynb +0 -0
  31. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/docs/hub-prod/test-connect-anonymously.ipynb +0 -0
  32. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/docs/hub-prod/test-empty-init.ipynb +0 -0
  33. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/docs/hub-prod/test-import-schema.ipynb +0 -0
  34. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/docs/hub-prod/test-insufficient-user-info.ipynb +0 -0
  35. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/docs/hub-prod/test-invalid-schema.ipynb +0 -0
  36. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/docs/hub-prod/test-sqlite-lock.ipynb +0 -0
  37. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/docs/hub-prod/test_notebooks2.py +0 -0
  38. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/docs/index.md +0 -0
  39. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/docs/notebooks.md +0 -0
  40. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/docs/reference.md +0 -0
  41. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/lamindb_setup/_cache.py +0 -0
  42. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/lamindb_setup/_check.py +0 -0
  43. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/lamindb_setup/_check_setup.py +0 -0
  44. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/lamindb_setup/_close.py +0 -0
  45. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/lamindb_setup/_connect_instance.py +0 -0
  46. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/lamindb_setup/_delete.py +0 -0
  47. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/lamindb_setup/_django.py +0 -0
  48. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/lamindb_setup/_exportdb.py +0 -0
  49. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/lamindb_setup/_importdb.py +0 -0
  50. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/lamindb_setup/_migrate.py +0 -0
  51. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/lamindb_setup/_register_instance.py +0 -0
  52. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/lamindb_setup/_schema.py +0 -0
  53. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/lamindb_setup/_schema_metadata.py +0 -0
  54. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/lamindb_setup/_set_managed_storage.py +0 -0
  55. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/lamindb_setup/_setup_user.py +0 -0
  56. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/lamindb_setup/_silence_loggers.py +0 -0
  57. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/lamindb_setup/core/_aws_credentials.py +0 -0
  58. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/lamindb_setup/core/_aws_storage.py +0 -0
  59. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/lamindb_setup/core/_deprecated.py +0 -0
  60. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/lamindb_setup/core/_docs.py +0 -0
  61. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/lamindb_setup/core/_hub_client.py +0 -0
  62. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/lamindb_setup/core/_hub_crud.py +0 -0
  63. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/lamindb_setup/core/_hub_utils.py +0 -0
  64. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/lamindb_setup/core/_private_django_api.py +0 -0
  65. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/lamindb_setup/core/_settings.py +0 -0
  66. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/lamindb_setup/core/_settings_load.py +0 -0
  67. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/lamindb_setup/core/_settings_save.py +0 -0
  68. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/lamindb_setup/core/_settings_store.py +0 -0
  69. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/lamindb_setup/core/_settings_user.py +0 -0
  70. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/lamindb_setup/core/cloud_sqlite_locker.py +0 -0
  71. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/lamindb_setup/core/django.py +0 -0
  72. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/lamindb_setup/core/exceptions.py +0 -0
  73. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/lamindb_setup/core/types.py +0 -0
  74. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/pyproject.toml +0 -0
  75. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/tests/hub-cloud/test_connect_instance.py +0 -0
  76. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/tests/hub-cloud/test_delete_instance.py +0 -0
  77. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/tests/hub-cloud/test_init_instance.py +0 -0
  78. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/tests/hub-cloud/test_login.py +0 -0
  79. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/tests/hub-cloud/test_migrate.py +0 -0
  80. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/tests/hub-cloud/test_set_storage.py +0 -0
  81. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/tests/hub-local/conftest.py +0 -0
  82. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/tests/hub-local/test_all.py +0 -0
  83. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/tests/hub-prod/conftest.py +0 -0
  84. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/tests/hub-prod/test_django.py +0 -0
  85. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/tests/hub-prod/test_global_settings.py +0 -0
  86. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/tests/hub-prod/test_switch_and_fallback_env.py +0 -0
  87. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/tests/hub-prod/test_upath.py +0 -0
  88. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/tests/storage/test_hashing.py +0 -0
  89. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/tests/storage/test_storage_access.py +0 -0
  90. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/tests/storage/test_storage_basis.py +0 -0
  91. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/tests/storage/test_storage_stats.py +0 -0
  92. {lamindb_setup-0.75.0 → lamindb_setup-0.76.1}/tests/storage/test_to_url.py +0 -0
@@ -17,7 +17,7 @@ repos:
17
17
  docs/notes/
18
18
  )
19
19
  - repo: https://github.com/astral-sh/ruff-pre-commit
20
- rev: v0.1.7
20
+ rev: v0.5.5
21
21
  hooks:
22
22
  - id: ruff
23
23
  args: [--fix, --exit-non-zero-on-fix, --unsafe-fixes]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: lamindb_setup
3
- Version: 0.75.0
3
+ Version: 0.76.1
4
4
  Summary: Setup & configure LaminDB.
5
5
  Author-email: Lamin Labs <open-source@lamin.ai>
6
6
  Description-Content-Type: text/markdown
@@ -48,6 +48,7 @@
48
48
  "outputs": [],
49
49
  "source": [
50
50
  "from pathlib import Path\n",
51
+ "from lnschema_core.models import Storage\n",
51
52
  "\n",
52
53
  "assert ln_setup.settings.instance.storage.type_is_cloud == False\n",
53
54
  "assert ln_setup.settings.instance.owner == ln_setup.settings.user.handle\n",
@@ -59,7 +60,9 @@
59
60
  "assert (\n",
60
61
  " ln_setup.settings.instance.db\n",
61
62
  " == f\"sqlite:///{Path('./mydata').resolve().as_posix()}/{ln_setup.settings.instance._id.hex}.lndb\"\n",
62
- ")"
63
+ ")\n",
64
+ "assert ln_setup.settings.storage._instance_id == ln_setup.settings.instance._id\n",
65
+ "assert Storage.objects.get(instance_uid=ln_setup.settings.instance.uid).root == ln_setup.settings.storage.root_as_str\n"
63
66
  ]
64
67
  },
65
68
  {
@@ -154,7 +154,7 @@
154
154
  "name": "python",
155
155
  "nbconvert_exporter": "python",
156
156
  "pygments_lexer": "ipython3",
157
- "version": "3.9.16"
157
+ "version": "3.10.13"
158
158
  },
159
159
  "vscode": {
160
160
  "interpreter": {
@@ -34,7 +34,7 @@ Modules & settings:
34
34
 
35
35
  """
36
36
 
37
- __version__ = "0.75.0" # denote a release candidate for 0.1.0 with 0.1rc1
37
+ __version__ = "0.76.1" # 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
@@ -15,6 +15,7 @@ from ._close import close as close_instance
15
15
  from ._silence_loggers import silence_loggers
16
16
  from .core import InstanceSettings
17
17
  from .core._settings import settings
18
+ from .core._settings_instance import is_local_db_url
18
19
  from .core._settings_storage import StorageSettings, init_storage
19
20
  from .core.upath import UPath
20
21
 
@@ -245,10 +246,16 @@ def init(
245
246
  if instance_state == "connected":
246
247
  settings.auto_connect = True # we can also debate this switch here
247
248
  return None
248
- # cannot past instance_id here because instance does not yet exist!
249
- # the instance_id field of the storage table is populated at the end of
250
- # init_instance_hub
251
- ssettings = init_storage(storage)
249
+ # the conditions here match `isettings.is_remote`, but I currently don't
250
+ # see a way of making this more elegant; should become possible if we
251
+ # remove the instance.storage_id FK on the hub
252
+ prevent_register_hub = is_local_db_url(db) if db is not None else False
253
+ ssettings = init_storage(
254
+ storage,
255
+ instance_id=instance_id,
256
+ init_instance=True,
257
+ prevent_register_hub=prevent_register_hub,
258
+ )
252
259
  isettings = InstanceSettings(
253
260
  id=instance_id, # type: ignore
254
261
  owner=settings.user.handle,
@@ -11,6 +11,7 @@ Settings:
11
11
  StorageSettings
12
12
 
13
13
  """
14
+
14
15
  from . import django, types, upath
15
16
  from ._deprecated import deprecated
16
17
  from ._docs import doc_args
@@ -160,7 +160,9 @@ def _init_storage(
160
160
  )
161
161
  ssettings._instance_id = settings.instance._id
162
162
  instance_id_hex = (
163
- None if ssettings._instance_id is None else ssettings._instance_id.hex
163
+ ssettings._instance_id.hex
164
+ if (ssettings._instance_id is not None and auto_populate_instance)
165
+ else None
164
166
  )
165
167
  fields = {
166
168
  "id": id.hex,
@@ -29,6 +29,16 @@ def sanitize_git_repo_url(repo_url: str) -> str:
29
29
  return repo_url.replace(".git", "")
30
30
 
31
31
 
32
+ def is_local_db_url(db_url: str) -> bool:
33
+ if "@localhost:" in db_url:
34
+ return True
35
+ if "@0.0.0.0:" in db_url:
36
+ return True
37
+ if "@127.0.0.1" in db_url:
38
+ return True
39
+ return False
40
+
41
+
32
42
  class InstanceSettings:
33
43
  """Instance settings."""
34
44
 
@@ -370,17 +380,8 @@ class InstanceSettings:
370
380
  if not self.storage.type_is_cloud:
371
381
  return False
372
382
 
373
- def is_local_uri(uri: str):
374
- if "@localhost:" in uri:
375
- return True
376
- if "@0.0.0.0:" in uri:
377
- return True
378
- if "@127.0.0.1" in uri:
379
- return True
380
- return False
381
-
382
383
  if self.dialect == "postgresql":
383
- if is_local_uri(self.db):
384
+ if is_local_db_url(self.db):
384
385
  return False
385
386
  # returns True for cloud SQLite
386
387
  # and remote postgres
@@ -78,7 +78,11 @@ def mark_storage_root(root: UPathStr, uid: str):
78
78
 
79
79
 
80
80
  def init_storage(
81
- root: UPathStr, instance_id: UUID | None = None, register_hub: bool | None = None
81
+ root: UPathStr,
82
+ instance_id: UUID | None = None,
83
+ register_hub: bool | None = None,
84
+ prevent_register_hub: bool = False,
85
+ init_instance: bool = False,
82
86
  ) -> StorageSettings:
83
87
  if root is None:
84
88
  raise ValueError("`storage` argument can't be `None`")
@@ -114,11 +118,12 @@ def init_storage(
114
118
  instance_id=instance_id,
115
119
  )
116
120
  # the below might update the uid with one that's already taken on the hub
117
- if ssettings.type_is_cloud or register_hub:
118
- from ._hub_core import delete_storage_record
119
- from ._hub_core import init_storage as init_storage_hub
121
+ if not prevent_register_hub:
122
+ if ssettings.type_is_cloud or register_hub:
123
+ from ._hub_core import delete_storage_record
124
+ from ._hub_core import init_storage as init_storage_hub
120
125
 
121
- init_storage_hub(ssettings)
126
+ init_storage_hub(ssettings, auto_populate_instance=not init_instance)
122
127
  # below comes last only if everything else was successful
123
128
  try:
124
129
  # (federated) credentials for AWS access are provisioned under-the-hood
@@ -7,6 +7,9 @@ from django.db.utils import OperationalError, ProgrammingError
7
7
  if TYPE_CHECKING:
8
8
  from ._settings_instance import InstanceSettings
9
9
 
10
+ # bionty.Source -> bionty.base
11
+ RENAME = {"name": "source", "description": "source_name"}
12
+
10
13
 
11
14
  def write_bionty_sources(isettings: InstanceSettings) -> None:
12
15
  """Write bionty sources to Source table."""
@@ -14,10 +17,14 @@ def write_bionty_sources(isettings: InstanceSettings) -> None:
14
17
  return None
15
18
  import shutil
16
19
 
20
+ import bionty
17
21
  import bionty.base as bionty_base
22
+ from bionty._bionty import list_biorecord_models
18
23
  from bionty.base.dev._handle_sources import parse_sources_yaml
19
24
  from bionty.models import Source
20
25
 
26
+ bionty_models = list_biorecord_models(bionty)
27
+
21
28
  shutil.copy(
22
29
  bionty_base.settings.current_sources, bionty_base.settings.lamindb_sources
23
30
  )
@@ -46,7 +53,10 @@ def write_bionty_sources(isettings: InstanceSettings) -> None:
46
53
  # won't need this once lamindb is released with the new pin
47
54
  kwargs["run"] = None # can't yet access tracking information
48
55
  kwargs["in_db"] = False
49
- # kwargs["name"] = kwargs.pop("source")
56
+ for db_field, base_col in RENAME.items():
57
+ kwargs[db_field] = kwargs.pop(base_col)
58
+ if kwargs["entity"] in bionty_models:
59
+ kwargs["entity"] = f"bionty.{kwargs['entity']}"
50
60
  record = Source(**kwargs)
51
61
  all_records.append(record)
52
62
 
@@ -66,6 +76,11 @@ def load_bionty_sources(isettings: InstanceSettings):
66
76
  try:
67
77
  # need try except because of integer primary key migration
68
78
  active_records = Source.objects.filter(currently_used=True).all().values()
79
+ for kwargs in active_records:
80
+ for db_field, base_col in RENAME.items():
81
+ kwargs[base_col] = kwargs.pop(db_field)
82
+ # TODO: non-bionty schema?
83
+ kwargs["entity"] = kwargs["entity"].replace("bionty.", "")
69
84
  write_yaml(
70
85
  parse_currently_used_sources(active_records),
71
86
  bionty_base.settings.lamindb_sources,
@@ -17,6 +17,8 @@ from typing import TYPE_CHECKING, Iterable
17
17
 
18
18
  import psutil
19
19
 
20
+ HASH_LENGTH = 22
21
+
20
22
  if TYPE_CHECKING:
21
23
  from .types import Path, UPathStr
22
24
 
@@ -39,8 +41,8 @@ def b16_to_b64(s: str):
39
41
  # a lot to read about this: lamin-notes/2022/hashing
40
42
  def hash_set(s: set[str]) -> str:
41
43
  bstr = ":".join(sorted(s)).encode("utf-8")
42
- # as we're truncating at 20 b64, we choose md5 over sha512
43
- return to_b64_str(hashlib.md5(bstr).digest())[:20]
44
+ # as we're truncating at 22 b64, we choose md5 over sha512
45
+ return to_b64_str(hashlib.md5(bstr).digest())[:HASH_LENGTH]
44
46
 
45
47
 
46
48
  def hash_md5s_from_dir(hashes: Iterable[str]) -> tuple[str, str]:
@@ -50,7 +52,7 @@ def hash_md5s_from_dir(hashes: Iterable[str]) -> tuple[str, str]:
50
52
  hashlib.md5(hash.encode("utf-8")).digest() for hash in sorted(hashes)
51
53
  )
52
54
  digest = hashlib.md5(digests).digest()
53
- return to_b64_str(digest)[:22], "md5-d"
55
+ return to_b64_str(digest)[:HASH_LENGTH], "md5-d"
54
56
 
55
57
 
56
58
  def hash_code(file_path: UPathStr):
@@ -85,7 +87,7 @@ def hash_file(
85
87
  hashlib.sha1(first_chunk).digest() + hashlib.sha1(last_chunk).digest()
86
88
  ).digest()
87
89
  hash_type = "sha1-fl"
88
- return to_b64_str(digest)[:22], hash_type
90
+ return to_b64_str(digest)[:HASH_LENGTH], hash_type
89
91
 
90
92
 
91
93
  def hash_dir(path: Path):
@@ -772,7 +772,7 @@ def check_storage_is_empty(
772
772
  hint += " ignored"
773
773
  message = (
774
774
  f"Storage {directory_string} contains {n_objects - n_offset_objects} objects "
775
- f"({hint}) - {ask_for_deletion}\n{objects}"
775
+ f"({hint}) - {ask_for_deletion}"
776
776
  )
777
777
  if n_diff > 0:
778
778
  if raise_error:
@@ -27,8 +27,8 @@ def lint(session: nox.Session) -> None:
27
27
  ["hub-local", "hub-prod", "hub-cloud", "storage", "docs"],
28
28
  )
29
29
  def install(session: nox.Session, group: str) -> None:
30
- no_deps_packages = "git+https://github.com/laminlabs/lnschema-core git+https://github.com/laminlabs/wetlab@single-bionty-repo lamin-cli"
31
- schema_deps = f"""uv pip install --system git+https://github.com/laminlabs/bionty git+https://github.com/laminlabs/lamindb@single-bionty-repo
30
+ no_deps_packages = "git+https://github.com/laminlabs/lnschema-core git+https://github.com/laminlabs/wetlab lamin-cli"
31
+ schema_deps = f"""uv pip install --system git+https://github.com/laminlabs/bionty git+https://github.com/laminlabs/lamindb@main
32
32
  uv pip install --system --no-deps {no_deps_packages}
33
33
  """
34
34
  if group == "hub-cloud":
@@ -55,6 +55,20 @@ def test_update_schema_in_hub(setup_instance):
55
55
  "related_schema_name": None,
56
56
  }
57
57
 
58
+ assert schema["schema_json"]["core"]["artifact"]["fields"]["_accessor"] == {
59
+ "type": "CharField",
60
+ "column_name": "accessor",
61
+ "through": None,
62
+ "field_name": "_accessor",
63
+ "model_name": "artifact",
64
+ "schema_name": "core",
65
+ "is_link_table": False,
66
+ "relation_type": None,
67
+ "related_field_name": None,
68
+ "related_model_name": None,
69
+ "related_schema_name": None,
70
+ }
71
+
58
72
  assert schema["schema_json"]["core"]["artifact"]["fields"]["created_by"] == {
59
73
  "type": "ForeignKey",
60
74
  "column_name": "created_by_id",
@@ -109,38 +123,38 @@ def test_update_schema_in_hub(setup_instance):
109
123
  "related_schema_name": "core",
110
124
  }
111
125
 
112
- assert schema["schema_json"]["core"]["transform"]["fields"]["parents"] == {
126
+ assert schema["schema_json"]["core"]["transform"]["fields"]["predecessors"] == {
113
127
  "type": "ManyToManyField",
114
128
  "column_name": None,
115
129
  "through": {
116
130
  "left_key": "from_transform_id",
117
131
  "right_key": "to_transform_id",
118
- "link_table_name": "lnschema_core_transform_parents",
132
+ "link_table_name": "lnschema_core_transform_predecessors",
119
133
  },
120
- "field_name": "parents",
134
+ "field_name": "predecessors",
121
135
  "model_name": "transform",
122
136
  "schema_name": "core",
123
137
  "is_link_table": False,
124
138
  "relation_type": "many-to-many",
125
- "related_field_name": "children",
139
+ "related_field_name": "successors",
126
140
  "related_model_name": "transform",
127
141
  "related_schema_name": "core",
128
142
  }
129
143
 
130
- assert schema["schema_json"]["core"]["transform"]["fields"]["children"] == {
144
+ assert schema["schema_json"]["core"]["transform"]["fields"]["successors"] == {
131
145
  "type": "ManyToManyField",
132
146
  "column_name": None,
133
147
  "through": {
134
148
  "left_key": "to_transform_id",
135
149
  "right_key": "from_transform_id",
136
- "link_table_name": "lnschema_core_transform_parents",
150
+ "link_table_name": "lnschema_core_transform_predecessors",
137
151
  },
138
- "field_name": "children",
152
+ "field_name": "successors",
139
153
  "model_name": "transform",
140
154
  "schema_name": "core",
141
155
  "is_link_table": False,
142
156
  "relation_type": "many-to-many",
143
- "related_field_name": "parents",
157
+ "related_field_name": "predecessors",
144
158
  "related_model_name": "transform",
145
159
  "related_schema_name": "core",
146
160
  }
File without changes
File without changes