create-awesome-python-app 0.2.7__py3-none-any.whl → 0.2.8__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.
@@ -1,3 +1,3 @@
1
1
  """Create Awesome Python App CLI."""
2
2
 
3
- __version__ = "0.2.7"
3
+ __version__ = "0.2.8"
@@ -71,6 +71,49 @@ def _preprocess_fixture_argv(argv: list[str] | None = None) -> list[str]:
71
71
  return out
72
72
 
73
73
 
74
+ def _expand_variadic_option(argv: list[str], option: str) -> list[str]:
75
+ """Expand ``--addons a b`` into ``--addons a --addons b`` (CNA Commander parity).
76
+
77
+ Typer's ``list[str]`` Option only accepts one value per flag. Commander uses
78
+ ``--addons [extensions...]``, so users naturally write space-separated lists.
79
+ """
80
+ out: list[str] = []
81
+ i = 0
82
+ prefix = option + "="
83
+ while i < len(argv):
84
+ arg = argv[i]
85
+ if arg == option:
86
+ i += 1
87
+ values: list[str] = []
88
+ while i < len(argv) and not argv[i].startswith("-"):
89
+ values.append(argv[i])
90
+ i += 1
91
+ if not values:
92
+ out.append(option)
93
+ else:
94
+ for value in values:
95
+ out.extend([option, value])
96
+ continue
97
+ if arg.startswith(prefix):
98
+ value = arg[len(prefix) :]
99
+ out.extend([option, value] if value else [option])
100
+ i += 1
101
+ continue
102
+ out.append(arg)
103
+ i += 1
104
+ return out
105
+
106
+
107
+ def _preprocess_cli_argv(argv: list[str] | None = None) -> list[str]:
108
+ """Apply argv rewrites needed before Typer parses the CLI."""
109
+ out = _preprocess_fixture_argv(argv)
110
+ out = _expand_variadic_option(out, "--addons")
111
+ out = _expand_variadic_option(out, "--extend")
112
+ if argv is None:
113
+ sys.argv = out
114
+ return out
115
+
116
+
74
117
  def apply_fixture_mode(fixture: str | None) -> None:
75
118
  """Translate ``--fixture`` into ``CPA_CATALOG_FIXTURE`` / ``CPA_FIXTURE_DIR``."""
76
119
  if fixture is None and os.environ.get("CPA_CATALOG_FIXTURE") != "1":
@@ -204,7 +247,7 @@ def main() -> None:
204
247
  treat `cache` as project_directory).
205
248
  """
206
249
  check_python_version(">=3.12", "create-awesome-python-app")
207
- _preprocess_fixture_argv()
250
+ _preprocess_cli_argv()
208
251
  if len(sys.argv) > 1 and sys.argv[1] == "cache":
209
252
  sys.argv = [sys.argv[0], *sys.argv[2:]]
210
253
  cache_app(prog_name="create-awesome-python-app cache")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: create-awesome-python-app
3
- Version: 0.2.7
3
+ Version: 0.2.8
4
4
  Summary: Composable scaffolding CLI for production-ready Python apps
5
5
  Project-URL: Homepage, https://github.com/Create-Python-App/create-python-app
6
6
  Project-URL: Repository, https://github.com/Create-Python-App/create-python-app
@@ -0,0 +1,9 @@
1
+ create_awesome_python_app/__init__.py,sha256=bpha_GXZNmruh0uP4KvEZzHYZOOzyqluLF2ediJjcdo,60
2
+ create_awesome_python_app/cache.py,sha256=eHKUlunGexZKYJo0HDNoBoOVq0DjLyRYgEe_wUh4Fk0,11812
3
+ create_awesome_python_app/catalog.py,sha256=ZB-ieyEn_TBqVBbCbFkK9h3VJoYtifvvOxs_BM2tDEw,22754
4
+ create_awesome_python_app/cli.py,sha256=bSmivzm4lUOcDtoyNT-t3PL_Xb1O8msAUl_XFczeNkQ,27555
5
+ create_awesome_python_app/prompt_style.py,sha256=pERX1qPQSLZXeJvPVFC7z85dvte73ZV4iuENPQduheE,3463
6
+ create_awesome_python_app-0.2.8.dist-info/METADATA,sha256=YcMQFDgWXeK0jT77VqBV6LOYNBxfTWOhhYRWpZ1A9W0,23271
7
+ create_awesome_python_app-0.2.8.dist-info/WHEEL,sha256=lCkmxWfQsSc9CfIClYeavTdQeEX2toPqufh9gI35EQA,87
8
+ create_awesome_python_app-0.2.8.dist-info/entry_points.txt,sha256=rszFbUjY-lvMDZ96zX1lALJwgD1mI3CkUuNyF2qqjYo,81
9
+ create_awesome_python_app-0.2.8.dist-info/RECORD,,
@@ -1,9 +0,0 @@
1
- create_awesome_python_app/__init__.py,sha256=ePecLVnfNi_mPoF_Pogp9juH5iycJGewOy1U0mxuMvM,60
2
- create_awesome_python_app/cache.py,sha256=eHKUlunGexZKYJo0HDNoBoOVq0DjLyRYgEe_wUh4Fk0,11812
3
- create_awesome_python_app/catalog.py,sha256=ZB-ieyEn_TBqVBbCbFkK9h3VJoYtifvvOxs_BM2tDEw,22754
4
- create_awesome_python_app/cli.py,sha256=JGdXNAXAXqQ-grQbZOf14Vzii3Qh3eZHt5zRJ-tMIBk,26156
5
- create_awesome_python_app/prompt_style.py,sha256=pERX1qPQSLZXeJvPVFC7z85dvte73ZV4iuENPQduheE,3463
6
- create_awesome_python_app-0.2.7.dist-info/METADATA,sha256=gpy3o2dcc-Qw_l1uHnipFJ-IkOUe9GT50bKeGtEqkUc,23271
7
- create_awesome_python_app-0.2.7.dist-info/WHEEL,sha256=lCkmxWfQsSc9CfIClYeavTdQeEX2toPqufh9gI35EQA,87
8
- create_awesome_python_app-0.2.7.dist-info/entry_points.txt,sha256=rszFbUjY-lvMDZ96zX1lALJwgD1mI3CkUuNyF2qqjYo,81
9
- create_awesome_python_app-0.2.7.dist-info/RECORD,,