lamindb_setup 1.0.1__py3-none-any.whl → 1.0.3__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.3" # denote a release candidate for 0.1.0 with 0.1rc1
37
37
 
38
38
  import os
39
39
 
@@ -394,6 +394,24 @@ def migrate_lnschema_core(
394
394
  if response != "y":
395
395
  print("Aborted.")
396
396
  quit()
397
+ if isettings.is_on_hub:
398
+ from lamindb_setup.core._hub_client import call_with_fallback_auth
399
+ from lamindb_setup.core._hub_crud import (
400
+ select_collaborator,
401
+ )
402
+
403
+ # double check that user is an admin, otherwise will fail below
404
+ # due to insufficient SQL permissions with cryptic error
405
+ collaborator = call_with_fallback_auth(
406
+ select_collaborator,
407
+ instance_id=settings.instance._id,
408
+ account_id=settings.user._uuid,
409
+ )
410
+ if collaborator is None or collaborator["role"] != "admin":
411
+ raise SystemExit(
412
+ "❌ Only admins can deploy migrations, please ensure that you're an"
413
+ f" admin: https://lamin.ai/{settings.instance.slug}/settings"
414
+ )
397
415
  for table in tables_to_rename:
398
416
  if db_type == "sqlite":
399
417
  cur.execute(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: lamindb_setup
3
- Version: 1.0.1
3
+ Version: 1.0.3
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=tQO7kJmhz2alIx0bTNWzQ-_R-LzhA6ZSI9b_p2dnlDU,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=NzZt_v2u-qHrZNi7hBFXtNQEIWAWrp3xsWxN0MAandI,17775
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.3.dist-info/LICENSE,sha256=UOZ1F5fFDe3XXvG4oNnkL1-Ecun7zpHzRxjp-XsMeAo,11324
45
+ lamindb_setup-1.0.3.dist-info/WHEEL,sha256=CpUCUxeHQbRN5UGRQHYRJorO5Af-Qy_fHMctcQ8DSGI,82
46
+ lamindb_setup-1.0.3.dist-info/METADATA,sha256=pnQKf74ByYnwZsLG-o5aEa1P38Rww1nCzre_Y63Be3c,1690
47
+ lamindb_setup-1.0.3.dist-info/RECORD,,