lamindb_setup 0.81.0__py3-none-any.whl → 0.81.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 +1 -1
- lamindb_setup/core/_setup_bionty_sources.py +18 -3
- lamindb_setup/core/upath.py +9 -0
- {lamindb_setup-0.81.0.dist-info → lamindb_setup-0.81.2.dist-info}/METADATA +1 -1
- {lamindb_setup-0.81.0.dist-info → lamindb_setup-0.81.2.dist-info}/RECORD +7 -7
- {lamindb_setup-0.81.0.dist-info → lamindb_setup-0.81.2.dist-info}/LICENSE +0 -0
- {lamindb_setup-0.81.0.dist-info → lamindb_setup-0.81.2.dist-info}/WHEEL +0 -0
lamindb_setup/__init__.py
CHANGED
|
@@ -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
|
|
69
|
-
|
|
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
|
lamindb_setup/core/upath.py
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
from __future__ import annotations
|
|
5
5
|
|
|
6
6
|
import os
|
|
7
|
+
import warnings
|
|
7
8
|
from collections import defaultdict
|
|
8
9
|
from datetime import datetime, timezone
|
|
9
10
|
from functools import partial
|
|
@@ -45,6 +46,8 @@ VALID_SIMPLE_SUFFIXES = {
|
|
|
45
46
|
".tsv",
|
|
46
47
|
".zip",
|
|
47
48
|
".xml",
|
|
49
|
+
".qs", # https://cran.r-project.org/web/packages/qs/vignettes/vignette.html
|
|
50
|
+
".rds",
|
|
48
51
|
#
|
|
49
52
|
# with readers (see below)
|
|
50
53
|
#
|
|
@@ -708,6 +711,12 @@ Args:
|
|
|
708
711
|
pathlike: A string or Path to a local/cloud file/directory/folder.
|
|
709
712
|
"""
|
|
710
713
|
|
|
714
|
+
# suppress the warning from upath about hf (huggingface) filesystem
|
|
715
|
+
# not being explicitly implemented in upath
|
|
716
|
+
warnings.filterwarnings(
|
|
717
|
+
"ignore", module="upath", message=".*'hf' filesystem not explicitly implemented.*"
|
|
718
|
+
)
|
|
719
|
+
|
|
711
720
|
|
|
712
721
|
def create_path(path: UPath, access_token: str | None = None) -> UPath:
|
|
713
722
|
path = UPath(path)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
lamindb_setup/__init__.py,sha256=
|
|
1
|
+
lamindb_setup/__init__.py,sha256=o71S_vO9_RpZ91eHTH0FZG57w9nwWR54OUufTiq-aN8,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
|
|
@@ -34,14 +34,14 @@ lamindb_setup/core/_settings_save.py,sha256=rxGxgaK5i9exKqSJERQQyY1WZio20meoQJoY
|
|
|
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=
|
|
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=
|
|
44
|
-
lamindb_setup-0.81.
|
|
45
|
-
lamindb_setup-0.81.
|
|
46
|
-
lamindb_setup-0.81.
|
|
47
|
-
lamindb_setup-0.81.
|
|
43
|
+
lamindb_setup/core/upath.py,sha256=a0yxP9dmujTn_hkDC0E2UuVsX-Img4i0kVNB-OV5K1s,29038
|
|
44
|
+
lamindb_setup-0.81.2.dist-info/LICENSE,sha256=UOZ1F5fFDe3XXvG4oNnkL1-Ecun7zpHzRxjp-XsMeAo,11324
|
|
45
|
+
lamindb_setup-0.81.2.dist-info/WHEEL,sha256=EZbGkh7Ie4PoZfRQ8I0ZuP9VklN_TvcZ6DSE5Uar4z4,81
|
|
46
|
+
lamindb_setup-0.81.2.dist-info/METADATA,sha256=qUDiU989EwoOfdbfJ8jXPCiGLXc1TLwgXQQAN5H1Iu0,1745
|
|
47
|
+
lamindb_setup-0.81.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|