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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lovelytics-cli
3
- Version: 0.4.15
3
+ Version: 0.4.17
4
4
  Summary: Development tools for Lovelytics Labs.
5
5
  License: LICENSE
6
6
  License-File: LICENSE
@@ -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
- logger.warning(
159
- f"Ignoring unrecognized parameter '{key}' "
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
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "lovelytics-cli"
3
- version = "0.4.15"
3
+ version = "0.4.17"
4
4
  description = "Development tools for Lovelytics Labs."
5
5
  authors = ["Lovelytics Labs <labs@lovelytics.com>"]
6
6
  readme = "README.md"
File without changes