ask-shell 0.5.1__tar.gz → 0.5.2__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.
Files changed (28) hide show
  1. {ask_shell-0.5.1 → ask_shell-0.5.2}/PKG-INFO +1 -1
  2. {ask_shell-0.5.1 → ask_shell-0.5.2}/ask_shell/__init__.py +1 -1
  3. {ask_shell-0.5.1 → ask_shell-0.5.2}/ask_shell/_internal/rich_progress.py +12 -2
  4. {ask_shell-0.5.1 → ask_shell-0.5.2}/pyproject.toml +1 -1
  5. {ask_shell-0.5.1 → ask_shell-0.5.2}/.gitignore +0 -0
  6. {ask_shell-0.5.1 → ask_shell-0.5.2}/LICENSE +0 -0
  7. {ask_shell-0.5.1 → ask_shell-0.5.2}/README.md +0 -0
  8. {ask_shell-0.5.1 → ask_shell-0.5.2}/ask_shell/__main__.py +0 -0
  9. {ask_shell-0.5.1 → ask_shell-0.5.2}/ask_shell/_internal/__init__.py +0 -0
  10. {ask_shell-0.5.1 → ask_shell-0.5.2}/ask_shell/_internal/_run.py +0 -0
  11. {ask_shell-0.5.1 → ask_shell-0.5.2}/ask_shell/_internal/_run_env.py +0 -0
  12. {ask_shell-0.5.1 → ask_shell-0.5.2}/ask_shell/_internal/events.py +0 -0
  13. {ask_shell-0.5.1 → ask_shell-0.5.2}/ask_shell/_internal/global_callbacks.py +0 -0
  14. {ask_shell-0.5.1 → ask_shell-0.5.2}/ask_shell/_internal/interactive.py +0 -0
  15. {ask_shell-0.5.1 → ask_shell-0.5.2}/ask_shell/_internal/models.py +0 -0
  16. {ask_shell-0.5.1 → ask_shell-0.5.2}/ask_shell/_internal/rich_live.py +0 -0
  17. {ask_shell-0.5.1 → ask_shell-0.5.2}/ask_shell/_internal/rich_live_callback.py +0 -0
  18. {ask_shell-0.5.1 → ask_shell-0.5.2}/ask_shell/_internal/rich_run_state.py +0 -0
  19. {ask_shell-0.5.1 → ask_shell-0.5.2}/ask_shell/_internal/run_pool.py +0 -0
  20. {ask_shell-0.5.1 → ask_shell-0.5.2}/ask_shell/_internal/typer_command.py +0 -0
  21. {ask_shell-0.5.1 → ask_shell-0.5.2}/ask_shell/ask.py +0 -0
  22. {ask_shell-0.5.1 → ask_shell-0.5.2}/ask_shell/console.py +0 -0
  23. {ask_shell-0.5.1 → ask_shell-0.5.2}/ask_shell/py.typed +0 -0
  24. {ask_shell-0.5.1 → ask_shell-0.5.2}/ask_shell/settings.py +0 -0
  25. {ask_shell-0.5.1 → ask_shell-0.5.2}/ask_shell/shell.py +0 -0
  26. {ask_shell-0.5.1 → ask_shell-0.5.2}/ask_shell/shell_events.py +0 -0
  27. {ask_shell-0.5.1 → ask_shell-0.5.2}/ask_shell/test_docs.py +0 -0
  28. {ask_shell-0.5.1 → ask_shell-0.5.2}/scripts/fix_source_links.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ask-shell
3
- Version: 0.5.1
3
+ Version: 0.5.2
4
4
  Summary: CLIs with prompts, shell runs, and testable flows
5
5
  Author-email: EspenAlbert <espen.albert1@gmail.com>
6
6
  License-Expression: MIT
@@ -6,7 +6,7 @@ from ask_shell import shell_events
6
6
  from ask_shell import ask
7
7
  from ask_shell.settings import AskShellSettings
8
8
 
9
- VERSION = "0.5.1"
9
+ VERSION = "0.5.2"
10
10
  __all__ = [
11
11
  "shell",
12
12
  "console",
@@ -31,6 +31,15 @@ def transient_progress() -> Progress:
31
31
  )
32
32
 
33
33
 
34
+ def _is_clean_exit(exc: BaseException | None) -> bool:
35
+ if exc is None:
36
+ return True
37
+ if isinstance(exc, SystemExit) and exc.code in (None, 0):
38
+ return True
39
+ exit_code = getattr(exc, "exit_code", None)
40
+ return exit_code == 0
41
+
42
+
34
43
  def log_task_done(
35
44
  task: new_task,
36
45
  *,
@@ -206,5 +215,6 @@ class new_task:
206
215
  return self
207
216
 
208
217
  def __exit__(self, exc_type, exc_val, exc_tb):
209
- self.complete() # Ensure we mark it as complete
210
- self.manager.remove_task(self, error=exc_val)
218
+ self.complete()
219
+ error = exc_val if not _is_clean_exit(exc_val) else None
220
+ self.manager.remove_task(self, error=error)
@@ -2,7 +2,7 @@
2
2
 
3
3
  [project]
4
4
  name = "ask-shell"
5
- version = "0.5.1"
5
+ version = "0.5.2"
6
6
  description = "CLIs with prompts, shell runs, and testable flows"
7
7
  requires-python = ">=3.13"
8
8
  license = "MIT"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes