lamindb_setup 1.14.0__py3-none-any.whl → 1.14.1__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/_connect_instance.py +8 -0
- lamindb_setup/core/_settings.py +27 -22
- {lamindb_setup-1.14.0.dist-info → lamindb_setup-1.14.1.dist-info}/METADATA +1 -1
- {lamindb_setup-1.14.0.dist-info → lamindb_setup-1.14.1.dist-info}/RECORD +7 -7
- {lamindb_setup-1.14.0.dist-info → lamindb_setup-1.14.1.dist-info}/LICENSE +0 -0
- {lamindb_setup-1.14.0.dist-info → lamindb_setup-1.14.1.dist-info}/WHEEL +0 -0
lamindb_setup/__init__.py
CHANGED
|
@@ -260,6 +260,10 @@ def _connect_cli(
|
|
|
260
260
|
connect(_write_settings=False, _reload_lamindb=False)
|
|
261
261
|
else:
|
|
262
262
|
logger.important(f"connected lamindb: {isettings.slug}")
|
|
263
|
+
if settings_.dev_dir is None:
|
|
264
|
+
logger.important_hint(
|
|
265
|
+
"to map a local dev directory, call: lamin settings set dev-dir ."
|
|
266
|
+
)
|
|
263
267
|
return None
|
|
264
268
|
|
|
265
269
|
|
|
@@ -427,6 +431,10 @@ def connect(instance: str | None = None, **kwargs: Any) -> str | tuple | None:
|
|
|
427
431
|
isettings._get_settings_file().unlink(missing_ok=True) # type: ignore
|
|
428
432
|
settings._instance_settings = None
|
|
429
433
|
raise e
|
|
434
|
+
if settings.dev_dir is None:
|
|
435
|
+
logger.important_hint(
|
|
436
|
+
"to map a local dev directory, set: ln.setup.settings.dev_dir = '.'"
|
|
437
|
+
)
|
|
430
438
|
return None
|
|
431
439
|
|
|
432
440
|
|
lamindb_setup/core/_settings.py
CHANGED
|
@@ -59,7 +59,6 @@ class SetupSettings:
|
|
|
59
59
|
|
|
60
60
|
_auto_connect_path: Path = settings_dir / "auto_connect"
|
|
61
61
|
_private_django_api_path: Path = settings_dir / "private_django_api"
|
|
62
|
-
_work_dir: Path = settings_dir / "work_dir.txt"
|
|
63
62
|
|
|
64
63
|
_cache_dir: Path | None = None
|
|
65
64
|
|
|
@@ -70,25 +69,6 @@ class SetupSettings:
|
|
|
70
69
|
def _instance_settings_path(self) -> Path:
|
|
71
70
|
return current_instance_settings_file()
|
|
72
71
|
|
|
73
|
-
@property
|
|
74
|
-
def work_dir(self) -> Path | None:
|
|
75
|
-
"""Get or set the current working directory.
|
|
76
|
-
|
|
77
|
-
If setting it to `None`, the working directory is unset
|
|
78
|
-
"""
|
|
79
|
-
if not self._work_dir.exists():
|
|
80
|
-
return None
|
|
81
|
-
return Path(self._work_dir.read_text())
|
|
82
|
-
|
|
83
|
-
@work_dir.setter
|
|
84
|
-
def work_dir(self, value: str | Path | None) -> None:
|
|
85
|
-
if value is None:
|
|
86
|
-
if self._work_dir.exists():
|
|
87
|
-
self._work_dir.unlink()
|
|
88
|
-
else:
|
|
89
|
-
value_str = Path(value).expanduser().resolve().as_posix()
|
|
90
|
-
self._work_dir.write_text(value_str)
|
|
91
|
-
|
|
92
72
|
@property
|
|
93
73
|
def settings_dir(self) -> Path:
|
|
94
74
|
"""The directory that holds locally persisted settings."""
|
|
@@ -112,6 +92,31 @@ class SetupSettings:
|
|
|
112
92
|
else:
|
|
113
93
|
self._auto_connect_path.unlink(missing_ok=True)
|
|
114
94
|
|
|
95
|
+
@property
|
|
96
|
+
def _dev_dir_path(self) -> Path:
|
|
97
|
+
return (
|
|
98
|
+
settings_dir / f"dev-dir--{self.instance.owner}--{self.instance.name}.txt"
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
@property
|
|
102
|
+
def dev_dir(self) -> Path | None:
|
|
103
|
+
"""Get or set the local development directory for the current instance.
|
|
104
|
+
|
|
105
|
+
If setting it to `None`, the working development directory is unset.
|
|
106
|
+
"""
|
|
107
|
+
if not self._dev_dir_path.exists():
|
|
108
|
+
return None
|
|
109
|
+
return Path(self._dev_dir_path.read_text())
|
|
110
|
+
|
|
111
|
+
@dev_dir.setter
|
|
112
|
+
def dev_dir(self, value: str | Path | None) -> None:
|
|
113
|
+
if value is None:
|
|
114
|
+
if self._dev_dir_path.exists():
|
|
115
|
+
self._dev_dir_path.unlink()
|
|
116
|
+
else:
|
|
117
|
+
value_str = Path(value).expanduser().resolve().as_posix()
|
|
118
|
+
self._dev_dir_path.write_text(value_str)
|
|
119
|
+
|
|
115
120
|
@property
|
|
116
121
|
def _branch_path(self) -> Path:
|
|
117
122
|
return (
|
|
@@ -361,9 +366,9 @@ class SetupSettings:
|
|
|
361
366
|
if self._instance_exists:
|
|
362
367
|
instance_rep = self.instance.__repr__().split("\n")
|
|
363
368
|
repr += f"{colors.cyan('Instance:')} {instance_rep[0].replace('Instance: ', '')}\n"
|
|
364
|
-
repr += f" - work-dir: {self.work_dir}\n"
|
|
365
369
|
repr += f" - branch: {self._read_branch_idlike_name()[1]}\n"
|
|
366
|
-
repr += f" - space: {self._read_space_idlike_name()[1]}"
|
|
370
|
+
repr += f" - space: {self._read_space_idlike_name()[1]}\n"
|
|
371
|
+
repr += f" - dev-dir: {self.dev_dir}"
|
|
367
372
|
repr += f"\n{colors.yellow('Details:')}\n"
|
|
368
373
|
repr += "\n".join(instance_rep[1:])
|
|
369
374
|
else:
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
lamindb_setup/__init__.py,sha256=
|
|
1
|
+
lamindb_setup/__init__.py,sha256=a30otKx_cPd7N6xUqPN0FBI59xCEsc5f_1KuETyUHm8,3211
|
|
2
2
|
lamindb_setup/_cache.py,sha256=pGvDNVHGx4HWr_6w5ajqEJOdysmaGc6F221qFnXkT-k,2747
|
|
3
3
|
lamindb_setup/_check.py,sha256=28PcG8Kp6OpjSLSi1r2boL2Ryeh6xkaCL87HFbjs6GA,129
|
|
4
4
|
lamindb_setup/_check_setup.py,sha256=ToKMxsUq8dQBQh8baOrNVlSb1iC8h4zTg5dV8wMu0W4,6760
|
|
5
|
-
lamindb_setup/_connect_instance.py,sha256=
|
|
5
|
+
lamindb_setup/_connect_instance.py,sha256=SmDgCmC44SI8A8iwPosRQ2H5edfIPywblnIy12npv-I,18012
|
|
6
6
|
lamindb_setup/_delete.py,sha256=KS3r-xGFuDmAbzPUy-9JR-YnPShYdaHjDRQrAmXQ0qM,5863
|
|
7
7
|
lamindb_setup/_disconnect.py,sha256=FT8EpCm5XXDdhDH7QtAnkO3KPatq2HqT9VXGNjgJDbk,1232
|
|
8
8
|
lamindb_setup/_django.py,sha256=uIQflpkp8l3axyPaKURlk3kacgpElVP5KOKmFxYSMGk,1454
|
|
@@ -31,7 +31,7 @@ lamindb_setup/core/_hub_core.py,sha256=GAQK5XkHROIuqA-H8sOQZVlxvN4QIH_cmHY0TENnq
|
|
|
31
31
|
lamindb_setup/core/_hub_crud.py,sha256=j6516H82kLjFUNPqFGUINbDw9YbofMgjxadGzYb0OS4,6362
|
|
32
32
|
lamindb_setup/core/_hub_utils.py,sha256=6dyDGyzYFgVfR_lE3VN3CP1jGp98gxPtr-T91PAP05U,2687
|
|
33
33
|
lamindb_setup/core/_private_django_api.py,sha256=By63l3vIEtK1pq246FhHq3tslxsaTJGKm5VakYluWp4,2656
|
|
34
|
-
lamindb_setup/core/_settings.py,sha256=
|
|
34
|
+
lamindb_setup/core/_settings.py,sha256=bAwvJhin7hLNliE_yaM-CMC3d5YD6-kY3raGpnse91Y,15458
|
|
35
35
|
lamindb_setup/core/_settings_instance.py,sha256=7VXd1W88fgqEnAfzFQKUlDnTr3pmA_e8aIag7FqPrJI,23899
|
|
36
36
|
lamindb_setup/core/_settings_load.py,sha256=j20cy3J56ZBHLDfB2A8oKjekNetMNsy0_W3eWD36pWI,5161
|
|
37
37
|
lamindb_setup/core/_settings_save.py,sha256=jh412jXIAbIYvnSoW9riBFePRAa4vmPm-ScYD0smlnw,3292
|
|
@@ -45,7 +45,7 @@ lamindb_setup/core/exceptions.py,sha256=qjMzqy_uzPA7mCOdnoWnS_fdA6OWbdZGftz-YYpl
|
|
|
45
45
|
lamindb_setup/core/hashing.py,sha256=Y8Uc5uSGTfU6L2R_gb5w8DdHhGRog7RnkK-e9FEMjPY,3680
|
|
46
46
|
lamindb_setup/core/types.py,sha256=T7NwspfRHgIIpYsXDcApks8jkOlGeGRW-YbVLB7jNIo,67
|
|
47
47
|
lamindb_setup/core/upath.py,sha256=bi3k8AYeiGB_NtVTO9e9gHsfs2AFB4fXiVHcbNpnlpI,35780
|
|
48
|
-
lamindb_setup-1.14.
|
|
49
|
-
lamindb_setup-1.14.
|
|
50
|
-
lamindb_setup-1.14.
|
|
51
|
-
lamindb_setup-1.14.
|
|
48
|
+
lamindb_setup-1.14.1.dist-info/LICENSE,sha256=UOZ1F5fFDe3XXvG4oNnkL1-Ecun7zpHzRxjp-XsMeAo,11324
|
|
49
|
+
lamindb_setup-1.14.1.dist-info/WHEEL,sha256=CpUCUxeHQbRN5UGRQHYRJorO5Af-Qy_fHMctcQ8DSGI,82
|
|
50
|
+
lamindb_setup-1.14.1.dist-info/METADATA,sha256=hdWYVFwWZWwNHnvRIi0A7v2in1mln0UVbqxr88FlsQA,1798
|
|
51
|
+
lamindb_setup-1.14.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|