create-awesome-python-app 0.2.8__py3-none-any.whl → 0.2.9__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.8"
3
+ __version__ = "0.2.9"
@@ -76,10 +76,15 @@ def _expand_variadic_option(argv: list[str], option: str) -> list[str]:
76
76
 
77
77
  Typer's ``list[str]`` Option only accepts one value per flag. Commander uses
78
78
  ``--addons [extensions...]``, so users naturally write space-separated lists.
79
+
80
+ When ``project_directory`` comes *after* options and no positional was seen
81
+ yet, peel the final trailing token at EOS back as the directory so that
82
+ ``--addons a --addons b /tmp/app`` does not treat ``/tmp/app`` as an addon.
79
83
  """
80
84
  out: list[str] = []
81
85
  i = 0
82
86
  prefix = option + "="
87
+ saw_positional = False
83
88
  while i < len(argv):
84
89
  arg = argv[i]
85
90
  if arg == option:
@@ -88,17 +93,26 @@ def _expand_variadic_option(argv: list[str], option: str) -> list[str]:
88
93
  while i < len(argv) and not argv[i].startswith("-"):
89
94
  values.append(argv[i])
90
95
  i += 1
96
+ ended_at_eos = i >= len(argv)
97
+ trailing: str | None = None
98
+ if ended_at_eos and not saw_positional and len(values) >= 2:
99
+ trailing = values.pop()
91
100
  if not values:
92
101
  out.append(option)
93
102
  else:
94
103
  for value in values:
95
104
  out.extend([option, value])
105
+ if trailing is not None:
106
+ out.append(trailing)
107
+ saw_positional = True
96
108
  continue
97
109
  if arg.startswith(prefix):
98
110
  value = arg[len(prefix) :]
99
111
  out.extend([option, value] if value else [option])
100
112
  i += 1
101
113
  continue
114
+ if i > 0 and not arg.startswith("-"):
115
+ saw_positional = True
102
116
  out.append(arg)
103
117
  i += 1
104
118
  return out
@@ -106,7 +120,9 @@ def _expand_variadic_option(argv: list[str], option: str) -> list[str]:
106
120
 
107
121
  def _preprocess_cli_argv(argv: list[str] | None = None) -> list[str]:
108
122
  """Apply argv rewrites needed before Typer parses the CLI."""
109
- out = _preprocess_fixture_argv(argv)
123
+ raw = list(sys.argv if argv is None else argv)
124
+ # Pass an explicit list so fixture preprocess does not mutate sys.argv early.
125
+ out = _preprocess_fixture_argv(raw)
110
126
  out = _expand_variadic_option(out, "--addons")
111
127
  out = _expand_variadic_option(out, "--extend")
112
128
  if argv is None:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: create-awesome-python-app
3
- Version: 0.2.8
3
+ Version: 0.2.9
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=yEN7GhPafrsxl2sDdfgv5qrUMWqgtvEaeDMa_A0Q8js,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=FrPDSJIWhSaFvRFFGSSBWJV_8cSvOkuk-yb-JUWi58Q,28338
5
+ create_awesome_python_app/prompt_style.py,sha256=pERX1qPQSLZXeJvPVFC7z85dvte73ZV4iuENPQduheE,3463
6
+ create_awesome_python_app-0.2.9.dist-info/METADATA,sha256=O-jxygHlhVCsJWbJs6ptV7dmWQ-OuTwt9mTXNbeX6qQ,23271
7
+ create_awesome_python_app-0.2.9.dist-info/WHEEL,sha256=lCkmxWfQsSc9CfIClYeavTdQeEX2toPqufh9gI35EQA,87
8
+ create_awesome_python_app-0.2.9.dist-info/entry_points.txt,sha256=rszFbUjY-lvMDZ96zX1lALJwgD1mI3CkUuNyF2qqjYo,81
9
+ create_awesome_python_app-0.2.9.dist-info/RECORD,,
@@ -1,9 +0,0 @@
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,,