lamindb_setup 1.0.1__py3-none-any.whl → 1.0.2__py3-none-any.whl

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.
lamindb_setup/__init__.py CHANGED
@@ -33,7 +33,7 @@ Modules & settings:
33
33
 
34
34
  """
35
35
 
36
- __version__ = "1.0.1" # denote a release candidate for 0.1.0 with 0.1rc1
36
+ __version__ = "1.0.2" # denote a release candidate for 0.1.0 with 0.1rc1
37
37
 
38
38
  import os
39
39
 
@@ -339,6 +339,25 @@ def migrate_lnschema_core(
339
339
  """Migrate lnschema_core tables to lamindb tables."""
340
340
  from urllib.parse import urlparse
341
341
 
342
+ if isettings.is_on_hub:
343
+ from lamindb_setup.core._hub_client import call_with_fallback_auth
344
+ from lamindb_setup.core._hub_crud import (
345
+ select_collaborator,
346
+ )
347
+
348
+ # double check that user is an admin, otherwise will fail below
349
+ # due to insufficient SQL permissions with cryptic error
350
+ collaborator = call_with_fallback_auth(
351
+ select_collaborator,
352
+ instance_id=settings.instance._id,
353
+ account_id=settings.user._uuid,
354
+ )
355
+ if collaborator is None or collaborator["role"] != "admin":
356
+ raise SystemExit(
357
+ "❌ Only admins can deploy migrations, please ensure that you're an"
358
+ f" admin: https://lamin.ai/{settings.instance.slug}/settings"
359
+ )
360
+
342
361
  parsed_uri = urlparse(isettings.db)
343
362
  db_type = parsed_uri.scheme
344
363
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: lamindb_setup
3
- Version: 1.0.1
3
+ Version: 1.0.2
4
4
  Summary: Setup & configure LaminDB.
5
5
  Author-email: Lamin Labs <open-source@lamin.ai>
6
6
  Requires-Python: >=3.10
@@ -1,9 +1,9 @@
1
- lamindb_setup/__init__.py,sha256=IMQj8c7P8mhACmlJoPc_4cGqpaw9mK9SCvBBH3WBxHM,2127
1
+ lamindb_setup/__init__.py,sha256=C1Or-KZftjcYsNBbezefoC84rq0GVDE2IJEt4kNeVec,2127
2
2
  lamindb_setup/_cache.py,sha256=aszT-zk3S5dTLKp5g1W-S_FPh2E5YVCALwWSGPJLWBM,1493
3
3
  lamindb_setup/_check.py,sha256=28PcG8Kp6OpjSLSi1r2boL2Ryeh6xkaCL87HFbjs6GA,129
4
4
  lamindb_setup/_check_setup.py,sha256=DJ4lZp4N9Dcri8H7PEOl-YDoi4qqfQnXvwBuL4venAw,3425
5
5
  lamindb_setup/_close.py,sha256=pf8PHrtRBC6TycBtVAXzD9EZSGufoyp5M82o6zLHmt4,1240
6
- lamindb_setup/_connect_instance.py,sha256=XGYQhUjzGnH-KYniW5a396-U-C90lHXq0QqIzsZXlg0,16778
6
+ lamindb_setup/_connect_instance.py,sha256=1sA8i-vxZJhwOzobgqmzgsUE9BF6XaH593RDPoy6G0g,17572
7
7
  lamindb_setup/_delete.py,sha256=Mip5M9tCxyfsjzdcPCl6x9CQ0TkYTqKNNWDIcJ-KVMo,5677
8
8
  lamindb_setup/_django.py,sha256=uIQflpkp8l3axyPaKURlk3kacgpElVP5KOKmFxYSMGk,1454
9
9
  lamindb_setup/_entry_points.py,sha256=sKwXPX9xjOotoAjvgkU5LBwjjHLWVkh0ZGdiSsrch9k,522
@@ -41,7 +41,7 @@ lamindb_setup/core/exceptions.py,sha256=4NpLUNUIfXYVTFX2FvLZF8RW34exk2Vn2X3G4Yhn
41
41
  lamindb_setup/core/hashing.py,sha256=EO7NSXMdKZLe9cHxCNHiqd5-6pVhv97uafqpoWV9FKc,3394
42
42
  lamindb_setup/core/types.py,sha256=zJii2le38BJUmsNVvzDrbzGYr0yaeb-9Rw9IKmsBr3k,523
43
43
  lamindb_setup/core/upath.py,sha256=iZIGnkvG6uZhjiq2qJ8v4pgABxw2rBwm_XSnZACzHVo,31075
44
- lamindb_setup-1.0.1.dist-info/LICENSE,sha256=UOZ1F5fFDe3XXvG4oNnkL1-Ecun7zpHzRxjp-XsMeAo,11324
45
- lamindb_setup-1.0.1.dist-info/WHEEL,sha256=CpUCUxeHQbRN5UGRQHYRJorO5Af-Qy_fHMctcQ8DSGI,82
46
- lamindb_setup-1.0.1.dist-info/METADATA,sha256=MpFtq1_UbY_S1hUZpEIZRZVcpJQ3-rVwbrxDkjA0P88,1690
47
- lamindb_setup-1.0.1.dist-info/RECORD,,
44
+ lamindb_setup-1.0.2.dist-info/LICENSE,sha256=UOZ1F5fFDe3XXvG4oNnkL1-Ecun7zpHzRxjp-XsMeAo,11324
45
+ lamindb_setup-1.0.2.dist-info/WHEEL,sha256=CpUCUxeHQbRN5UGRQHYRJorO5Af-Qy_fHMctcQ8DSGI,82
46
+ lamindb_setup-1.0.2.dist-info/METADATA,sha256=mUoczZRjbbv0JbQCETPFlJxYB-EW5h34XgFEWDYmL40,1690
47
+ lamindb_setup-1.0.2.dist-info/RECORD,,