lovelytics-cli 0.4.16__tar.gz → 0.4.18__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.16 → lovelytics_cli-0.4.18}/PKG-INFO +1 -1
- {lovelytics_cli-0.4.16 → lovelytics_cli-0.4.18}/love/crate.py +14 -6
- {lovelytics_cli-0.4.16 → lovelytics_cli-0.4.18}/pyproject.toml +1 -1
- {lovelytics_cli-0.4.16 → lovelytics_cli-0.4.18}/LICENSE +0 -0
- {lovelytics_cli-0.4.16 → lovelytics_cli-0.4.18}/README.md +0 -0
- {lovelytics_cli-0.4.16 → lovelytics_cli-0.4.18}/love/__main__.py +0 -0
- {lovelytics_cli-0.4.16 → lovelytics_cli-0.4.18}/love/auth.py +0 -0
- {lovelytics_cli-0.4.16 → lovelytics_cli-0.4.18}/love/cli.py +0 -0
- {lovelytics_cli-0.4.16 → lovelytics_cli-0.4.18}/love/conduit.py +0 -0
- {lovelytics_cli-0.4.16 → lovelytics_cli-0.4.18}/love/config.py +0 -0
- {lovelytics_cli-0.4.16 → lovelytics_cli-0.4.18}/love/forecast.py +0 -0
- {lovelytics_cli-0.4.16 → lovelytics_cli-0.4.18}/love/genie.py +0 -0
- {lovelytics_cli-0.4.16 → lovelytics_cli-0.4.18}/love/install.py +0 -0
- {lovelytics_cli-0.4.16 → lovelytics_cli-0.4.18}/love/linguo.py +0 -0
- {lovelytics_cli-0.4.16 → lovelytics_cli-0.4.18}/love/utils.py +0 -0
|
@@ -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,12 +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
|
-
# crate's --variable splits on commas and quotes; such values can't round-trip.
|
|
159
|
-
if "," in str(value) or '"' in str(value):
|
|
160
|
-
raise click.ClickException(
|
|
161
|
-
f"Parameter '{key}' must not contain a comma or double quote."
|
|
162
|
-
)
|
|
163
171
|
# Anything else is a crate variable (crate.yaml `variables:`).
|
|
164
|
-
args.extend(["--variable", f"{key}={value}"])
|
|
172
|
+
args.extend(["--variable", _csv_quote(f"{key}={value}")])
|
|
165
173
|
|
|
166
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
|
|
File without changes
|