lamin_cli 1.7.0__py2.py3-none-any.whl → 1.7.1__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 CHANGED
@@ -1,3 +1,12 @@
1
- """Lamin CLI."""
1
+ """Lamin CLI.
2
2
 
3
- __version__ = "1.7.0"
3
+ This is the command line interface for interacting with LaminDB & LaminHub.
4
+
5
+ The interface is defined in `__main__.py`. The root API here is used by LaminR to replicate the CLI functionality.
6
+ """
7
+
8
+ __version__ = "1.7.1"
9
+
10
+ from ._save import save
11
+
12
+ __all__ = ["save"]
lamin_cli/__main__.py CHANGED
@@ -449,9 +449,9 @@ def save(path: str, key: str, description: str, stem_uid: str, project: str, spa
449
449
  other file types and folders as {class}`~lamindb.Artifact`. You can enforce saving a file as
450
450
  an {class}`~lamindb.Artifact` by passing `--registry artifact`.
451
451
  """
452
- from lamin_cli._save import save_from_path_cli
452
+ from lamin_cli import save as save_
453
453
 
454
- if save_from_path_cli(path=path, key=key, description=description, stem_uid=stem_uid, project=project, space=space, branch=branch, registry=registry) is not None:
454
+ if save_(path=path, key=key, description=description, stem_uid=stem_uid, project=project, space=space, branch=branch, registry=registry) is not None:
455
455
  sys.exit(1)
456
456
 
457
457
 
lamin_cli/_save.py CHANGED
@@ -71,7 +71,7 @@ def parse_title_r_notebook(content: str) -> str | None:
71
71
  return None
72
72
 
73
73
 
74
- def save_from_path_cli(
74
+ def save(
75
75
  path: Path | str,
76
76
  key: str | None,
77
77
  description: str | None,
@@ -81,21 +81,9 @@ def save_from_path_cli(
81
81
  branch: str | None,
82
82
  registry: str | None,
83
83
  ) -> str | None:
84
- import lamindb_setup as ln_setup
85
- from lamindb_setup.core.upath import LocalPathClasses, UPath, create_path
86
-
87
- # this will be gone once we get rid of lamin load or enable loading multiple
88
- # instances sequentially
89
- auto_connect_state = ln_setup.settings.auto_connect
90
- ln_setup.settings.auto_connect = True
91
-
92
84
  import lamindb as ln
93
-
94
- if not ln.setup.core.django.IS_SETUP:
95
- sys.exit(-1)
96
85
  from lamindb._finish import save_context_core
97
-
98
- ln_setup.settings.auto_connect = auto_connect_state
86
+ from lamindb_setup.core.upath import LocalPathClasses, UPath, create_path
99
87
 
100
88
  # this allows to have the correct treatment of credentials in case of cloud paths
101
89
  path = create_path(path)
@@ -166,8 +154,8 @@ def save_from_path_cli(
166
154
  if project is not None:
167
155
  artifact.projects.add(project_record)
168
156
  logger.important(f"labeled with project: {project_record.name}")
169
- if ln_setup.settings.instance.is_remote:
170
- slug = ln_setup.settings.instance.slug
157
+ if ln.setup.settings.instance.is_remote:
158
+ slug = ln.setup.settings.instance.slug
171
159
  logger.important(f"go to: https://lamin.ai/{slug}/artifact/{artifact.uid}")
172
160
  return None
173
161
 
@@ -280,7 +268,7 @@ def save_from_path_cli(
280
268
  logger.important(f"labeled with project: {project_record.name}")
281
269
  # latest run of this transform by user
282
270
  run = ln.Run.filter(transform=transform).order_by("-started_at").first()
283
- if run is not None and run.created_by.id != ln_setup.settings.user.id:
271
+ if run is not None and run.created_by.id != ln.setup.settings.user.id:
284
272
  if os.getenv("LAMIN_TESTING") == "true":
285
273
  response = "y"
286
274
  else:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: lamin_cli
3
- Version: 1.7.0
3
+ Version: 1.7.1
4
4
  Summary: Lamin CLI.
5
5
  Author-email: Lamin Labs <open-source@lamin.ai>
6
6
  Description-Content-Type: text/markdown
@@ -1,16 +1,16 @@
1
- lamin_cli/__init__.py,sha256=pYo6D4PqHL3amAAxIhCrkK0o08xnL02H3DTM3whSlEQ,40
2
- lamin_cli/__main__.py,sha256=eMfRcYrgxeb7f16tW8rDhCjUVzeNIwz6UUIU0qZ2Wuo,19750
1
+ lamin_cli/__init__.py,sha256=TsirduNUlvkyhv431FRc0iPm1Y57lnvHKj9qJif7f3Q,279
2
+ lamin_cli/__main__.py,sha256=TQZ0-FJh8C1o5UvuZY88EIe9gsZ9Yuozhl20sgIL83g,19726
3
3
  lamin_cli/_annotate.py,sha256=ZD76__K-mQt7UpYqyM1I2lKCs-DraTmnkjsByIHmD-g,1839
4
4
  lamin_cli/_cache.py,sha256=oplwE8AcS_9PYptQUZxff2qTIdNFS81clGPkJNWk098,800
5
5
  lamin_cli/_load.py,sha256=OgTGqZQtoJ0GYOhuJihz-izt0F4jM4U_nSX_vhPoukg,7698
6
6
  lamin_cli/_migration.py,sha256=XUl_L9_3pTTk5jJoBiqbzf0Bd2LdKKtHa1zPZ4Rla5c,1267
7
- lamin_cli/_save.py,sha256=4-pPCNxNZO62pYgRuI8oJMraTexWewwJQEOeNgocuyU,11831
7
+ lamin_cli/_save.py,sha256=j7wY08blwYXCSZEckxQCHUCzoyVSVfKeWxiMoDRFboI,11449
8
8
  lamin_cli/_settings.py,sha256=xG5e_zWk9N8glcodeyE0Kap79tl6T7yp4MWW1pBLOmk,1684
9
9
  lamin_cli/urls.py,sha256=gc72s4SpaAQA8J50CtCIWlr49DWOSL_a6OM9lXfPouM,367
10
10
  lamin_cli/compute/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
11
  lamin_cli/compute/modal.py,sha256=QnR7GyyvWWWkLnou95HxS9xxSQfw1k-SiefM_qRVnU0,6010
12
- lamin_cli-1.7.0.dist-info/entry_points.txt,sha256=Qms85i9cZPlu-U7RnVZhFsF7vJ9gaLZUFkCjcGcXTpg,49
13
- lamin_cli-1.7.0.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
14
- lamin_cli-1.7.0.dist-info/WHEEL,sha256=ssQ84EZ5gH1pCOujd3iW7HClo_O_aDaClUbX4B8bjKY,100
15
- lamin_cli-1.7.0.dist-info/METADATA,sha256=RIe8cPwox_IIgQA9VnfiWofW9BDYN7fVsrA0DhVUTYY,337
16
- lamin_cli-1.7.0.dist-info/RECORD,,
12
+ lamin_cli-1.7.1.dist-info/entry_points.txt,sha256=Qms85i9cZPlu-U7RnVZhFsF7vJ9gaLZUFkCjcGcXTpg,49
13
+ lamin_cli-1.7.1.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
14
+ lamin_cli-1.7.1.dist-info/WHEEL,sha256=ssQ84EZ5gH1pCOujd3iW7HClo_O_aDaClUbX4B8bjKY,100
15
+ lamin_cli-1.7.1.dist-info/METADATA,sha256=a28YAYUzAwM3SlH-xvvJVHsH2Pkv_TUUSGed1BVIiBA,337
16
+ lamin_cli-1.7.1.dist-info/RECORD,,