lamindb_setup 0.76.6__py2.py3-none-any.whl → 0.76.8__py2.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
@@ -34,7 +34,7 @@ Modules & settings:
34
34
 
35
35
  """
36
36
 
37
- __version__ = "0.76.6" # denote a release candidate for 0.1.0 with 0.1rc1
37
+ __version__ = "0.76.8" # 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
lamindb_setup/_migrate.py CHANGED
@@ -31,7 +31,10 @@ def check_whether_migrations_in_sync(db_version_str: str):
31
31
  db_version_upper = f"{db_version.major}.{db_version.minor + 1}"
32
32
  logger.warning(
33
33
  f"your database ({db_version_str}) is ahead of your installed lamindb"
34
- f" package ({installed_version_str}) \n❗ please update lamindb: pip install"
34
+ f" package ({installed_version_str})"
35
+ )
36
+ logger.important(
37
+ "please update lamindb: pip install"
35
38
  f' "lamindb>={db_version_lower},<{db_version_upper}"'
36
39
  )
37
40
  elif (
@@ -40,9 +43,9 @@ def check_whether_migrations_in_sync(db_version_str: str):
40
43
  ):
41
44
  logger.warning(
42
45
  f"your database ({db_version_str}) is behind your installed lamindb package"
43
- f" ({installed_version_str}) \n❗ please migrate your database: lamin"
44
- " migrate deploy"
46
+ f" ({installed_version_str})"
45
47
  )
48
+ logger.important("please migrate your database: lamin migrate deploy")
46
49
 
47
50
 
48
51
  # for tests, see lamin-cli
@@ -95,22 +95,42 @@ def _dict_to_uuid(dict: dict):
95
95
  RelationType = Literal["many-to-one", "one-to-many", "many-to-many", "one-to-one"]
96
96
  Type = Literal[
97
97
  "ForeignKey",
98
- "CharField",
99
- "DateTimeField",
98
+ # the following are generated with `from django.db import models; [attr for attr in dir(models) if attr.endswith('Field')]`
100
99
  "AutoField",
101
- "BooleanField",
102
- "BigIntegerField",
103
- "SmallIntegerField",
104
- "TextField",
105
100
  "BigAutoField",
106
- "ManyToManyField",
107
- "IntegerField",
108
- "OneToOneField",
109
- "JSONField",
101
+ "BigIntegerField",
102
+ "BinaryField",
103
+ "BooleanField",
104
+ "CharField",
105
+ "CommaSeparatedIntegerField",
110
106
  "DateField",
107
+ "DateTimeField",
108
+ "DecimalField",
109
+ "DurationField",
110
+ "EmailField",
111
+ "Field",
112
+ "FileField",
113
+ "FilePathField",
111
114
  "FloatField",
112
- "PositiveIntegerField",
115
+ "GeneratedField",
116
+ "GenericIPAddressField",
117
+ "IPAddressField",
118
+ "ImageField",
119
+ "IntegerField",
120
+ "JSONField",
121
+ "ManyToManyField",
122
+ "NullBooleanField",
123
+ "OneToOneField",
113
124
  "PositiveBigIntegerField",
125
+ "PositiveIntegerField",
126
+ "PositiveSmallIntegerField",
127
+ "SlugField",
128
+ "SmallAutoField",
129
+ "SmallIntegerField",
130
+ "TextField",
131
+ "TimeField",
132
+ "URLField",
133
+ "UUIDField",
114
134
  ]
115
135
 
116
136
 
@@ -98,7 +98,7 @@ def get_access_token(email: str | None = None, password: str | None = None):
98
98
  )
99
99
  return auth_response.session.access_token
100
100
  finally:
101
- hub.auth.sign_out()
101
+ hub.auth.sign_out(options={"scope": "local"})
102
102
 
103
103
 
104
104
  def call_with_fallback_auth(
@@ -113,7 +113,7 @@ def call_with_fallback_auth(
113
113
  result = callable(**kwargs, client=client)
114
114
  finally:
115
115
  try:
116
- client.auth.sign_out()
116
+ client.auth.sign_out(options={"scope": "local"})
117
117
  except NameError:
118
118
  pass
119
119
  return result
@@ -137,7 +137,7 @@ def call_with_fallback_auth(
137
137
  raise e
138
138
  finally:
139
139
  try:
140
- client.auth.sign_out()
140
+ client.auth.sign_out(options={"scope": "local"})
141
141
  except NameError:
142
142
  pass
143
143
  return result
@@ -156,6 +156,9 @@ def call_with_fallback(
156
156
  if fallback_env:
157
157
  raise e
158
158
  finally:
159
- # in case there was sign in
160
- client.auth.sign_out()
159
+ try:
160
+ # in case there was sign in
161
+ client.auth.sign_out(options={"scope": "local"})
162
+ except NameError:
163
+ pass
161
164
  return result
@@ -161,8 +161,9 @@ class InstanceSettings:
161
161
  elif not mute_warning:
162
162
  logger.warning(
163
163
  f"none of the registered local storage locations were found in your environment: {local_records}"
164
- "\n❗ please register a new local storage location via `ln.settings.storage_local = local_root_path` "
165
- "and re-load/connect the instance"
164
+ )
165
+ logger.important(
166
+ "please register a new local storage location via `ln.settings.storage_local = local_root_path` and re-load/connect the instance"
166
167
  )
167
168
  return None
168
169
 
@@ -75,7 +75,9 @@ def load_bionty_sources(isettings: InstanceSettings):
75
75
 
76
76
  try:
77
77
  # need try except because of integer primary key migration
78
- active_records = Source.objects.filter(currently_used=True).all().values()
78
+ active_records = (
79
+ Source.objects.filter(currently_used=True).order_by("id").all().values()
80
+ )
79
81
  for kwargs in active_records:
80
82
  for db_field, base_col in RENAME.items():
81
83
  kwargs[base_col] = kwargs.pop(db_field)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: lamindb_setup
3
- Version: 0.76.6
3
+ Version: 0.76.8
4
4
  Summary: Setup & configure LaminDB.
5
5
  Author-email: Lamin Labs <open-source@lamin.ai>
6
6
  Description-Content-Type: text/markdown
@@ -13,11 +13,12 @@ Requires-Dist: appdirs<2.0.0
13
13
  Requires-Dist: requests
14
14
  Requires-Dist: universal_pathlib==0.2.2
15
15
  Requires-Dist: botocore<2.0.0
16
+ Requires-Dist: gotrue>=2.1.0
16
17
  Requires-Dist: supabase==2.2.1
17
18
  Requires-Dist: psutil
18
19
  Requires-Dist: urllib3<2 ; extra == "aws"
19
20
  Requires-Dist: aiobotocore[boto3]>=2.5.4,<3.0.0 ; extra == "aws"
20
- Requires-Dist: s3fs>=2023.12.2,<=2024.3.1 ; extra == "aws"
21
+ Requires-Dist: s3fs>=2023.12.2,<=2024.6.1 ; extra == "aws"
21
22
  Requires-Dist: pyjwt<3.0.0 ; extra == "dev"
22
23
  Requires-Dist: psycopg2-binary ; extra == "dev"
23
24
  Requires-Dist: python-dotenv ; extra == "dev"
@@ -28,7 +29,7 @@ Requires-Dist: pytest-xdist ; extra == "dev"
28
29
  Requires-Dist: nbproject-test>=0.4.3 ; extra == "dev"
29
30
  Requires-Dist: pandas ; extra == "dev"
30
31
  Requires-Dist: django-schema-graph ; extra == "erdiagram"
31
- Requires-Dist: gcsfs>=2023.12.2,<=2024.3.1 ; extra == "gcp"
32
+ Requires-Dist: gcsfs>=2023.12.2,<=2024.6.1 ; extra == "gcp"
32
33
  Project-URL: Home, https://github.com/laminlabs/lamindb-setup
33
34
  Provides-Extra: aws
34
35
  Provides-Extra: dev
@@ -1,4 +1,4 @@
1
- lamindb_setup/__init__.py,sha256=oS0T4Bi_gmUMhmQgSv_QLNn_UX7KoGP3pVyA6cv1XBI,1542
1
+ lamindb_setup/__init__.py,sha256=kQrdnR18O5ztr_aI5pTm9X9hB1RD6aJXYT29cB7kiIM,1542
2
2
  lamindb_setup/_cache.py,sha256=wA7mbysANwe8hPNbjDo9bOmXJ0xIyaS5iyxIpxSWji4,846
3
3
  lamindb_setup/_check.py,sha256=28PcG8Kp6OpjSLSi1r2boL2Ryeh6xkaCL87HFbjs6GA,129
4
4
  lamindb_setup/_check_setup.py,sha256=cNEL9Q4yPpmEkGKHH8JgullWl1VUZwALJ4RHn9wZypY,2613
@@ -9,10 +9,10 @@ lamindb_setup/_django.py,sha256=EoyWvFzH0i9wxjy4JZhcoXCTckztP_Mrl6FbYQnMmLE,1534
9
9
  lamindb_setup/_exportdb.py,sha256=43g77-tH-vAlTn8ig1mMD9-KXLKvxUeDLaq0gVu3l-c,2114
10
10
  lamindb_setup/_importdb.py,sha256=yYYShzUajTsR-cTW4CZ-UNDWZY2uE5PAgNbp-wn8Ogc,1874
11
11
  lamindb_setup/_init_instance.py,sha256=VxHgD2i0hrFm2f_WCX76YmS_Lsx2iufrMtfab82r8X0,12391
12
- lamindb_setup/_migrate.py,sha256=P4n3x0SYzO9szjF2-JMa7z4mQadtWjHv5ow4HbCDZLI,8864
12
+ lamindb_setup/_migrate.py,sha256=tbpZVDwWivd2BZomx_D-3XyvMFMSehgoIs4LpqS2w9A,8915
13
13
  lamindb_setup/_register_instance.py,sha256=alQuYp2f8Ct8xvRC1gt8p_HZ0tqCd3gZD3kiPBLPpsI,1269
14
14
  lamindb_setup/_schema.py,sha256=b3uzhhWpV5mQtDwhMINc2MabGCnGLESy51ito3yl6Wc,679
15
- lamindb_setup/_schema_metadata.py,sha256=nF29OuMNswJUCyvSyOHEUQLQ7PcfB7uwvczloBYSWuU,13187
15
+ lamindb_setup/_schema_metadata.py,sha256=XfKCcpQXoatx4Dm2pflp-mPhZ9tpqjn2Cq4ip3MOFSY,13715
16
16
  lamindb_setup/_set_managed_storage.py,sha256=4tDxXQMt8Gw028uY3vIQxZQ7qBNXhQMc8saarNK_Z-s,2043
17
17
  lamindb_setup/_setup_user.py,sha256=6Oc7Rke-yRQSZbuntdUAz8QbJ6UuPzYHI9FnYlf_q-A,3670
18
18
  lamindb_setup/_silence_loggers.py,sha256=AKF_YcHvX32eGXdsYK8MJlxEaZ-Uo2f6QDRzjKFCtws,1568
@@ -21,26 +21,26 @@ lamindb_setup/core/_aws_credentials.py,sha256=uKMQO9q42Hnepz8aj3RxwLKDWUJx8pNOYr
21
21
  lamindb_setup/core/_aws_storage.py,sha256=nEjeUv4xUVpoV0Lx-zjjmyb9w804bDyaeiM-OqbfwM0,1799
22
22
  lamindb_setup/core/_deprecated.py,sha256=3qxUI1dnDlSeR0BYrv7ucjqRBEojbqotPgpShXs4KF8,2520
23
23
  lamindb_setup/core/_docs.py,sha256=3k-YY-oVaJd_9UIY-LfBg_u8raKOCNfkZQPA73KsUhs,276
24
- lamindb_setup/core/_hub_client.py,sha256=Gpt3TmxWQMVenKugCu1agUb-xGN9YFsQOKmrHuFiiDs,5605
24
+ lamindb_setup/core/_hub_client.py,sha256=4FcZBIuKhIWT0hggi3fm3bObOz7j7uhMU6bC0-98kgE,5785
25
25
  lamindb_setup/core/_hub_core.py,sha256=2Ni7vIkUcZw9ryBLgjercvLsdAL8-3xZNmrxyzNCU98,17049
26
26
  lamindb_setup/core/_hub_crud.py,sha256=eZErpq9t1Cp2ULBSi457ekrcqfesw4Y6IJgaqyrINMY,5276
27
27
  lamindb_setup/core/_hub_utils.py,sha256=w5IRtrxZcvxmGSJslzuZF89ewkzXV4cCUmZUVrqmAfo,3026
28
28
  lamindb_setup/core/_private_django_api.py,sha256=KIn43HOhiRjkbTbddyJqv-WNTTa1bAizbM1tWXoXPBg,2869
29
29
  lamindb_setup/core/_settings.py,sha256=46axQ5HPvI0X9YuotgdpuSOfSo7qYU1DudIx3vxpFk0,4471
30
- lamindb_setup/core/_settings_instance.py,sha256=azgqSWEnTfZM9ghgdF6atvIxoUP6fx49Y9tZTqMQTuc,17589
30
+ lamindb_setup/core/_settings_instance.py,sha256=QkhBeDrnM86WDq_FL6KwBIkQxW9mqLjwNW7FSBoKXxs,17608
31
31
  lamindb_setup/core/_settings_load.py,sha256=bRkGgaEnLZmnOlU5ptDoSM-YXzC2l0Cb7RBoBY6VH9k,3717
32
32
  lamindb_setup/core/_settings_save.py,sha256=n_tYfb9EBSxwm4LHyPRHJptE5uB8lmHhcRkz1JkAmhg,2781
33
33
  lamindb_setup/core/_settings_storage.py,sha256=jFdoIkSn1gPDDZKjAlgKyrlsHBqZDOvv-UnuUI7aD_4,14249
34
34
  lamindb_setup/core/_settings_store.py,sha256=VEE8Ff2A7y4j8ksOaa7g48jNaOqe1PBnBjb1PKKGUKU,2115
35
35
  lamindb_setup/core/_settings_user.py,sha256=P2lC4WDRAFfT-Xq3MlXJ-wMKIHCoGNhMTQfRGIAyUNQ,1344
36
- lamindb_setup/core/_setup_bionty_sources.py,sha256=ANBIiWHoYxLBQqsiKs-rCq3k-p6D34T4NM28gkY6YLA,3389
36
+ lamindb_setup/core/_setup_bionty_sources.py,sha256=o2L5Ww8TKgSqJtL4cGUcpJwLNYxA9BZgddhCMCu_E2g,3428
37
37
  lamindb_setup/core/cloud_sqlite_locker.py,sha256=reu02M4aE2BT_A5AFqwhv48l91mOMyQ4zTd-hh-wtuU,6922
38
38
  lamindb_setup/core/django.py,sha256=QUQm3zt5QIiD8uv6o9vbSm_bshqiSWzKSkgD3z2eJCg,3542
39
39
  lamindb_setup/core/exceptions.py,sha256=eoI7AXgATgDVzgArtN7CUvpaMUC067vsBg5LHCsWzDM,305
40
40
  lamindb_setup/core/hashing.py,sha256=Y2cvEaqtm3KwpHqj5ZG2f_sLaXhsQT4oDrmJdHbOQeo,3116
41
41
  lamindb_setup/core/types.py,sha256=bcYnZ0uM_2NXKJCl94Mmc-uYrQlRUUVKG3sK2N-F-N4,532
42
42
  lamindb_setup/core/upath.py,sha256=EPLLm62q-Y3hZzd-286cynFMttXKDNXNOKL3_QGkeug,27215
43
- lamindb_setup-0.76.6.dist-info/LICENSE,sha256=UOZ1F5fFDe3XXvG4oNnkL1-Ecun7zpHzRxjp-XsMeAo,11324
44
- lamindb_setup-0.76.6.dist-info/WHEEL,sha256=Sgu64hAMa6g5FdzHxXv9Xdse9yxpGGMeagVtPMWpJQY,99
45
- lamindb_setup-0.76.6.dist-info/METADATA,sha256=aipPhnfIkB8MWkSmDkqbCSb-iOcQNbbs0lcQzqa5_w8,1638
46
- lamindb_setup-0.76.6.dist-info/RECORD,,
43
+ lamindb_setup-0.76.8.dist-info/LICENSE,sha256=UOZ1F5fFDe3XXvG4oNnkL1-Ecun7zpHzRxjp-XsMeAo,11324
44
+ lamindb_setup-0.76.8.dist-info/WHEEL,sha256=Sgu64hAMa6g5FdzHxXv9Xdse9yxpGGMeagVtPMWpJQY,99
45
+ lamindb_setup-0.76.8.dist-info/METADATA,sha256=oqDAk3PGTipph7_JezoeXlST0hucIKVreA9VRWUzcBA,1667
46
+ lamindb_setup-0.76.8.dist-info/RECORD,,