lamindb_setup 0.81.1__py3-none-any.whl → 0.81.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__ = "0.81.1" # denote a release candidate for 0.1.0 with 0.1rc1
36
+ __version__ = "0.81.3" # denote a release candidate for 0.1.0 with 0.1rc1
37
37
 
38
38
  import os as _os
39
39
  import sys as _sys
@@ -195,27 +195,30 @@ class SetupPaths:
195
195
  filepath: UPathStr, cache_key: str | None = None
196
196
  ) -> UPath:
197
197
  """Local (or local cache) filepath from filepath without synchronization."""
198
- # cache_key is ignored if filepath is a string or a local path
199
- # ignores a mere string even if it represents a cloud path
200
- if isinstance(filepath, UPath) and not isinstance(filepath, LocalPathClasses):
198
+ if not isinstance(filepath, UPath):
199
+ filepath = UPath(filepath)
200
+ # cache_key is ignored if filepath is a local path
201
+ if not isinstance(filepath, LocalPathClasses):
201
202
  # settings is defined further in this file
202
203
  local_filepath = settings.cache_dir / (
203
- filepath.path if cache_key is None else cache_key
204
+ filepath.path if cache_key is None else cache_key # type: ignore
204
205
  )
205
206
  else:
206
207
  local_filepath = filepath
207
- return UPath(local_filepath)
208
+ return local_filepath
208
209
 
209
210
  @staticmethod
210
211
  def cloud_to_local(
211
212
  filepath: UPathStr, cache_key: str | None = None, **kwargs
212
213
  ) -> UPath:
213
214
  """Local (or local cache) filepath from filepath."""
214
- # cache_key is ignored in cloud_to_local_no_update if filepath is local or a string
215
+ if not isinstance(filepath, UPath):
216
+ filepath = UPath(filepath)
217
+ # cache_key is ignored in cloud_to_local_no_update if filepath is local
215
218
  local_filepath = SetupPaths.cloud_to_local_no_update(filepath, cache_key)
216
- if isinstance(filepath, UPath) and not isinstance(filepath, LocalPathClasses):
219
+ if not isinstance(filepath, LocalPathClasses):
217
220
  local_filepath.parent.mkdir(parents=True, exist_ok=True)
218
- filepath.synchronize(local_filepath, **kwargs)
221
+ filepath.synchronize(local_filepath, **kwargs) # type: ignore
219
222
  return local_filepath
220
223
 
221
224
 
@@ -1,8 +1,12 @@
1
1
  from __future__ import annotations
2
2
 
3
+ import os
3
4
  from typing import TYPE_CHECKING
4
5
 
5
6
  from django.db.utils import OperationalError, ProgrammingError
7
+ from lamin_utils import logger
8
+
9
+ from ._settings import settings as setup_settings
6
10
 
7
11
  if TYPE_CHECKING:
8
12
  from ._settings_instance import InstanceSettings
@@ -63,10 +67,21 @@ def write_bionty_sources(isettings: InstanceSettings) -> None:
63
67
  Source.objects.bulk_create(all_records, ignore_conflicts=True)
64
68
 
65
69
 
66
- def load_bionty_sources(isettings: InstanceSettings):
70
+ def load_bionty_sources(isettings: InstanceSettings | None = None):
67
71
  """Write currently_used bionty sources to LAMINDB_VERSIONS_PATH in bionty."""
68
- if "bionty" not in isettings.schema:
69
- return None
72
+ if isettings is None:
73
+ if setup_settings._instance_settings is not None:
74
+ isettings = setup_settings.instance
75
+ else:
76
+ logger.warning(
77
+ f"Ignoring bionty setup because running in LAMINDB_MULTI_INSTANCE mode = {os.environ.get('LAMINDB_MULTI_INSTANCE')}"
78
+ )
79
+ # not setting up bionty sources
80
+ return None
81
+ if isettings is not None:
82
+ if "bionty" not in isettings.schema:
83
+ # no need to setup anything
84
+ return None
70
85
 
71
86
  import bionty.base as bionty_base
72
87
  from bionty.base.dev._handle_sources import parse_currently_used_sources
@@ -46,6 +46,8 @@ VALID_SIMPLE_SUFFIXES = {
46
46
  ".tsv",
47
47
  ".zip",
48
48
  ".xml",
49
+ ".qs", # https://cran.r-project.org/web/packages/qs/vignettes/vignette.html
50
+ ".rds",
49
51
  #
50
52
  # with readers (see below)
51
53
  #
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: lamindb_setup
3
- Version: 0.81.1
3
+ Version: 0.81.3
4
4
  Summary: Setup & configure LaminDB.
5
5
  Author-email: Lamin Labs <open-source@lamin.ai>
6
6
  Requires-Python: >=3.9
@@ -14,12 +14,11 @@ Requires-Dist: appdirs<2.0.0
14
14
  Requires-Dist: requests
15
15
  Requires-Dist: universal_pathlib==0.2.5
16
16
  Requires-Dist: botocore<2.0.0
17
- Requires-Dist: gotrue>=2.1.0,<2.9.0
18
- Requires-Dist: supabase==2.2.1
17
+ Requires-Dist: supabase>=2.8.1,<=2.10.0
19
18
  Requires-Dist: psutil
20
19
  Requires-Dist: urllib3<2 ; extra == "aws"
21
20
  Requires-Dist: aiobotocore[boto3]>=2.5.4,<3.0.0 ; extra == "aws"
22
- Requires-Dist: s3fs>=2023.12.2,<=2024.10.0 ; extra == "aws"
21
+ Requires-Dist: s3fs>=2023.12.2,<=2024.10.0,!=2024.10.0 ; extra == "aws"
23
22
  Requires-Dist: line_profiler ; extra == "dev"
24
23
  Requires-Dist: pyjwt<3.0.0 ; extra == "dev"
25
24
  Requires-Dist: psycopg2-binary ; extra == "dev"
@@ -1,4 +1,4 @@
1
- lamindb_setup/__init__.py,sha256=dFAjI0r6-lM4WoJ3n0uo6iCdKHvnV-20y76RufgIFCQ,1714
1
+ lamindb_setup/__init__.py,sha256=xPpghv8_6NLAzTOyEbqSg4UsrBIVXl-wFpemsz9p40o,1714
2
2
  lamindb_setup/_cache.py,sha256=1XnM-V_KprbjpgPY7Bg3FYn53Iz_2_fEgcMOaSdKKbg,1332
3
3
  lamindb_setup/_check.py,sha256=28PcG8Kp6OpjSLSi1r2boL2Ryeh6xkaCL87HFbjs6GA,129
4
4
  lamindb_setup/_check_setup.py,sha256=6cSfpmVOSgU7YiVHfJpBTGTQ7rrnwunt1pJT_jkgNM8,3196
@@ -27,21 +27,21 @@ lamindb_setup/core/_hub_core.py,sha256=eUxRz9iJj6RA5-MWgQqqZYAU-di5LQDamRZn6t-VO
27
27
  lamindb_setup/core/_hub_crud.py,sha256=eZErpq9t1Cp2ULBSi457ekrcqfesw4Y6IJgaqyrINMY,5276
28
28
  lamindb_setup/core/_hub_utils.py,sha256=08NwQsb53-tXa_pr-f0tPTN0FeeVf_i1p3dEbEWD0F4,3016
29
29
  lamindb_setup/core/_private_django_api.py,sha256=KIn43HOhiRjkbTbddyJqv-WNTTa1bAizbM1tWXoXPBg,2869
30
- lamindb_setup/core/_settings.py,sha256=mpGsSb98UsBedLsW2RuowZ17EP2tI2XRGPztqrJtrV4,7952
30
+ lamindb_setup/core/_settings.py,sha256=RostEkf87oC8E4D8LMxb5NcnFKu9I8YFDMehLbwlwhE,7988
31
31
  lamindb_setup/core/_settings_instance.py,sha256=ajcq9zRNE598tTqyMkMqaEOubVfFeE998DPtbgyzK3A,18801
32
32
  lamindb_setup/core/_settings_load.py,sha256=5OpghcbkrK9KBM_0Iu-61FTI76UbOpPkkJpUittXS-w,4098
33
33
  lamindb_setup/core/_settings_save.py,sha256=rxGxgaK5i9exKqSJERQQyY1WZio20meoQJoYXlVW-1w,3138
34
34
  lamindb_setup/core/_settings_storage.py,sha256=CYwGZm0fKYN7eLLsU-sOtOKG7HzswQVjTWb0ooHKcNg,11990
35
35
  lamindb_setup/core/_settings_store.py,sha256=WcsgOmgnu9gztcrhp-N4OONNZyxICHV8M0HdJllTaEo,2219
36
36
  lamindb_setup/core/_settings_user.py,sha256=iz0MqFLKXqm8LYx_CHmr02_oNvYWFLIxKkJLdpS5W08,1476
37
- lamindb_setup/core/_setup_bionty_sources.py,sha256=o2L5Ww8TKgSqJtL4cGUcpJwLNYxA9BZgddhCMCu_E2g,3428
37
+ lamindb_setup/core/_setup_bionty_sources.py,sha256=jZOPXpipW_5IjMO-bLMk-_wVwk7-5MLd72K2rnqqy7U,4001
38
38
  lamindb_setup/core/cloud_sqlite_locker.py,sha256=i6TrT7HG0lqliPvZTlsZ_uplPaqhPBbabyfeR32SkA8,7107
39
39
  lamindb_setup/core/django.py,sha256=E4U9nUlV2kHd-G5v6iSdFGAAWixlQDxOFwMwOMG9xfw,3864
40
40
  lamindb_setup/core/exceptions.py,sha256=4NpLUNUIfXYVTFX2FvLZF8RW34exk2Vn2X3G4YhnTRg,276
41
41
  lamindb_setup/core/hashing.py,sha256=26dtak7XgmrWa_D1zuDyxObRQcriMtnc1yEigkKASmM,3142
42
42
  lamindb_setup/core/types.py,sha256=zJii2le38BJUmsNVvzDrbzGYr0yaeb-9Rw9IKmsBr3k,523
43
- lamindb_setup/core/upath.py,sha256=4rCC0EOe-UaCexRDReQ5D_zs13Zi626pqn1slYNvISE,28945
44
- lamindb_setup-0.81.1.dist-info/LICENSE,sha256=UOZ1F5fFDe3XXvG4oNnkL1-Ecun7zpHzRxjp-XsMeAo,11324
45
- lamindb_setup-0.81.1.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81
46
- lamindb_setup-0.81.1.dist-info/METADATA,sha256=yvD9AXAL_lFbagwrcvhId-DMCbgFHtWxZ8fVxobspDM,1745
47
- lamindb_setup-0.81.1.dist-info/RECORD,,
43
+ lamindb_setup/core/upath.py,sha256=a0yxP9dmujTn_hkDC0E2UuVsX-Img4i0kVNB-OV5K1s,29038
44
+ lamindb_setup-0.81.3.dist-info/LICENSE,sha256=UOZ1F5fFDe3XXvG4oNnkL1-Ecun7zpHzRxjp-XsMeAo,11324
45
+ lamindb_setup-0.81.3.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81
46
+ lamindb_setup-0.81.3.dist-info/METADATA,sha256=VPKC024x5sheF1oT-iZRMb4k77WARFy2Y2PwA4Z_S9E,1730
47
+ lamindb_setup-0.81.3.dist-info/RECORD,,