create-awesome-python-app 0.2.9__py3-none-any.whl → 0.2.10__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.9"
3
+ __version__ = "0.2.10"
@@ -12,6 +12,8 @@ import typer
12
12
  from create_python_app_core import (
13
13
  ConfigParseError,
14
14
  CpaCustomOption,
15
+ NonEmptyTargetDirectoryError,
16
+ assert_directory_is_empty,
15
17
  check_for_latest_version,
16
18
  check_python_version,
17
19
  create_python_app,
@@ -323,6 +325,18 @@ def scaffold(
323
325
  la(template)
324
326
  raise typer.Exit(0)
325
327
 
328
+ target_directory = project_directory or "my-project"
329
+ # Fail before the interactive wizard so a leftover `my-project/` does not
330
+ # waste a full prompt session (and so we exit cleanly, not with a traceback).
331
+ if not force:
332
+ try:
333
+ assert_directory_is_empty(
334
+ Path(target_directory).expanduser().resolve(), force=False
335
+ )
336
+ except NonEmptyTargetDirectoryError as err:
337
+ console.print(f"[red]{err}[/red]")
338
+ raise typer.Exit(1) from err
339
+
326
340
  effective_refresh = _normalize_refresh(refresh)
327
341
  if refresh and effective_refresh is None:
328
342
  console.print(
@@ -540,25 +554,31 @@ def scaffold(
540
554
  raise typer.Exit(1)
541
555
  console.print(f"[yellow]{msg}[/yellow]")
542
556
 
543
- asyncio.run(
544
- create_python_app(
545
- project_directory or "my-project",
546
- {
547
- "template": template,
548
- "addons": addons or [],
549
- "extend": extend or [],
550
- "install": not no_install,
551
- "force": force,
552
- "verbose": verbose,
553
- "offline": offline,
554
- "refresh": effective_refresh,
555
- "keep_on_failure": keep_on_failure,
556
- "cache_dir": str(cache_dir) if cache_dir else None,
557
- "set": set_map,
558
- },
557
+ try:
558
+ asyncio.run(
559
+ create_python_app(
560
+ target_directory,
561
+ {
562
+ "template": template,
563
+ "addons": addons or [],
564
+ "extend": extend or [],
565
+ "install": not no_install,
566
+ "force": force,
567
+ "verbose": verbose,
568
+ "offline": offline,
569
+ "refresh": effective_refresh,
570
+ "keep_on_failure": keep_on_failure,
571
+ "cache_dir": str(cache_dir) if cache_dir else None,
572
+ "set": set_map,
573
+ },
574
+ )
559
575
  )
560
- )
561
- console.print(f"[green]Created[/green] {project_directory}")
576
+ except NonEmptyTargetDirectoryError as err:
577
+ # Safety net if the target fills up after the early check (e.g. during
578
+ # a long interactive session).
579
+ console.print(f"[red]{err}[/red]")
580
+ raise typer.Exit(1) from err
581
+ console.print(f"[green]Created[/green] {target_directory}")
562
582
 
563
583
 
564
584
  @cache_app.command("dir")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: create-awesome-python-app
3
- Version: 0.2.9
3
+ Version: 0.2.10
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
@@ -8,7 +8,7 @@ Project-URL: Issues, https://github.com/Create-Python-App/create-python-app/issu
8
8
  Project-URL: Changelog, https://github.com/Create-Python-App/create-python-app/blob/main/CHANGELOG.md
9
9
  License-Expression: MIT
10
10
  Requires-Python: >=3.12
11
- Requires-Dist: create-python-app-core>=0.2.6
11
+ Requires-Dist: create-python-app-core>=0.2.10
12
12
  Requires-Dist: questionary>=2.1.1
13
13
  Requires-Dist: rich>=15.0.0
14
14
  Requires-Dist: typer>=0.27.0
@@ -0,0 +1,9 @@
1
+ create_awesome_python_app/__init__.py,sha256=bi_KnqAleIdsMEwUjb0fOKqFtc6xP93QD5OPMGuYTtk,61
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=sEGWsw1gz1ayQcv2p0VNl2NKZeZJvU_WdSkv8tVyqaY,29229
5
+ create_awesome_python_app/prompt_style.py,sha256=pERX1qPQSLZXeJvPVFC7z85dvte73ZV4iuENPQduheE,3463
6
+ create_awesome_python_app-0.2.10.dist-info/METADATA,sha256=3FZrfWHw86Qrqb0IdSzoE4tMdaIlTbgzJUm4pi5Ksns,23273
7
+ create_awesome_python_app-0.2.10.dist-info/WHEEL,sha256=lCkmxWfQsSc9CfIClYeavTdQeEX2toPqufh9gI35EQA,87
8
+ create_awesome_python_app-0.2.10.dist-info/entry_points.txt,sha256=rszFbUjY-lvMDZ96zX1lALJwgD1mI3CkUuNyF2qqjYo,81
9
+ create_awesome_python_app-0.2.10.dist-info/RECORD,,
@@ -1,9 +0,0 @@
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,,