lamin_cli 0.17.7__py2.py3-none-any.whl → 0.18.0__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.
- lamin_cli/__init__.py +1 -1
- lamin_cli/__main__.py +3 -3
- lamin_cli/_cache.py +1 -1
- lamin_cli/_load.py +8 -7
- {lamin_cli-0.17.7.dist-info → lamin_cli-0.18.0.dist-info}/METADATA +3 -2
- lamin_cli-0.18.0.dist-info/RECORD +12 -0
- lamin_cli-0.17.7.dist-info/RECORD +0 -12
- {lamin_cli-0.17.7.dist-info → lamin_cli-0.18.0.dist-info}/LICENSE +0 -0
- {lamin_cli-0.17.7.dist-info → lamin_cli-0.18.0.dist-info}/WHEEL +0 -0
- {lamin_cli-0.17.7.dist-info → lamin_cli-0.18.0.dist-info}/entry_points.txt +0 -0
lamin_cli/__init__.py
CHANGED
lamin_cli/__main__.py
CHANGED
|
@@ -268,10 +268,10 @@ def get(entity: str, uid: str = None, key: str = None, with_env: bool = False):
|
|
|
268
268
|
def save(filepath: str, key: str, description: str, registry: str):
|
|
269
269
|
"""Save a file or folder.
|
|
270
270
|
|
|
271
|
-
Defaults to saving `.py` and `.ipynb` as
|
|
272
|
-
other file types and folders as
|
|
271
|
+
Defaults to saving `.py` and `.ipynb` as {class}`~lamindb.Transform` and
|
|
272
|
+
other file types and folders as {class}`~lamindb.Artifact`.
|
|
273
273
|
|
|
274
|
-
You can save a `.py` or `.ipynb` file as an
|
|
274
|
+
You can save a `.py` or `.ipynb` file as an {class}`~lamindb.Artifact` by
|
|
275
275
|
passing `--registry artifact`.
|
|
276
276
|
"""
|
|
277
277
|
from lamin_cli._save import save_from_filepath_cli
|
lamin_cli/_cache.py
CHANGED
|
@@ -15,7 +15,7 @@ def cache():
|
|
|
15
15
|
@cache.command("set")
|
|
16
16
|
@click.argument(
|
|
17
17
|
"cache_dir",
|
|
18
|
-
type=click.Path(
|
|
18
|
+
type=click.Path(dir_okay=True, file_okay=False),
|
|
19
19
|
)
|
|
20
20
|
def set_cache(cache_dir: str):
|
|
21
21
|
"""Set the cache directory."""
|
lamin_cli/_load.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
from typing import Tuple
|
|
3
3
|
from lamin_utils import logger
|
|
4
|
+
import shutil
|
|
4
5
|
from pathlib import Path
|
|
5
6
|
|
|
6
7
|
|
|
@@ -56,10 +57,10 @@ def load(entity: str, uid: str = None, key: str = None, with_env: bool = False):
|
|
|
56
57
|
.first()
|
|
57
58
|
)
|
|
58
59
|
target_filename = transform.key
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
if Path(target_filename).exists():
|
|
61
|
+
response = input(f"! {target_filename} exists: replace? (y/n)")
|
|
62
|
+
if response != "y":
|
|
63
|
+
raise SystemExit("Aborted.")
|
|
63
64
|
if transform._source_code_artifact_id is not None: # backward compat
|
|
64
65
|
# need lamindb here to have .cache() available
|
|
65
66
|
import lamindb as ln
|
|
@@ -68,7 +69,7 @@ def load(entity: str, uid: str = None, key: str = None, with_env: bool = False):
|
|
|
68
69
|
filepath_cache = transform._source_code_artifact.cache()
|
|
69
70
|
if not target_filename.endswith(transform._source_code_artifact.suffix):
|
|
70
71
|
target_filename += transform._source_code_artifact.suffix
|
|
71
|
-
|
|
72
|
+
shutil.move(filepath_cache, target_filename)
|
|
72
73
|
elif transform.source_code is not None:
|
|
73
74
|
if transform.key.endswith(".ipynb"):
|
|
74
75
|
script_to_notebook(transform, target_filename, bump_revision=True)
|
|
@@ -89,8 +90,8 @@ def load(entity: str, uid: str = None, key: str = None, with_env: bool = False):
|
|
|
89
90
|
target_env_filename = (
|
|
90
91
|
".".join(target_filename.split(".")[:-1]) + "__requirements.txt"
|
|
91
92
|
)
|
|
92
|
-
|
|
93
|
-
logger.important(target_env_filename)
|
|
93
|
+
shutil.move(filepath_env_cache, target_env_filename)
|
|
94
|
+
logger.important(f"environment is here: {target_env_filename}")
|
|
94
95
|
else:
|
|
95
96
|
logger.warning("latest transform run with environment doesn't exist")
|
|
96
97
|
return target_filename
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: lamin_cli
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.18.0
|
|
4
4
|
Summary: Lamin CLI.
|
|
5
5
|
Author-email: Lamin Labs <open-source@lamin.ai>
|
|
6
6
|
Description-Content-Type: text/markdown
|
|
7
|
+
Requires-Dist: lamindb_setup==0.78.0
|
|
7
8
|
Requires-Dist: rich-click>=1.7
|
|
8
|
-
Project-URL: Home, https://github.com/laminlabs/
|
|
9
|
+
Project-URL: Home, https://github.com/laminlabs/lamin-cli
|
|
9
10
|
|
|
10
11
|
# Lamin CLI
|
|
11
12
|
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
lamin_cli/__init__.py,sha256=KbJg-6TKr7ETI_x7HH6AguY70RqAJy4mg4hNaGPoUug,41
|
|
2
|
+
lamin_cli/__main__.py,sha256=-auo60kaPHZB-BuQbzGJNDl9ne3OZ4T_GhFweOAr-74,9706
|
|
3
|
+
lamin_cli/_cache.py,sha256=kW8rqlMwQeOngm9uq2gjzPVl3EBrwh6W2F2AvyBFABY,799
|
|
4
|
+
lamin_cli/_load.py,sha256=2TkNQviRrvsp5wFweMqD5je0t1-BQYiWrBN7ygyxmuQ,4508
|
|
5
|
+
lamin_cli/_migration.py,sha256=xTbad6aDUwuK0QvWCmDW3f8-xaqwisS-Cqf-LbD1WRI,1071
|
|
6
|
+
lamin_cli/_save.py,sha256=KpGB1ZeKyE0Of0PkCX8j2UPtj4FQPS5wwKIYUFkTeio,4962
|
|
7
|
+
lamin_cli/_settings.py,sha256=iS37mcQUHKRWxi2sHnAojEI6sWk3w232qwG-GeY2_Qc,1141
|
|
8
|
+
lamin_cli-0.18.0.dist-info/entry_points.txt,sha256=Qms85i9cZPlu-U7RnVZhFsF7vJ9gaLZUFkCjcGcXTpg,49
|
|
9
|
+
lamin_cli-0.18.0.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
10
|
+
lamin_cli-0.18.0.dist-info/WHEEL,sha256=Sgu64hAMa6g5FdzHxXv9Xdse9yxpGGMeagVtPMWpJQY,99
|
|
11
|
+
lamin_cli-0.18.0.dist-info/METADATA,sha256=1k59xB00Uj_9XPVFTxvGe-qIVL8MlYn25kBHJaRZz0Y,375
|
|
12
|
+
lamin_cli-0.18.0.dist-info/RECORD,,
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
lamin_cli/__init__.py,sha256=7lQuTta1nc-cmxhBP-lwuNItIDyamNoyfWWvnzL1HWg,41
|
|
2
|
-
lamin_cli/__main__.py,sha256=_7d8PPnNKWdBHF-5jVCHKIqF6HkeXpvTJz3yNcvvnsc,9706
|
|
3
|
-
lamin_cli/_cache.py,sha256=6LrrWNrdZzH_BrohQ2n24xLFhUQ5EFan1bnzqMX_mIg,812
|
|
4
|
-
lamin_cli/_load.py,sha256=Ow34O5wK8i3Zg1q6K-bQXrCaanWf8GoeeXZTCWWZXJQ,4464
|
|
5
|
-
lamin_cli/_migration.py,sha256=xTbad6aDUwuK0QvWCmDW3f8-xaqwisS-Cqf-LbD1WRI,1071
|
|
6
|
-
lamin_cli/_save.py,sha256=KpGB1ZeKyE0Of0PkCX8j2UPtj4FQPS5wwKIYUFkTeio,4962
|
|
7
|
-
lamin_cli/_settings.py,sha256=iS37mcQUHKRWxi2sHnAojEI6sWk3w232qwG-GeY2_Qc,1141
|
|
8
|
-
lamin_cli-0.17.7.dist-info/entry_points.txt,sha256=Qms85i9cZPlu-U7RnVZhFsF7vJ9gaLZUFkCjcGcXTpg,49
|
|
9
|
-
lamin_cli-0.17.7.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
10
|
-
lamin_cli-0.17.7.dist-info/WHEEL,sha256=Sgu64hAMa6g5FdzHxXv9Xdse9yxpGGMeagVtPMWpJQY,99
|
|
11
|
-
lamin_cli-0.17.7.dist-info/METADATA,sha256=YjKsY2CBMUlg7EArBS9zzWB6h44Fyul1Vl68ma2bZ5I,336
|
|
12
|
-
lamin_cli-0.17.7.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|