lovelytics-cli 0.4.15__tar.gz → 0.4.17__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.
- {lovelytics_cli-0.4.15 → lovelytics_cli-0.4.17}/PKG-INFO +1 -1
- {lovelytics_cli-0.4.15 → lovelytics_cli-0.4.17}/love/cli.py +2 -1
- {lovelytics_cli-0.4.15 → lovelytics_cli-0.4.17}/love/crate.py +15 -4
- {lovelytics_cli-0.4.15 → lovelytics_cli-0.4.17}/pyproject.toml +1 -1
- {lovelytics_cli-0.4.15 → lovelytics_cli-0.4.17}/LICENSE +0 -0
- {lovelytics_cli-0.4.15 → lovelytics_cli-0.4.17}/README.md +0 -0
- {lovelytics_cli-0.4.15 → lovelytics_cli-0.4.17}/love/__main__.py +0 -0
- {lovelytics_cli-0.4.15 → lovelytics_cli-0.4.17}/love/auth.py +0 -0
- {lovelytics_cli-0.4.15 → lovelytics_cli-0.4.17}/love/conduit.py +0 -0
- {lovelytics_cli-0.4.15 → lovelytics_cli-0.4.17}/love/config.py +0 -0
- {lovelytics_cli-0.4.15 → lovelytics_cli-0.4.17}/love/forecast.py +0 -0
- {lovelytics_cli-0.4.15 → lovelytics_cli-0.4.17}/love/genie.py +0 -0
- {lovelytics_cli-0.4.15 → lovelytics_cli-0.4.17}/love/install.py +0 -0
- {lovelytics_cli-0.4.15 → lovelytics_cli-0.4.17}/love/linguo.py +0 -0
- {lovelytics_cli-0.4.15 → lovelytics_cli-0.4.17}/love/utils.py +0 -0
|
@@ -213,7 +213,8 @@ def install_crate(crate_name, params_file, download):
|
|
|
213
213
|
Downloads and installs the specified solution from the Lovelytics CodeArtifact
|
|
214
214
|
repository via Lando. Parameters can be provided via a config file (--params-file) and/or
|
|
215
215
|
environment variables prefixed with CRATE_ (e.g., CRATE_CATALOG_NAME). Environment
|
|
216
|
-
variables take precedence over values in the config file.
|
|
216
|
+
variables take precedence over values in the config file. Any parameter without a
|
|
217
|
+
dedicated crate flag is passed as --variable key=value.
|
|
217
218
|
|
|
218
219
|
Downloaded solution archives are cached under ~/.lovelytics/crates/. Use --download
|
|
219
220
|
to force a fresh download even when a cached archive exists.
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"""Core logic for installing crates from CodeArtifact."""
|
|
2
2
|
|
|
3
|
+
import csv
|
|
4
|
+
import io
|
|
3
5
|
import json
|
|
4
6
|
import logging
|
|
5
7
|
import os
|
|
@@ -146,6 +148,17 @@ def ensure_crate_binary() -> str:
|
|
|
146
148
|
)
|
|
147
149
|
|
|
148
150
|
|
|
151
|
+
def _csv_quote(entry: str) -> str:
|
|
152
|
+
"""CSV-encode one entry, since crate's --variable flag parses its value as CSV.
|
|
153
|
+
|
|
154
|
+
Entries containing a comma or double quote come back quoted (quotes doubled);
|
|
155
|
+
all other entries are returned unchanged.
|
|
156
|
+
"""
|
|
157
|
+
buf = io.StringIO()
|
|
158
|
+
csv.writer(buf, lineterminator="").writerow([entry])
|
|
159
|
+
return buf.getvalue()
|
|
160
|
+
|
|
161
|
+
|
|
149
162
|
def build_crate_install_args(source_path: str, params: dict) -> list:
|
|
150
163
|
"""Build the list of CLI arguments for the crate install command."""
|
|
151
164
|
args = ["--path", source_path]
|
|
@@ -155,9 +168,7 @@ def build_crate_install_args(source_path: str, params: dict) -> list:
|
|
|
155
168
|
if flag:
|
|
156
169
|
args.extend([flag, str(value)])
|
|
157
170
|
else:
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
f"(no matching crate CLI flag)."
|
|
161
|
-
)
|
|
171
|
+
# Anything else is a crate variable (crate.yaml `variables:`).
|
|
172
|
+
args.extend(["--variable", _csv_quote(f"{key}={value}")])
|
|
162
173
|
|
|
163
174
|
return args
|
|
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
|
|
File without changes
|
|
File without changes
|