lamindb_setup 0.74.3__tar.gz → 0.75.0__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 (93) hide show
  1. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/PKG-INFO +1 -1
  2. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/docs/hub-cloud/04-test-bionty.ipynb +2 -2
  3. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/docs/hub-cloud/05-init-hosted-instance.ipynb +1 -1
  4. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/docs/hub-cloud/06-connect-hosted-instance.ipynb +1 -1
  5. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/docs/hub-prod/test-sqlite-lock.ipynb +1 -1
  6. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/lamindb_setup/__init__.py +1 -1
  7. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/lamindb_setup/_close.py +2 -1
  8. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/lamindb_setup/_connect_instance.py +101 -2
  9. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/lamindb_setup/_register_instance.py +4 -1
  10. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/lamindb_setup/_schema_metadata.py +2 -0
  11. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/lamindb_setup/core/_hub_core.py +10 -2
  12. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/lamindb_setup/core/_setup_bionty_sources.py +8 -8
  13. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/noxfile.py +2 -2
  14. lamindb_setup-0.75.0/tests/hub-local/conftest.py +29 -0
  15. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/tests/hub-local/test_update_schema_in_hub.py +1 -1
  16. lamindb_setup-0.74.3/tests/hub-local/conftest.py +0 -23
  17. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/.github/workflows/build.yml +0 -0
  18. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/.github/workflows/doc-changes.yml +0 -0
  19. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/.gitignore +0 -0
  20. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/.pre-commit-config.yaml +0 -0
  21. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/LICENSE +0 -0
  22. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/README.md +0 -0
  23. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/docs/changelog.md +0 -0
  24. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/docs/hub-cloud/01-init-local-instance.ipynb +0 -0
  25. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/docs/hub-cloud/02-connect-local-instance.ipynb +0 -0
  26. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/docs/hub-cloud/03-add-managed-storage.ipynb +0 -0
  27. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/docs/hub-cloud/07-keep-artifacts-local.ipynb +0 -0
  28. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/docs/hub-cloud/test-multi-session.ipynb +0 -0
  29. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/docs/hub-cloud/test_notebooks.py +0 -0
  30. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/docs/hub-prod/test-cache-management.ipynb +0 -0
  31. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/docs/hub-prod/test-cloud-sync.ipynb +0 -0
  32. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/docs/hub-prod/test-connect-anonymously.ipynb +0 -0
  33. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/docs/hub-prod/test-empty-init.ipynb +0 -0
  34. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/docs/hub-prod/test-import-schema.ipynb +0 -0
  35. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/docs/hub-prod/test-insufficient-user-info.ipynb +0 -0
  36. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/docs/hub-prod/test-invalid-schema.ipynb +0 -0
  37. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/docs/hub-prod/test_notebooks2.py +0 -0
  38. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/docs/index.md +0 -0
  39. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/docs/notebooks.md +0 -0
  40. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/docs/reference.md +0 -0
  41. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/lamindb_setup/_cache.py +0 -0
  42. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/lamindb_setup/_check.py +0 -0
  43. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/lamindb_setup/_check_setup.py +0 -0
  44. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/lamindb_setup/_delete.py +0 -0
  45. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/lamindb_setup/_django.py +0 -0
  46. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/lamindb_setup/_exportdb.py +0 -0
  47. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/lamindb_setup/_importdb.py +0 -0
  48. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/lamindb_setup/_init_instance.py +0 -0
  49. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/lamindb_setup/_migrate.py +0 -0
  50. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/lamindb_setup/_schema.py +0 -0
  51. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/lamindb_setup/_set_managed_storage.py +0 -0
  52. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/lamindb_setup/_setup_user.py +0 -0
  53. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/lamindb_setup/_silence_loggers.py +0 -0
  54. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/lamindb_setup/core/__init__.py +0 -0
  55. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/lamindb_setup/core/_aws_credentials.py +0 -0
  56. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/lamindb_setup/core/_aws_storage.py +0 -0
  57. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/lamindb_setup/core/_deprecated.py +0 -0
  58. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/lamindb_setup/core/_docs.py +0 -0
  59. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/lamindb_setup/core/_hub_client.py +0 -0
  60. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/lamindb_setup/core/_hub_crud.py +0 -0
  61. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/lamindb_setup/core/_hub_utils.py +0 -0
  62. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/lamindb_setup/core/_private_django_api.py +0 -0
  63. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/lamindb_setup/core/_settings.py +0 -0
  64. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/lamindb_setup/core/_settings_instance.py +0 -0
  65. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/lamindb_setup/core/_settings_load.py +0 -0
  66. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/lamindb_setup/core/_settings_save.py +0 -0
  67. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/lamindb_setup/core/_settings_storage.py +0 -0
  68. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/lamindb_setup/core/_settings_store.py +0 -0
  69. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/lamindb_setup/core/_settings_user.py +0 -0
  70. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/lamindb_setup/core/cloud_sqlite_locker.py +0 -0
  71. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/lamindb_setup/core/django.py +0 -0
  72. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/lamindb_setup/core/exceptions.py +0 -0
  73. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/lamindb_setup/core/hashing.py +0 -0
  74. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/lamindb_setup/core/types.py +0 -0
  75. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/lamindb_setup/core/upath.py +0 -0
  76. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/pyproject.toml +0 -0
  77. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/tests/hub-cloud/test_connect_instance.py +0 -0
  78. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/tests/hub-cloud/test_delete_instance.py +0 -0
  79. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/tests/hub-cloud/test_init_instance.py +0 -0
  80. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/tests/hub-cloud/test_login.py +0 -0
  81. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/tests/hub-cloud/test_migrate.py +0 -0
  82. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/tests/hub-cloud/test_set_storage.py +0 -0
  83. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/tests/hub-local/test_all.py +0 -0
  84. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/tests/hub-prod/conftest.py +0 -0
  85. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/tests/hub-prod/test_django.py +0 -0
  86. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/tests/hub-prod/test_global_settings.py +0 -0
  87. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/tests/hub-prod/test_switch_and_fallback_env.py +0 -0
  88. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/tests/hub-prod/test_upath.py +0 -0
  89. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/tests/storage/test_hashing.py +0 -0
  90. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/tests/storage/test_storage_access.py +0 -0
  91. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/tests/storage/test_storage_basis.py +0 -0
  92. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/tests/storage/test_storage_stats.py +0 -0
  93. {lamindb_setup-0.74.3 → lamindb_setup-0.75.0}/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.74.3
3
+ Version: 0.75.0
4
4
  Summary: Setup & configure LaminDB.
5
5
  Author-email: Lamin Labs <open-source@lamin.ai>
6
6
  Description-Content-Type: text/markdown
@@ -49,7 +49,7 @@
49
49
  "metadata": {},
50
50
  "outputs": [],
51
51
  "source": [
52
- "from lnschema_bionty import Source"
52
+ "from bionty import Source"
53
53
  ]
54
54
  },
55
55
  {
@@ -70,7 +70,7 @@
70
70
  },
71
71
  "outputs": [],
72
72
  "source": [
73
- "from bionty_base import settings as bionty_base_settings\n",
73
+ "from bionty.base import settings as bionty_base_settings\n",
74
74
  "\n",
75
75
  "assert sources_df.shape[0] > 0\n",
76
76
  "assert bionty_base_settings.lamindb_sources.exists()"
@@ -125,7 +125,7 @@
125
125
  "name": "python",
126
126
  "nbconvert_exporter": "python",
127
127
  "pygments_lexer": "ipython3",
128
- "version": "3.9.17"
128
+ "version": "3.10.13"
129
129
  }
130
130
  },
131
131
  "nbformat": 4,
@@ -170,7 +170,7 @@
170
170
  "name": "python",
171
171
  "nbconvert_exporter": "python",
172
172
  "pygments_lexer": "ipython3",
173
- "version": "3.9.17"
173
+ "version": "3.10.13"
174
174
  }
175
175
  },
176
176
  "nbformat": 4,
@@ -272,7 +272,7 @@
272
272
  "name": "python",
273
273
  "nbconvert_exporter": "python",
274
274
  "pygments_lexer": "ipython3",
275
- "version": "3.9.17"
275
+ "version": "3.10.13"
276
276
  }
277
277
  },
278
278
  "nbformat": 4,
@@ -34,7 +34,7 @@ Modules & settings:
34
34
 
35
35
  """
36
36
 
37
- __version__ = "0.74.3" # denote a release candidate for 0.1.0 with 0.1rc1
37
+ __version__ = "0.75.0" # 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
@@ -24,8 +24,9 @@ def close(mute: bool = False) -> None:
24
24
  logger.warning("did not upload cache file - not enough permissions")
25
25
  else:
26
26
  raise e
27
+ if "bionty" in settings.instance.schema:
28
+ delete_bionty_sources_yaml()
27
29
  current_instance_settings_file().unlink()
28
- delete_bionty_sources_yaml()
29
30
  clear_locker()
30
31
  if not mute:
31
32
  logger.success(f"closed instance: {instance}")
@@ -4,7 +4,6 @@ import os
4
4
  from typing import TYPE_CHECKING
5
5
  from uuid import UUID
6
6
 
7
- from django.db import ProgrammingError
8
7
  from lamin_utils import logger
9
8
 
10
9
  from ._check_setup import _check_instance_setup
@@ -21,7 +20,7 @@ from .core._settings import settings
21
20
  from .core._settings_instance import InstanceSettings
22
21
  from .core._settings_load import load_instance_settings
23
22
  from .core._settings_storage import StorageSettings
24
- from .core._settings_store import instance_settings_file
23
+ from .core._settings_store import instance_settings_file, settings_dir
25
24
  from .core.cloud_sqlite_locker import unlock_cloud_sqlite_upon_exception
26
25
 
27
26
  if TYPE_CHECKING:
@@ -257,9 +256,109 @@ def connect(
257
256
  if isettings is not None:
258
257
  isettings._get_settings_file().unlink(missing_ok=True) # type: ignore
259
258
  raise e
259
+ # rename lnschema_bionty to bionty for sql tables
260
+ if "bionty" in isettings.schema:
261
+ no_lnschema_bionty_file = (
262
+ settings_dir / f"no_lnschema_bionty-{isettings.slug.replace('/', '')}"
263
+ )
264
+ if not no_lnschema_bionty_file.exists():
265
+ migrate_lnschema_bionty(isettings, no_lnschema_bionty_file)
260
266
  return None
261
267
 
262
268
 
269
+ def migrate_lnschema_bionty(isettings: InstanceSettings, no_lnschema_bionty_file: Path):
270
+ """Migrate lnschema_bionty tables to bionty tables if bionty_source doesn't exist.
271
+
272
+ :param db_uri: str, database URI (e.g., 'sqlite:///path/to/db.sqlite' or 'postgresql://user:password@host:port/dbname')
273
+ """
274
+ from urllib.parse import urlparse
275
+
276
+ parsed_uri = urlparse(isettings.db)
277
+ db_type = parsed_uri.scheme
278
+
279
+ if db_type == "sqlite":
280
+ import sqlite3
281
+
282
+ conn = sqlite3.connect(parsed_uri.path)
283
+ elif db_type in ["postgresql", "postgres"]:
284
+ import psycopg2
285
+
286
+ conn = psycopg2.connect(isettings.db)
287
+ else:
288
+ raise ValueError("Unsupported database type. Use 'sqlite' or 'postgresql' URI.")
289
+
290
+ cur = conn.cursor()
291
+
292
+ try:
293
+ # check if bionty_source table exists
294
+ if db_type == "sqlite":
295
+ cur.execute(
296
+ "SELECT name FROM sqlite_master WHERE type='table' AND name='bionty_source'"
297
+ )
298
+ migrated = cur.fetchone() is not None
299
+
300
+ # tables that need to be renamed
301
+ cur.execute(
302
+ "SELECT name FROM sqlite_master WHERE type='table' AND name LIKE 'lnschema_bionty_%'"
303
+ )
304
+ tables_to_rename = [
305
+ row[0][len("lnschema_bionty_") :] for row in cur.fetchall()
306
+ ]
307
+ else: # postgres
308
+ cur.execute(
309
+ "SELECT EXISTS (SELECT FROM information_schema.tables WHERE table_name = 'bionty_source')"
310
+ )
311
+ migrated = cur.fetchone()[0]
312
+
313
+ # tables that need to be renamed
314
+ cur.execute(
315
+ "SELECT table_name FROM information_schema.tables WHERE table_name LIKE 'lnschema_bionty_%'"
316
+ )
317
+ tables_to_rename = [
318
+ row[0][len("lnschema_bionty_") :] for row in cur.fetchall()
319
+ ]
320
+
321
+ if migrated:
322
+ no_lnschema_bionty_file.touch(exist_ok=True)
323
+ else:
324
+ try:
325
+ # rename tables only if bionty_source doesn't exist and there are tables to rename
326
+ for table in tables_to_rename:
327
+ if db_type == "sqlite":
328
+ cur.execute(
329
+ f"ALTER TABLE lnschema_bionty_{table} RENAME TO bionty_{table}"
330
+ )
331
+ else: # postgres
332
+ cur.execute(
333
+ f"ALTER TABLE lnschema_bionty_{table} RENAME TO bionty_{table};"
334
+ )
335
+
336
+ # update django_migrations table
337
+ cur.execute(
338
+ "UPDATE django_migrations SET app = 'bionty' WHERE app = 'lnschema_bionty'"
339
+ )
340
+
341
+ logger.warning(
342
+ "Please uninstall lnschema-bionty via `pip uninstall lnschema-bionty`!"
343
+ )
344
+
345
+ no_lnschema_bionty_file.touch(exist_ok=True)
346
+ except Exception:
347
+ # read-only users can't rename tables
348
+ pass
349
+
350
+ conn.commit()
351
+
352
+ except Exception as e:
353
+ print(f"An error occurred: {e}")
354
+ conn.rollback()
355
+
356
+ finally:
357
+ # close the cursor and connection
358
+ cur.close()
359
+ conn.close()
360
+
361
+
263
362
  def load(
264
363
  slug: str,
265
364
  *,
@@ -23,7 +23,10 @@ def register(_test: bool = False):
23
23
  if ssettings._uid is None and _test:
24
24
  # because django isn't up, we can't get it from the database
25
25
  ssettings._uid = base62(8)
26
- init_storage_hub(ssettings)
26
+ # cannot yet populate the instance id here
27
+ ssettings._instance_id = None
28
+ # flag auto_populate_instance can be removed once FK migration is over
29
+ init_storage_hub(ssettings, auto_populate_instance=False)
27
30
  init_instance_hub(isettings)
28
31
  isettings._is_on_hub = True
29
32
  isettings._persist()
@@ -102,6 +102,8 @@ Type = Literal[
102
102
  "JSONField",
103
103
  "DateField",
104
104
  "FloatField",
105
+ "PositiveIntegerField",
106
+ "PositiveBigIntegerField",
105
107
  ]
106
108
 
107
109
 
@@ -118,11 +118,13 @@ def _select_storage(
118
118
 
119
119
  def init_storage(
120
120
  ssettings: StorageSettings,
121
+ auto_populate_instance: bool = True,
121
122
  ) -> None:
122
123
  if settings.user.handle != "anonymous":
123
124
  return call_with_fallback_auth(
124
125
  _init_storage,
125
126
  ssettings=ssettings,
127
+ auto_populate_instance=auto_populate_instance,
126
128
  )
127
129
  else:
128
130
  storage_exists = call_with_fallback(
@@ -134,7 +136,9 @@ def init_storage(
134
136
  raise ValueError("Log in to create a storage location on the hub.")
135
137
 
136
138
 
137
- def _init_storage(ssettings: StorageSettings, client: Client) -> None:
139
+ def _init_storage(
140
+ ssettings: StorageSettings, auto_populate_instance: bool, client: Client
141
+ ) -> None:
138
142
  from lamindb_setup import settings
139
143
 
140
144
  # storage roots are always stored without the trailing slash in the SQL
@@ -146,7 +150,11 @@ def _init_storage(ssettings: StorageSettings, client: Client) -> None:
146
150
  id = uuid.uuid5(uuid.NAMESPACE_URL, root)
147
151
  else:
148
152
  id = uuid.uuid4()
149
- if ssettings._instance_id is None and settings._instance_exists:
153
+ if (
154
+ ssettings._instance_id is None
155
+ and settings._instance_exists
156
+ and auto_populate_instance
157
+ ):
150
158
  logger.warning(
151
159
  f"will manage storage location {ssettings.root_as_str} with instance {settings.instance.slug}"
152
160
  )
@@ -14,9 +14,9 @@ def write_bionty_sources(isettings: InstanceSettings) -> None:
14
14
  return None
15
15
  import shutil
16
16
 
17
- import bionty_base
18
- from bionty_base.dev._handle_sources import parse_sources_yaml
19
- from lnschema_bionty.models import Source
17
+ import bionty.base as bionty_base
18
+ from bionty.base.dev._handle_sources import parse_sources_yaml
19
+ from bionty.models import Source
20
20
 
21
21
  shutil.copy(
22
22
  bionty_base.settings.current_sources, bionty_base.settings.lamindb_sources
@@ -58,10 +58,10 @@ def load_bionty_sources(isettings: InstanceSettings):
58
58
  if "bionty" not in isettings.schema:
59
59
  return None
60
60
 
61
- import bionty_base
62
- from bionty_base.dev._handle_sources import parse_currently_used_sources
63
- from bionty_base.dev._io import write_yaml
64
- from lnschema_bionty.models import Source
61
+ import bionty.base as bionty_base
62
+ from bionty.base.dev._handle_sources import parse_currently_used_sources
63
+ from bionty.base.dev._io import write_yaml
64
+ from bionty.models import Source
65
65
 
66
66
  try:
67
67
  # need try except because of integer primary key migration
@@ -77,7 +77,7 @@ def load_bionty_sources(isettings: InstanceSettings):
77
77
  def delete_bionty_sources_yaml():
78
78
  """Delete LAMINDB_SOURCES_PATH in bionty."""
79
79
  try:
80
- import bionty_base
80
+ import bionty.base as bionty_base
81
81
 
82
82
  bionty_base.settings.lamindb_sources.unlink(missing_ok=True)
83
83
  except ModuleNotFoundError:
@@ -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-bionty git+https://github.com/laminlabs/lnschema-core git+https://github.com/laminlabs/wetlab lamin-cli"
31
- schema_deps = f"""uv pip install --system bionty git+https://github.com/laminlabs/bionty-base
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
32
32
  uv pip install --system --no-deps {no_deps_packages}
33
33
  """
34
34
  if group == "hub-cloud":
@@ -0,0 +1,29 @@
1
+ from __future__ import annotations
2
+
3
+ import os
4
+
5
+ from laminhub_rest.dev._seed import seed_local_test
6
+ from laminhub_rest.dev._supabase import SupabaseResources
7
+ from laminhub_rest.dev._utils import remove_lamin_local_settings
8
+
9
+ supabase_resources = SupabaseResources()
10
+
11
+
12
+ pytest_plugins = [
13
+ "laminhub_rest.core.account.user.test.fixtures",
14
+ "laminhub_rest.test.fixtures.run_id",
15
+ ]
16
+
17
+
18
+ def pytest_configure():
19
+ os.environ["LAMIN_ENV"] = "local"
20
+ remove_lamin_local_settings()
21
+ supabase_resources.start_local()
22
+ supabase_resources.reset_local()
23
+ supabase_resources.migrate()
24
+ seed_local_test()
25
+
26
+
27
+ def pytest_unconfigure():
28
+ if supabase_resources.edge_function_process:
29
+ supabase_resources.stop_local_edge_functions()
@@ -79,7 +79,7 @@ def test_update_schema_in_hub(setup_instance):
79
79
  "through": {
80
80
  "left_key": "gene_id",
81
81
  "right_key": "pathway_id",
82
- "link_table_name": "lnschema_bionty_pathway_genes",
82
+ "link_table_name": "bionty_pathway_genes",
83
83
  },
84
84
  "field_name": "pathways",
85
85
  "model_name": "gene",
@@ -1,23 +0,0 @@
1
- from __future__ import annotations
2
-
3
- import os
4
-
5
- from lamin_utils import logger
6
- from laminhub_rest.dev._setup_laminapp_rest import setup_local
7
-
8
- pytest_plugins = [
9
- "laminhub_rest.core.account.user.test.fixtures",
10
- "laminhub_rest.test.fixtures.run_id",
11
- ]
12
-
13
- local_setup_state = setup_local()
14
-
15
-
16
- def pytest_configure():
17
- assert os.environ["LAMIN_ENV"] == "local"
18
- local_setup_state.__enter__()
19
-
20
-
21
- def pytest_unconfigure():
22
- if os.environ["LAMIN_ENV"] == "local":
23
- local_setup_state.__exit__(None, None, None)
File without changes
File without changes