lamin_cli 0.14.0__tar.gz → 0.15.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.
- lamin_cli-0.15.0/.github/workflows/doc-changes.yml +23 -0
- {lamin_cli-0.14.0 → lamin_cli-0.15.0}/.pre-commit-config.yaml +1 -1
- {lamin_cli-0.14.0 → lamin_cli-0.15.0}/PKG-INFO +1 -1
- lamin_cli-0.15.0/lamin_cli/__init__.py +3 -0
- {lamin_cli-0.14.0 → lamin_cli-0.15.0}/lamin_cli/__main__.py +37 -13
- {lamin_cli-0.14.0 → lamin_cli-0.15.0}/tests/scripts/run-track-and-finish-sync-git.py +2 -0
- {lamin_cli-0.14.0 → lamin_cli-0.15.0}/tests/scripts/run-track-and-finish.py +1 -0
- {lamin_cli-0.14.0 → lamin_cli-0.15.0}/tests/test_migrate.py +1 -1
- {lamin_cli-0.14.0 → lamin_cli-0.15.0}/tests/test_save_scripts.py +1 -1
- lamin_cli-0.14.0/lamin_cli/__init__.py +0 -3
- {lamin_cli-0.14.0 → lamin_cli-0.15.0}/.gitignore +0 -0
- {lamin_cli-0.14.0 → lamin_cli-0.15.0}/README.md +0 -0
- {lamin_cli-0.14.0 → lamin_cli-0.15.0}/lamin_cli/_cache.py +0 -0
- {lamin_cli-0.14.0 → lamin_cli-0.15.0}/lamin_cli/_get.py +0 -0
- {lamin_cli-0.14.0 → lamin_cli-0.15.0}/lamin_cli/_migration.py +0 -0
- {lamin_cli-0.14.0 → lamin_cli-0.15.0}/lamin_cli/_save.py +0 -0
- {lamin_cli-0.14.0 → lamin_cli-0.15.0}/pyproject.toml +0 -0
- {lamin_cli-0.14.0 → lamin_cli-0.15.0}/tests/conftest.py +0 -0
- {lamin_cli-0.14.0 → lamin_cli-0.15.0}/tests/notebooks/not-initialized.ipynb +0 -0
- {lamin_cli-0.14.0 → lamin_cli-0.15.0}/tests/notebooks/with-title-and-initialized-consecutive.ipynb +0 -0
- {lamin_cli-0.14.0 → lamin_cli-0.15.0}/tests/notebooks/with-title-and-initialized-non-consecutive.ipynb +0 -0
- {lamin_cli-0.14.0 → lamin_cli-0.15.0}/tests/scripts/merely-import-lamindb.py +0 -0
- {lamin_cli-0.14.0 → lamin_cli-0.15.0}/tests/test_cli.py +0 -0
- {lamin_cli-0.14.0 → lamin_cli-0.15.0}/tests/test_get.py +0 -0
- {lamin_cli-0.14.0 → lamin_cli-0.15.0}/tests/test_multi_process.py +0 -0
- {lamin_cli-0.14.0 → lamin_cli-0.15.0}/tests/test_save_files.py +0 -0
- {lamin_cli-0.14.0 → lamin_cli-0.15.0}/tests/test_save_notebooks.py +0 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
name: doc-changes
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request_target:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
types:
|
|
8
|
+
- closed
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
latest-changes:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v4
|
|
15
|
+
- uses: actions/setup-python@v5
|
|
16
|
+
with:
|
|
17
|
+
python-version: "3.11"
|
|
18
|
+
- run: pip install "laminci[doc-changes]@git+https://x-access-token:${{ secrets.LAMIN_BUILD_DOCS }}@github.com/laminlabs/laminci"
|
|
19
|
+
- run: laminci doc-changes
|
|
20
|
+
env:
|
|
21
|
+
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
|
22
|
+
docs_token: ${{ secrets.LAMIN_BUILD_DOCS }}
|
|
23
|
+
changelog_file: lamin-docs/docs/changelog/soon/lamindb.md
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
import os
|
|
3
3
|
import sys
|
|
4
|
+
import inspect
|
|
4
5
|
from importlib.metadata import PackageNotFoundError, version
|
|
5
6
|
from typing import Optional
|
|
6
7
|
|
|
@@ -32,7 +33,7 @@ def main():
|
|
|
32
33
|
|
|
33
34
|
@main.command()
|
|
34
35
|
def info():
|
|
35
|
-
"""Show user & instance info."""
|
|
36
|
+
"""Show user, settings & instance info."""
|
|
36
37
|
import lamindb_setup
|
|
37
38
|
|
|
38
39
|
print(lamindb_setup.settings)
|
|
@@ -57,7 +58,10 @@ def init(storage: str, db: Optional[str], schema: Optional[str], name: Optional[
|
|
|
57
58
|
@click.option("--key", type=str, default=None, help="API key")
|
|
58
59
|
@click.option("--password", type=str, default=None, help="legacy password")
|
|
59
60
|
def login(user: str, key: Optional[str], password: Optional[str]):
|
|
60
|
-
"""Login using
|
|
61
|
+
"""Login using a user email address or handle.
|
|
62
|
+
|
|
63
|
+
Examples: `lamin login marge` or `lamin login marge@acme.com`
|
|
64
|
+
"""
|
|
61
65
|
from lamindb_setup._setup_user import login
|
|
62
66
|
|
|
63
67
|
return login(user, key=key, password=password)
|
|
@@ -78,12 +82,10 @@ def logout():
|
|
|
78
82
|
@click.option("--storage", type=str, default=None, help="Update storage while loading.")
|
|
79
83
|
# fmt: on
|
|
80
84
|
def load(identifier: str, db: Optional[str], storage: Optional[str]):
|
|
81
|
-
"""
|
|
82
|
-
|
|
83
|
-
Identifier can be slug (account_handle/instance_name) or url
|
|
84
|
-
(https://lamin.ai/account_handle/instance_name).
|
|
85
|
+
"""Load an instance for auto-connection.
|
|
85
86
|
|
|
86
|
-
|
|
87
|
+
`IDENTIFIER` is either a slug (`account/instance`) or a `URL`
|
|
88
|
+
(`https://lamin.ai/account/instance`).
|
|
87
89
|
"""
|
|
88
90
|
from lamindb_setup import settings, connect
|
|
89
91
|
|
|
@@ -97,26 +99,38 @@ def load(identifier: str, db: Optional[str], storage: Optional[str]):
|
|
|
97
99
|
@click.option("--force", is_flag=True, default=False, help="Do not ask for confirmation.") # noqa: E501
|
|
98
100
|
# fmt: on
|
|
99
101
|
def delete(instance: str, force: bool = False):
|
|
100
|
-
"""Delete instance."""
|
|
102
|
+
"""Delete an instance."""
|
|
101
103
|
from lamindb_setup._delete import delete
|
|
102
104
|
|
|
103
105
|
return delete(instance, force=force)
|
|
104
106
|
|
|
105
107
|
|
|
106
108
|
@main.command(name="set")
|
|
107
|
-
@click.argument(
|
|
109
|
+
@click.argument(
|
|
110
|
+
"setting",
|
|
111
|
+
type=click.Choice(["auto-connect", "private-django-api"], case_sensitive=False),
|
|
112
|
+
)
|
|
108
113
|
@click.argument("value", type=click.BOOL)
|
|
109
114
|
def set_(setting: str, value: bool):
|
|
110
|
-
"""Update settings.
|
|
115
|
+
"""Update settings.
|
|
116
|
+
|
|
117
|
+
- `auto-connect` → {attr}`~lamindb.setup.core.SetupSettings.auto_connect`
|
|
118
|
+
- `private-django-api` → {attr}`~lamindb.setup.core.SetupSettings.private_django_api`
|
|
119
|
+
"""
|
|
111
120
|
from lamindb_setup import settings
|
|
112
121
|
|
|
113
122
|
if setting == "auto-connect":
|
|
114
123
|
settings.auto_connect = value
|
|
124
|
+
if setting == "private-django-api":
|
|
125
|
+
settings.private_django_api = value
|
|
115
126
|
|
|
116
127
|
|
|
117
128
|
@main.command()
|
|
118
129
|
def close():
|
|
119
|
-
"""Close existing instance.
|
|
130
|
+
"""Close an existing instance.
|
|
131
|
+
|
|
132
|
+
Is the opposite of loading an instance.
|
|
133
|
+
"""
|
|
120
134
|
from lamindb_setup._close import close as close_
|
|
121
135
|
|
|
122
136
|
return close_()
|
|
@@ -168,8 +182,9 @@ main.add_command(migrate)
|
|
|
168
182
|
|
|
169
183
|
|
|
170
184
|
# https://stackoverflow.com/questions/57810659/automatically-generate-all-help-documentation-for-click-commands
|
|
185
|
+
# https://claude.ai/chat/73c28487-bec3-4073-8110-50d1a2dd6b84
|
|
171
186
|
def _generate_help():
|
|
172
|
-
out: dict[str, str] = {}
|
|
187
|
+
out: dict[str, dict[str, str | None]] = {}
|
|
173
188
|
|
|
174
189
|
def recursive_help(
|
|
175
190
|
cmd: Command, parent: Optional[Context] = None, name: tuple[str, ...] = ()
|
|
@@ -177,7 +192,16 @@ def _generate_help():
|
|
|
177
192
|
ctx = click.Context(cmd, info_name=cmd.name, parent=parent)
|
|
178
193
|
assert cmd.name
|
|
179
194
|
name = (*name, cmd.name)
|
|
180
|
-
|
|
195
|
+
command_name = " ".join(name)
|
|
196
|
+
|
|
197
|
+
docstring = inspect.getdoc(cmd.callback)
|
|
198
|
+
usage = cmd.get_help(ctx).split("\n")[0]
|
|
199
|
+
options = cmd.get_help(ctx).split("Options:")[1]
|
|
200
|
+
out[command_name] = {
|
|
201
|
+
"help": usage + "\n\nOptions:" + options,
|
|
202
|
+
"docstring": docstring,
|
|
203
|
+
}
|
|
204
|
+
|
|
181
205
|
for sub in getattr(cmd, "commands", {}).values():
|
|
182
206
|
recursive_help(sub, ctx, name=name)
|
|
183
207
|
|
|
@@ -3,6 +3,8 @@ import lamindb as ln
|
|
|
3
3
|
ln.settings.sync_git_repo = "https://github.com/laminlabs/lamin-cli"
|
|
4
4
|
ln.settings.transform.stem_uid = "m5uCHTTpJnjQ"
|
|
5
5
|
ln.settings.transform.version = "1"
|
|
6
|
+
ln.settings.transform.name = "My good script"
|
|
7
|
+
|
|
6
8
|
|
|
7
9
|
if __name__ == "__main__":
|
|
8
10
|
# we're using new_run here to mock the notebook situation
|
|
@@ -15,7 +15,7 @@ def test_migrate_deploy():
|
|
|
15
15
|
import lamindb as ln
|
|
16
16
|
|
|
17
17
|
instance_slug = ln.setup.settings.instance.slug
|
|
18
|
-
exit_status = os.system("lamin load
|
|
18
|
+
exit_status = os.system("lamin load testuser1/static-test-instance-private-sqlite")
|
|
19
19
|
assert exit_status == 0
|
|
20
20
|
exit_status = os.system("lamin migrate deploy")
|
|
21
21
|
assert exit_status == 0
|
|
@@ -37,7 +37,7 @@ def test_run_save_cache():
|
|
|
37
37
|
assert "saved: Run" in result.stdout.decode()
|
|
38
38
|
|
|
39
39
|
transform = ln.Transform.get("m5uCHTTpJnjQ")
|
|
40
|
-
assert transform.source_code.hash == "
|
|
40
|
+
assert transform.source_code.hash == "T1zmmTJyeEpBxjaHcHcZdg"
|
|
41
41
|
assert transform.latest_run.environment.path.exists()
|
|
42
42
|
assert transform.source_code.path.exists()
|
|
43
43
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{lamin_cli-0.14.0 → lamin_cli-0.15.0}/tests/notebooks/with-title-and-initialized-consecutive.ipynb
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|