lib-cli-exit-tools 1.0.3__tar.gz → 1.1.1__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 (63) hide show
  1. lib_cli_exit_tools-1.1.1/AGENTS.md +230 -0
  2. {lib_cli_exit_tools-1.0.3 → lib_cli_exit_tools-1.1.1}/CHANGELOG.md +8 -0
  3. lib_cli_exit_tools-1.0.3/README.md → lib_cli_exit_tools-1.1.1/DEVELOPMENT.md +15 -176
  4. lib_cli_exit_tools-1.1.1/PKG-INFO +337 -0
  5. lib_cli_exit_tools-1.1.1/README.md +306 -0
  6. lib_cli_exit_tools-1.1.1/docs/system-design/reference.md +334 -0
  7. {lib_cli_exit_tools-1.0.3 → lib_cli_exit_tools-1.1.1}/packaging/brew/Formula/lib-cli-exit-tools.rb +1 -1
  8. {lib_cli_exit_tools-1.0.3 → lib_cli_exit_tools-1.1.1}/packaging/conda/recipe/meta.yaml +1 -1
  9. {lib_cli_exit_tools-1.0.3 → lib_cli_exit_tools-1.1.1}/packaging/nix/flake.nix +2 -2
  10. {lib_cli_exit_tools-1.0.3 → lib_cli_exit_tools-1.1.1}/pyproject.toml +2 -1
  11. lib_cli_exit_tools-1.1.1/scripts/_utils.py +255 -0
  12. {lib_cli_exit_tools-1.0.3 → lib_cli_exit_tools-1.1.1}/scripts/build.py +12 -4
  13. {lib_cli_exit_tools-1.0.3 → lib_cli_exit_tools-1.1.1}/scripts/bump_version.py +38 -29
  14. {lib_cli_exit_tools-1.0.3 → lib_cli_exit_tools-1.1.1}/scripts/menu.py +17 -2
  15. lib_cli_exit_tools-1.1.1/scripts/push.py +59 -0
  16. lib_cli_exit_tools-1.1.1/scripts/run_cli.py +26 -0
  17. lib_cli_exit_tools-1.1.1/scripts/test.py +289 -0
  18. lib_cli_exit_tools-1.1.1/src/lib_cli_exit_tools/__init__.py +46 -0
  19. lib_cli_exit_tools-1.1.1/src/lib_cli_exit_tools/__init__conf__.py +230 -0
  20. lib_cli_exit_tools-1.1.1/src/lib_cli_exit_tools/__main__.py +11 -0
  21. lib_cli_exit_tools-1.1.1/src/lib_cli_exit_tools/cli.py +109 -0
  22. lib_cli_exit_tools-1.1.1/src/lib_cli_exit_tools/lib_cli_exit_tools.py +685 -0
  23. lib_cli_exit_tools-1.1.1/tests/test_cli.py +85 -0
  24. lib_cli_exit_tools-1.1.1/tests/test_cli_extra.py +32 -0
  25. lib_cli_exit_tools-1.1.1/tests/test_extend_cli.py +111 -0
  26. lib_cli_exit_tools-1.0.3/AGENTS.md +0 -96
  27. lib_cli_exit_tools-1.0.3/PKG-INFO +0 -332
  28. lib_cli_exit_tools-1.0.3/scripts/_utils.py +0 -125
  29. lib_cli_exit_tools-1.0.3/scripts/push.py +0 -33
  30. lib_cli_exit_tools-1.0.3/scripts/run_cli.py +0 -17
  31. lib_cli_exit_tools-1.0.3/scripts/test.py +0 -96
  32. lib_cli_exit_tools-1.0.3/src/lib_cli_exit_tools/__init__.py +0 -15
  33. lib_cli_exit_tools-1.0.3/src/lib_cli_exit_tools/__init__conf__.py +0 -108
  34. lib_cli_exit_tools-1.0.3/src/lib_cli_exit_tools/__main__.py +0 -4
  35. lib_cli_exit_tools-1.0.3/src/lib_cli_exit_tools/cli.py +0 -138
  36. lib_cli_exit_tools-1.0.3/src/lib_cli_exit_tools/lib_cli_exit_tools.py +0 -353
  37. lib_cli_exit_tools-1.0.3/tests/test_cli.py +0 -49
  38. lib_cli_exit_tools-1.0.3/tests/test_cli_extra.py +0 -54
  39. {lib_cli_exit_tools-1.0.3 → lib_cli_exit_tools-1.1.1}/.env.example +0 -0
  40. {lib_cli_exit_tools-1.0.3 → lib_cli_exit_tools-1.1.1}/.github/workflows/ci.yml +0 -0
  41. {lib_cli_exit_tools-1.0.3 → lib_cli_exit_tools-1.1.1}/.github/workflows/codeql.yml +0 -0
  42. {lib_cli_exit_tools-1.0.3 → lib_cli_exit_tools-1.1.1}/.github/workflows/release.yml +0 -0
  43. {lib_cli_exit_tools-1.0.3 → lib_cli_exit_tools-1.1.1}/.gitignore +0 -0
  44. {lib_cli_exit_tools-1.0.3 → lib_cli_exit_tools-1.1.1}/CONTRIBUTING.md +0 -0
  45. {lib_cli_exit_tools-1.0.3 → lib_cli_exit_tools-1.1.1}/LICENSE +0 -0
  46. {lib_cli_exit_tools-1.0.3 → lib_cli_exit_tools-1.1.1}/Makefile +0 -0
  47. {lib_cli_exit_tools-1.0.3 → lib_cli_exit_tools-1.1.1}/codecov.yml +0 -0
  48. {lib_cli_exit_tools-1.0.3 → lib_cli_exit_tools-1.1.1}/notebooks/Quickstart.ipynb +0 -0
  49. {lib_cli_exit_tools-1.0.3 → lib_cli_exit_tools-1.1.1}/packaging/README.md +0 -0
  50. {lib_cli_exit_tools-1.0.3 → lib_cli_exit_tools-1.1.1}/qlty.toml +0 -0
  51. {lib_cli_exit_tools-1.0.3 → lib_cli_exit_tools-1.1.1}/scripts/__init__.py +0 -0
  52. {lib_cli_exit_tools-1.0.3 → lib_cli_exit_tools-1.1.1}/scripts/bump.py +0 -0
  53. {lib_cli_exit_tools-1.0.3 → lib_cli_exit_tools-1.1.1}/scripts/bump_major.py +0 -0
  54. {lib_cli_exit_tools-1.0.3 → lib_cli_exit_tools-1.1.1}/scripts/bump_minor.py +0 -0
  55. {lib_cli_exit_tools-1.0.3 → lib_cli_exit_tools-1.1.1}/scripts/bump_patch.py +0 -0
  56. {lib_cli_exit_tools-1.0.3 → lib_cli_exit_tools-1.1.1}/scripts/clean.py +0 -0
  57. {lib_cli_exit_tools-1.0.3 → lib_cli_exit_tools-1.1.1}/scripts/dev.py +0 -0
  58. {lib_cli_exit_tools-1.0.3 → lib_cli_exit_tools-1.1.1}/scripts/install.py +0 -0
  59. {lib_cli_exit_tools-1.0.3 → lib_cli_exit_tools-1.1.1}/scripts/release.py +0 -0
  60. {lib_cli_exit_tools-1.0.3 → lib_cli_exit_tools-1.1.1}/scripts/version_current.py +0 -0
  61. {lib_cli_exit_tools-1.0.3 → lib_cli_exit_tools-1.1.1}/src/lib_cli_exit_tools/py.typed +0 -0
  62. {lib_cli_exit_tools-1.0.3 → lib_cli_exit_tools-1.1.1}/tests/test_exit_tools.py +0 -0
  63. {lib_cli_exit_tools-1.0.3 → lib_cli_exit_tools-1.1.1}/tests/test_lib_extra.py +0 -0
@@ -0,0 +1,230 @@
1
+ # Repository Guidelines
2
+
3
+ ## On session start
4
+
5
+ - Connect to the `systemprompts` MCP filesystem.
6
+ - Read following files and keep their guidance in working memory:
7
+ - core_programming_solid.md
8
+ - bash_clean_architecture.md
9
+ - bash_clean_code.md
10
+ - bash_small_functions.md
11
+ - python_solid_architecture_enforcer.md
12
+ - python_clean_architecture.md/media/srv-main-softdev/projects/libs/bitranox_template_py_cli
13
+ - python_clean_code.md
14
+ - python_small_functions_style.md
15
+ - python_libraries_to_use.md
16
+ - python_structure_template.md
17
+ - self_documenting.md
18
+
19
+
20
+ always apply those Rules :
21
+
22
+ - core_programming_solid.md
23
+
24
+ when writing or refracturing Bash scripts, apply those Rules :
25
+
26
+ - core_programming_solid.md
27
+ - bash_clean_architecture.md
28
+ - bash_clean_code.md
29
+ - bash_small_functions.md
30
+
31
+ when writing or refracturing Python scripts, apply those Rules :
32
+ - core_programming_solid.md
33
+ - python_solid_architecture_enforcer.md
34
+ - python_clean_architecture.md
35
+ - python_clean_code.md
36
+ - python_small_functions_style.md
37
+ - python_libraries_to_use.md
38
+ - python_lib_structure_template.md
39
+
40
+
41
+ ## Project Structure & Module Organization
42
+
43
+ - `src/lib_cli_exit_tools/`: Python package.
44
+ - `scripts/`: shared automation (build/test/release) reused from scaffold.
45
+ - `packaging/`: Conda, Homebrew, and Nix specs kept in sync via scripts.
46
+ - `tests/`: placeholder suite skipping until logging features exist.
47
+
48
+
49
+ ## Build, Test, and Development Commands
50
+
51
+ - `make help` — list all targets with one‑line docs.
52
+ - `make test` — run ruff (lint + format check), pyright, pytest with coverage (enabled by default), and upload to Codecov (if configured via `.env`).
53
+ - Auto‑bootstrap: `make test` installs dev tools (`pip install -e .[dev]`) if linters/test deps are missing. Use `SKIP_BOOTSTRAP=1 make test` to disable.
54
+ - Coverage control: `COVERAGE=on|auto|off` (default `on` locally). Uses a unique `COVERAGE_FILE` each run to avoid DB locks.
55
+ - Before uploading to Codecov the harness creates an allow-empty commit (`test: auto commit before Codecov upload`) so the report attaches to a revision. Reset or amend if you do not want to keep it.
56
+ - `make build` — build Python wheel/sdist and attempt Conda/Homebrew/Nix builds (auto‑installs missing tools when needed).
57
+ - `make push` — runs the full `scripts/test.py` flow, prompts for/accepts a commit message (or `COMMIT_MESSAGE`), creates an allow-empty commit if needed, then pushes to the selected remote.
58
+ - `make clean` — remove caches, coverage, and build artifacts (includes `dist/` and `build/`).
59
+
60
+ ### Versioning & Releases
61
+
62
+ - Single source of truth for the package version is `pyproject.toml` (`[project].version`).
63
+ - Runtime code reads metadata via `importlib.metadata`; do not duplicate the version in code files.
64
+ - On a version bump, update only `pyproject.toml` and the `CHANGELOG.md` entry; do not edit `src/lib_cli_exit_tools/__init__conf__.py` for versioning.
65
+ - Tag releases `vX.Y.Z` and push tags; CI will build artifacts and publish when configured.
66
+
67
+ ### Common Make Targets (Alphabetical)
68
+
69
+
70
+ | Target | One-line description |
71
+ |-------------------|--------------------------------------------------------------------------------|
72
+ | `build` | Build wheel/sdist and attempt Conda/Brew/Nix builds (auto-installs tools). |
73
+ | `bump` | Bump version (VERSION=X.Y.Z or PART=major\|minor\|patch) and update changelog. |
74
+ | `bump-major` | Increment major version ((X+1).0.0). |
75
+ | `bump-minor` | Increment minor version (X.Y.Z → X.(Y+1).0). |
76
+ | `bump-patch` | Increment patch version (X.Y.Z → X.Y.(Z+1)). |
77
+ | `clean` | Remove caches, coverage, and build artifacts (includes `dist/` and `build/`). |
78
+ | `dev` | Install package with dev extras. |
79
+ | `help` | Show this table. |
80
+ | `install` | Editable install. |
81
+ | `menu` | Interactive TUI menu (make menu). |
82
+ | `push` | Commit changes once and push to GitHub (no CI monitoring). |
83
+ | `release` | Tag vX.Y.Z, push, sync packaging, run gh release if available. |
84
+ | `run` | Run module entry (`python -m ... --help`). |
85
+ | `test` | Lint, format, type-check, run tests with coverage, upload to Codecov. |
86
+ | `version-current` | Print current version from `pyproject.toml`. |
87
+
88
+
89
+ ## Coding Style & Naming Conventions
90
+
91
+ ## Testing Guidelines
92
+
93
+ - Unit and integration-style tests live under `tests/`; keep them up to date when adding features.
94
+ - Extend coverage for new CLI or library behaviour (the suite exercises CLI commands, package metadata, and automation scripts).
95
+ - When adding functionality, replace or remove placeholders and ensure `make test` remains green.
96
+ - write good doctests which clearly show how the function works and what are the intensions. Use it as an enhancement of the inline documentation
97
+
98
+ ## Commit & Pull Request Guidelines
99
+
100
+ ## Architecture Overview
101
+ - apply python_clean_architecture.md
102
+
103
+ ## Security & Configuration Tips
104
+ - `.env` is only for local tooling (CodeCov tokens, etc.); do not commit secrets.
105
+ - Rich logging should sanitize payloads before rendering once implemented.
106
+
107
+ ## Translations (Docs)
108
+
109
+ ## Translations (App UI Strings)
110
+
111
+ ## Changes in WEB Documentation
112
+
113
+ - when asked to update documentation - only do that in the english docs under /website/docs because other languages will be translated automatically,
114
+ unless stated otherwise by the user. In doubt - ask the user
115
+
116
+ ## Changes in APP Strings
117
+
118
+ - when i18 strings are changed, only to that in sources/\_locales/en because other languages will be translated automatically,
119
+ unless stated otherwise by the user. In doubt - ask the user
120
+
121
+ ## commit/push/GitHub policy
122
+
123
+ - run "make test" before any push to avoid lint/test breakage.
124
+ - after push, monitor errors in the github actions and try to correct the errors
125
+
126
+ ## Jupyter Notebooks
127
+ use at least nbformat >=4.5
128
+ - "nbformat": 4,
129
+ - "nbformat_minor": 5
130
+
131
+ ---
132
+
133
+ # 📘 Documentation Review & Enhancement Prompt
134
+
135
+ You are a **senior software developer specializing in code documentation and system design clarity**. Your task is to review, correct, and enhance all documentation (external and inline) across the codebase with the following principles and workflow.
136
+
137
+ ---
138
+
139
+ ## **Principles**
140
+
141
+ * Documentation should emphasize **WHY** and **WHAT**, not just **HOW**.
142
+ * All docs must align with the system’s design-level documentation in `docs/systemdesign/*`.
143
+ * Every module, function, dataclass, and constant should be documented with clear intent, expected use, and system relevance.
144
+ * Documentation must be **authoritative, consistent, and actionable** for developers, maintainers, and system designers.
145
+
146
+ ---
147
+
148
+ ## **Workflow Checklist**
149
+
150
+ ### **Step 1 – System Alignment**
151
+
152
+ * [ ] For every feature, function, configuration, dataclass, and constant:
153
+
154
+ * [ ] Verify alignment with `docs/systemdesign/*`.
155
+ * [ ] Document it in `docs/systemdesign/module_reference.md` using the template in `systemprompts/self_documenting.md`.
156
+ * [ ] Ensure consistent terminology and style with system docs.
157
+
158
+ ---
159
+
160
+ ### **Step 2 – Module-Level Documentation**
161
+
162
+ * [ ] At the top of each module, create or update a **header block** that:
163
+
164
+ * [ ] States the **purpose and intention** of the module.
165
+ * [ ] Outlines its **contents** (functions, classes, constants).
166
+ * [ ] Explains how it connects to the **overall system design**.
167
+
168
+ ---
169
+
170
+ ### **Step 3 – Function Documentation**
171
+
172
+ For every function:
173
+
174
+ * [ ] Document **Why** it exists (its role in the system).
175
+ * [ ] Document **What** it does (conceptual description).
176
+ * [ ] Document **Inputs** (parameters, types, ranges, meaning).
177
+ * [ ] Document **Outputs** (return values, meaning, edge cases).
178
+ * [ ] Document **Side Effects** (state changes, I/O, mutations).
179
+ * [ ] Add or refine **doctests** that:
180
+
181
+ * [ ] Demonstrate common use cases.
182
+ * [ ] Cover edge cases.
183
+ * [ ] Illustrate not just mechanics but **intent**.
184
+
185
+ ---
186
+
187
+ ### **Step 4 – Dataclasses & Structures**
188
+
189
+ * [ ] For each dataclass:
190
+
191
+ * [ ] Document each field’s **expected value and type**.
192
+ * [ ] Explain **why the field exists**.
193
+ * [ ] Describe how it interacts with other parts of the system.
194
+
195
+ ---
196
+
197
+ ### **Step 5 – Constants & Magic Numbers**
198
+
199
+ * [ ] For each constant or magic number:
200
+
201
+ * [ ] Explain **what it represents**.
202
+ * [ ] Explain **why this value was chosen**.
203
+ * [ ] Reference relevant standards, business rules, or domain logic.
204
+ * [ ] Replace unexplained “magic numbers” with named constants if possible.
205
+
206
+ ---
207
+
208
+ ### **Step 6 – Corrections & Enhancements**
209
+
210
+ * [ ] Remove or rewrite **obsolete documentation**.
211
+ * [ ] Correct **inaccurate or unclear explanations**.
212
+ * [ ] Fill in **missing documentation**.
213
+ * [ ] Reframe overly technical notes to emphasize **intent and reasoning**.
214
+
215
+ ---
216
+
217
+ ## ✅ Definition of Done (DoD)
218
+
219
+ Documentation is considered **complete and high quality** when:
220
+
221
+ 1. **System Consistency**: Every documented element aligns with `docs/systemdesign/*` and is included in `docs/systemdesign/module_reference.md`.
222
+ 2. **Module Headers**: Each module has a clear header block with purpose, contents, and system role.
223
+ 3. **Function Docs**: Every function has complete, accurate, and intent-driven documentation, including doctests for clarity and correctness.
224
+ 4. **Dataclass Docs**: Every dataclass field is fully described with expected type, purpose, and relevance.
225
+ 5. **Constants**: Every constant or magic number has a clear explanation or has been replaced with a meaningful named constant.
226
+ 6. **Corrections**: All obsolete, unclear, or incorrect docs have been fixed.
227
+ 7. **Completeness**: No feature, function, configuration, dataclass, or constant is left undocumented.
228
+ 8. **Clarity**: Documentation emphasizes **WHY** and **WHAT**, making the codebase understandable without digging into implementation details.
229
+
230
+ ---
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.1.1] - 2025-09-18
4
+
5
+ - Documentation and doctest updates
6
+
7
+ ## [1.1.0] - 2025-09-16
8
+
9
+ - introduced lib_cli_exit_tools.run_cli helper to reduce boilerplate code. see cli.py as example
10
+
3
11
  ## [1.0.3] - 2025-09-16
4
12
 
5
13
  - added make menu
@@ -1,102 +1,8 @@
1
- # lib_cli_exit_tools
1
+ # Development Guide
2
2
 
3
- <!-- Badges -->
4
- [![CI](https://github.com/bitranox/lib_cli_exit_tools/actions/workflows/ci.yml/badge.svg)](https://github.com/bitranox/lib_cli_exit_tools/actions/workflows/ci.yml)
5
- [![CodeQL](https://github.com/bitranox/lib_cli_exit_tools/actions/workflows/codeql.yml/badge.svg)](https://github.com/bitranox/lib_cli_exit_tools/actions/workflows/codeql.yml)
6
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
7
- [![Jupyter](https://img.shields.io/badge/Jupyter-Launch-orange?logo=jupyter)](https://mybinder.org/v2/gh/bitranox/lib_cli_exit_tools/HEAD?labpath=notebooks%2FQuickstart.ipynb)
8
- [![PyPI](https://img.shields.io/pypi/v/lib_cli_exit_tools.svg)](https://pypi.org/project/lib_cli_exit_tools/)
9
- [![PyPI - Downloads](https://img.shields.io/pypi/dm/lib_cli_exit_tools.svg)](https://pypi.org/project/lib_cli_exit_tools/)
10
- [![Code Style: Ruff](https://img.shields.io/badge/Code%20Style-Ruff-46A3FF?logo=ruff&labelColor=000)](https://docs.astral.sh/ruff/)
11
- [![codecov](https://codecov.io/gh/bitranox/lib_cli_exit_tools/graph/badge.svg?token=z1D8JSjWEH)](https://codecov.io/gh/bitranox/lib_cli_exit_tools)
12
- [![Maintainability](https://qlty.sh/gh/bitranox/projects/lib_cli_exit_tools/maintainability.svg)](https://qlty.sh/gh/bitranox/projects/lib_cli_exit_tools)
13
- [![Known Vulnerabilities](https://snyk.io/test/github/bitranox/lib_cli_exit_tools/badge.svg)](https://snyk.io/test/github/bitranox/lib_cli_exit_tools)
3
+ This guide aggregates everything maintainers need for building, testing, and releasing `lib_cli_exit_tools`.
14
4
 
15
- Small helpers for robust CLI exit handling:
16
- - Portable signal handling (SIGINT, SIGTERM/SIGBREAK)
17
- - Consistent exception → exit code mapping
18
- - Concise error printing with optional traceback and subprocess stdout/stderr capture
19
-
20
- ## Install
21
-
22
- Pick one of the options below. All methods register the `lib_cli_exit_tools` and `cli-exit-tools` commands on your PATH.
23
-
24
- ### 1) Standard virtualenv (pip)
25
-
26
- ```bash
27
- python -m venv .venv
28
- source .venv/bin/activate # Windows: .venv\\Scripts\\activate
29
- pip install -e .[dev] # dev install
30
- # or for runtime only:
31
- pip install .
32
- ```
33
-
34
- ### 2) Per-user (no venv)
35
-
36
- ```bash
37
- pip install --user .
38
- ```
39
-
40
- Note: respects PEP 668; avoid on system Python if “externally managed”. Ensure `~/.local/bin` (POSIX) is on PATH.
41
-
42
- ### 3) pipx (isolated, recommended for end users)
43
-
44
- ```bash
45
- pipx install .
46
- pipx upgrade lib_cli_exit_tools
47
- # From Git tag/commit:
48
- pipx install "git+https://github.com/bitranox/lib_cli_exit_tools@v0.1.0"
49
- ```
50
-
51
- ### 4) uv (fast installer/runner)
52
-
53
- ```bash
54
- uv pip install -e .[dev]
55
- uv tool install .
56
- uvx lib_cli_exit_tools --help
57
- ```
58
-
59
- ### 5) From artifacts
60
-
61
- ```bash
62
- python -m build
63
- pip install dist/lib_cli_exit_tools-*.whl
64
- pip install dist/lib_cli_exit_tools-*.tar.gz # sdist
65
- ```
66
-
67
- ### 6) Poetry / PDM (project-managed envs)
68
-
69
- ```bash
70
- # Poetry
71
- poetry add lib_cli_exit_tools # as dependency
72
- poetry install # for local dev
73
-
74
- # PDM
75
- pdm add lib_cli_exit_tools
76
- pdm install
77
- ```
78
-
79
- ### 7) From Git via pip (CI-friendly)
80
-
81
- ```bash
82
- pip install "git+https://github.com/bitranox/lib_cli_exit_tools@v0.1.0#egg=lib_cli_exit_tools"
83
- ```
84
-
85
- ### 8) Conda/mamba (optional)
86
-
87
- ```bash
88
- mamba create -n cli-exit python=3.12 pip
89
- mamba activate cli-exit
90
- pip install .
91
- ```
92
-
93
- ### 9) System package managers (optional distribution)
94
-
95
- - Homebrew formula (macOS): `brew install lib_cli_exit_tools` (if published)
96
- - Nix: flake/package for reproducible installs
97
- - Deb/RPM via `fpm` for OS-native packages
98
-
99
- ### Make Targets
5
+ ## Make Targets
100
6
 
101
7
  | Target | Description |
102
8
  |-------------------|--------------------------------------------------------------------------------------------|
@@ -115,54 +21,43 @@ pip install .
115
21
  | `build` | Build wheel/sdist and attempt conda, brew, and nix builds (auto-installs tools if missing) |
116
22
  | `menu` | Interactive TUI to run targets and edit parameters (requires dev dep: textual) |
117
23
 
118
- #### Target Parameters (env vars)
24
+ ### Target Parameters (env vars)
119
25
 
120
26
  - Global
121
27
  - `PY` (default: `python3`) — Python interpreter used to run scripts
122
28
  - `PIP` (default: `pip`) — pip executable used by bootstrap/install
123
-
124
29
  - `install`
125
30
  - No specific parameters (respects `PY`, `PIP`).
126
-
127
31
  - `dev`
128
32
  - No specific parameters (respects `PY`, `PIP`).
129
-
130
33
  - `test`
131
34
  - `COVERAGE=on|auto|off` (default: `on`) — controls pytest coverage run and Codecov upload
132
35
  - `SKIP_BOOTSTRAP=1` — skip auto-install of dev tools if missing
133
36
  - `TEST_VERBOSE=1` — echo each command executed by the test harness
134
37
  - Also respects `CODECOV_TOKEN` when needed for uploads
135
-
136
38
  - `run`
137
39
  - No parameters via `make` (always shows `--help`). For custom args: `python scripts/run_cli.py -- <args>`.
138
-
139
40
  - `version-current`
140
41
  - No parameters
141
-
142
42
  - `bump`
143
43
  - `VERSION=X.Y.Z` — explicit target version
144
44
  - `PART=major|minor|patch` — semantic part to bump (default if `VERSION` not set: `patch`)
145
45
  - Examples:
146
46
  - `make bump VERSION=1.0.2`
147
47
  - `make bump PART=minor`
148
-
149
48
  - `bump-patch` / `bump-minor` / `bump-major`
150
49
  - No parameters; shorthand for `make bump PART=...`
151
-
152
50
  - `clean`
153
51
  - No parameters
154
-
155
52
  - `push`
156
53
  - `REMOTE=<name>` (default: `origin`) — git remote to push to
157
-
158
54
  - `build`
159
55
  - No parameters via `make`. Advanced: use the script directly, e.g. `python scripts/build.py --no-conda --no-nix`.
160
-
161
56
  - `release`
162
57
  - `REMOTE=<name>` (default: `origin`) — git remote to push to
163
58
  - Advanced (via script): `python scripts/release.py --retries 5 --retry-wait 3.0`
164
59
 
165
- ### Interactive Menu (Textual)
60
+ ## Interactive Menu (Textual)
166
61
 
167
62
  `make menu` launches a colorful terminal UI (powered by `textual`) to browse targets, edit parameters, and run them with live output.
168
63
 
@@ -178,7 +73,7 @@ Run the menu:
178
73
  make menu
179
74
  ```
180
75
 
181
- #### Target Details
76
+ ### Target Details
182
77
 
183
78
  - `test`: single entry point for local CI — runs ruff lint + format check, pyright, pytest (including doctests) with coverage (enabled by default), and uploads coverage to Codecov if configured (reads `.env`).
184
79
  - Auto‑bootstrap: `make test` will try to install dev tools (`pip install -e .[dev]`) if `ruff`/`pyright`/`pytest` are missing. Set `SKIP_BOOTSTRAP=1` to skip this behavior.
@@ -189,57 +84,7 @@ make menu
189
84
  - `pipx-*` and `uv-*`: isolated CLI installations for end users and fast developer tooling.
190
85
  - `which-cmd`/`verify-install`: quick diagnostics to ensure the command is on PATH.
191
86
 
192
- ## Usage
193
-
194
- Console script:
195
-
196
- ```bash
197
- # After install (pip/pipx/uv tool)
198
- lib_cli_exit_tools --help
199
- cli-exit-tools --help # alias
200
- lib_cli_exit_tools info
201
- ```
202
-
203
- Library:
204
-
205
- ```python
206
- import lib_cli_exit_tools
207
-
208
- lib_cli_exit_tools.config.traceback = False # show short messages
209
- try:
210
- raise FileNotFoundError("missing.txt")
211
- except Exception as e:
212
- code = lib_cli_exit_tools.get_system_exit_code(e) # 2 on POSIX
213
- lib_cli_exit_tools.print_exception_message() # prints: FileNotFoundError: missing.txt
214
- raise SystemExit(code)
215
- ```
216
-
217
- Command names registered on install
218
- - lib_cli_exit_tools (default)
219
- - cli-exit-tools (alias)
220
- - python -m lib_cli_exit_tools (module entry)
221
-
222
- If you installed with --user or in a venv, make sure the corresponding bin directory is on PATH:
223
- - Linux/macOS venv: .venv/bin
224
- - Linux/macOS user: ~/.local/bin
225
- - Windows venv: .venv\Scripts
226
- - Windows user: %APPDATA%\Python\PythonXY\Scripts
227
-
228
- ## Exit Codes
229
-
230
- - SIGINT → 130, SIGTERM → 143 (POSIX), SIGBREAK → 149 (Windows)
231
- - SystemExit(n) → n
232
- - Common exceptions map to POSIX/Windows codes (FileNotFoundError, PermissionError, ValueError, etc.)
233
-
234
- ### Broken pipe behavior
235
- - Default: exit 141 quietly (128+SIGPIPE), no noisy error output.
236
- - Configure: `config.broken_pipe_exit_code = 0` to treat as benign truncation, or `32` (EPIPE).
237
-
238
- ### Sysexits mode (optional)
239
- - Set `config.exit_code_style = "sysexits"` to map ValueError/TypeError → EX_USAGE(64),
240
- FileNotFoundError → EX_NOINPUT(66), PermissionError → EX_NOPERM(77), generic OSError → EX_IOERR(74).
241
-
242
- ## Development
87
+ ## Testing & Coverage
243
88
 
244
89
  ```bash
245
90
  make test # ruff + pyright + pytest + coverage (default ON)
@@ -248,15 +93,19 @@ COVERAGE=off make test # disable coverage locally
248
93
  COVERAGE=on make test # force coverage and generate coverage.xml/codecov.xml
249
94
  ```
250
95
 
251
- ### Packaging sync (Conda/Brew/Nix)
96
+ ### Local Codecov uploads
97
+
98
+ - `make test` (with coverage enabled) generates `coverage.xml` and `codecov.xml`, then attempts to upload via the Codecov CLI or the bash uploader.
99
+ - For private repos, set `CODECOV_TOKEN` (see `.env.example`) or export it in your shell.
100
+ - For public repos, a token is typically not required.
101
+
102
+ ## Packaging Sync (Conda/Brew/Nix)
252
103
 
253
104
  - `make test` and `make push` automatically align the packaging skeletons in `packaging/` with the current `pyproject.toml`:
254
105
  - Conda: updates `{% set version = "X.Y.Z" %}` and both `python >=X.Y` constraints to match `requires-python`.
255
106
  - Homebrew: updates the source URL tag to `vX.Y.Z` and sets `depends_on "python@X.Y"` to match `requires-python`.
256
107
  - Nix: updates the package `version`, example `rev = "vX.Y.Z"`, and switches `pkgs.pythonXYZPackages` / `pkgs.pythonXYZ` to match the minimum Python version from `requires-python`.
257
-
258
108
  - To run just the sync without bumping versions: `python scripts/bump_version.py --sync-packaging`.
259
-
260
109
  - On release tags (`v*.*.*`), CI validates that packaging files are consistent with `pyproject.toml` and will fail if they drift.
261
110
 
262
111
  ## Versioning & Metadata
@@ -285,18 +134,8 @@ GitHub Actions workflows are included:
285
134
 
286
135
  To publish a release:
287
136
  1. Bump `pyproject.toml` version and update `CHANGELOG.md`.
288
- 2. Tag the commit (`git tag v0.1.1 && git push --tags`).
137
+ 2. Tag the commit (`git tag v1.1.0 && git push --tags`).
289
138
  3. Ensure `PYPI_API_TOKEN` secret is configured in the repo.
290
139
  4. Release workflow uploads wheel/sdist to PyPI.
291
140
 
292
141
  Conda/Homebrew/Nix: use files in `packaging/` to submit to their ecosystems. CI also attempts builds to validate recipes, but does not publish automatically.
293
-
294
- ### Local Codecov uploads
295
-
296
- - `make test` (with coverage enabled) generates `coverage.xml` and `codecov.xml`, then attempts to upload via the Codecov CLI or the bash uploader.
297
- - For private repos, set `CODECOV_TOKEN` (see `.env.example`) or export it in your shell.
298
- - For public repos, a token is typically not required.
299
-
300
- ## License
301
-
302
- MIT