lamin_cli 0.17.7__tar.gz → 0.18.0__tar.gz

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.
Files changed (30) hide show
  1. {lamin_cli-0.17.7 → lamin_cli-0.18.0}/PKG-INFO +3 -2
  2. lamin_cli-0.18.0/lamin_cli/__init__.py +3 -0
  3. {lamin_cli-0.17.7 → lamin_cli-0.18.0}/lamin_cli/__main__.py +3 -3
  4. {lamin_cli-0.17.7 → lamin_cli-0.18.0}/lamin_cli/_cache.py +1 -1
  5. {lamin_cli-0.17.7 → lamin_cli-0.18.0}/lamin_cli/_load.py +8 -7
  6. {lamin_cli-0.17.7 → lamin_cli-0.18.0}/pyproject.toml +5 -2
  7. lamin_cli-0.17.7/lamin_cli/__init__.py +0 -3
  8. {lamin_cli-0.17.7 → lamin_cli-0.18.0}/.github/workflows/doc-changes.yml +0 -0
  9. {lamin_cli-0.17.7 → lamin_cli-0.18.0}/.gitignore +0 -0
  10. {lamin_cli-0.17.7 → lamin_cli-0.18.0}/.pre-commit-config.yaml +0 -0
  11. {lamin_cli-0.17.7 → lamin_cli-0.18.0}/LICENSE +0 -0
  12. {lamin_cli-0.17.7 → lamin_cli-0.18.0}/README.md +0 -0
  13. {lamin_cli-0.17.7 → lamin_cli-0.18.0}/lamin_cli/_migration.py +0 -0
  14. {lamin_cli-0.17.7 → lamin_cli-0.18.0}/lamin_cli/_save.py +0 -0
  15. {lamin_cli-0.17.7 → lamin_cli-0.18.0}/lamin_cli/_settings.py +0 -0
  16. {lamin_cli-0.17.7 → lamin_cli-0.18.0}/tests/conftest.py +0 -0
  17. {lamin_cli-0.17.7 → lamin_cli-0.18.0}/tests/notebooks/not-initialized.ipynb +0 -0
  18. {lamin_cli-0.17.7 → lamin_cli-0.18.0}/tests/notebooks/with-title-and-initialized-consecutive.ipynb +0 -0
  19. {lamin_cli-0.17.7 → lamin_cli-0.18.0}/tests/notebooks/with-title-and-initialized-non-consecutive.ipynb +0 -0
  20. {lamin_cli-0.17.7 → lamin_cli-0.18.0}/tests/scripts/merely-import-lamindb.py +0 -0
  21. {lamin_cli-0.17.7 → lamin_cli-0.18.0}/tests/scripts/run-track-and-finish-sync-git.py +0 -0
  22. {lamin_cli-0.17.7 → lamin_cli-0.18.0}/tests/scripts/run-track-and-finish.py +0 -0
  23. {lamin_cli-0.17.7 → lamin_cli-0.18.0}/tests/scripts/run-track-with-params.py +0 -0
  24. {lamin_cli-0.17.7 → lamin_cli-0.18.0}/tests/test_cli.py +0 -0
  25. {lamin_cli-0.17.7 → lamin_cli-0.18.0}/tests/test_load.py +0 -0
  26. {lamin_cli-0.17.7 → lamin_cli-0.18.0}/tests/test_migrate.py +0 -0
  27. {lamin_cli-0.17.7 → lamin_cli-0.18.0}/tests/test_multi_process.py +0 -0
  28. {lamin_cli-0.17.7 → lamin_cli-0.18.0}/tests/test_save_files.py +0 -0
  29. {lamin_cli-0.17.7 → lamin_cli-0.18.0}/tests/test_save_notebooks.py +0 -0
  30. {lamin_cli-0.17.7 → lamin_cli-0.18.0}/tests/test_save_scripts.py +0 -0
@@ -1,11 +1,12 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: lamin_cli
3
- Version: 0.17.7
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/lamindb
9
+ Project-URL: Home, https://github.com/laminlabs/lamin-cli
9
10
 
10
11
  # Lamin CLI
11
12
 
@@ -0,0 +1,3 @@
1
+ """Lamin CLI."""
2
+
3
+ __version__ = "0.18.0"
@@ -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 :class:`~lamindb.Transform` and
272
- other file types and folders as :class:`~lamindb.Artifact`.
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 :class:`~lamindb.Artifact` by
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
@@ -15,7 +15,7 @@ def cache():
15
15
  @cache.command("set")
16
16
  @click.argument(
17
17
  "cache_dir",
18
- type=click.Path(exists=True, dir_okay=True, file_okay=False),
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."""
@@ -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
- # if Path(target_filename).exists():
60
- # response = input(f"! {target_filename} exists: replace? (y/n)")
61
- # if response != "y":
62
- # raise SystemExit("Aborted.")
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
- filepath_cache.rename(target_filename)
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
- filepath_env_cache.rename(target_env_filename)
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
@@ -8,11 +8,14 @@ authors = [{name = "Lamin Labs", email = "open-source@lamin.ai"}]
8
8
  readme = "README.md"
9
9
  dynamic = ["version", "description"]
10
10
  dependencies = [
11
- "rich-click>=1.7"
11
+ # lamindb-setup is only pinned here
12
+ # NOT in lamindb
13
+ "lamindb_setup==0.78.0",
14
+ "rich-click>=1.7",
12
15
  ]
13
16
 
14
17
  [project.urls]
15
- Home = "https://github.com/laminlabs/lamindb"
18
+ Home = "https://github.com/laminlabs/lamin-cli"
16
19
 
17
20
  [project.scripts]
18
21
  lamin = "lamin_cli.__main__:main"
@@ -1,3 +0,0 @@
1
- """Lamin CLI."""
2
-
3
- __version__ = "0.17.7"
File without changes
File without changes
File without changes
File without changes
File without changes