lib-cli-exit-tools 1.0.0__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.
- lib_cli_exit_tools-1.0.0/.env.example +18 -0
- lib_cli_exit_tools-1.0.0/.github/workflows/ci.yml +219 -0
- lib_cli_exit_tools-1.0.0/.github/workflows/codeql.yml +40 -0
- lib_cli_exit_tools-1.0.0/.github/workflows/release.yml +39 -0
- lib_cli_exit_tools-1.0.0/.gitignore +179 -0
- lib_cli_exit_tools-1.0.0/AGENTS.md +96 -0
- lib_cli_exit_tools-1.0.0/CHANGELOG.md +51 -0
- lib_cli_exit_tools-1.0.0/CONTRIBUTING.md +52 -0
- lib_cli_exit_tools-1.0.0/LICENSE +22 -0
- lib_cli_exit_tools-1.0.0/Makefile +237 -0
- lib_cli_exit_tools-1.0.0/PKG-INFO +267 -0
- lib_cli_exit_tools-1.0.0/README.md +238 -0
- lib_cli_exit_tools-1.0.0/codecov.yml +28 -0
- lib_cli_exit_tools-1.0.0/notebooks/Quickstart.ipynb +121 -0
- lib_cli_exit_tools-1.0.0/packaging/README.md +68 -0
- lib_cli_exit_tools-1.0.0/packaging/brew/Formula/lib-cli-exit-tools.rb +26 -0
- lib_cli_exit_tools-1.0.0/packaging/conda/recipe/meta.yaml +46 -0
- lib_cli_exit_tools-1.0.0/packaging/nix/flake.nix +76 -0
- lib_cli_exit_tools-1.0.0/pyproject.toml +80 -0
- lib_cli_exit_tools-1.0.0/src/lib_cli_exit_tools/__init__.py +15 -0
- lib_cli_exit_tools-1.0.0/src/lib_cli_exit_tools/__init__conf__.py +108 -0
- lib_cli_exit_tools-1.0.0/src/lib_cli_exit_tools/__main__.py +4 -0
- lib_cli_exit_tools-1.0.0/src/lib_cli_exit_tools/cli.py +138 -0
- lib_cli_exit_tools-1.0.0/src/lib_cli_exit_tools/lib_cli_exit_tools.py +353 -0
- lib_cli_exit_tools-1.0.0/src/lib_cli_exit_tools/py.typed +0 -0
- lib_cli_exit_tools-1.0.0/tests/test_cli.py +49 -0
- lib_cli_exit_tools-1.0.0/tests/test_cli_extra.py +54 -0
- lib_cli_exit_tools-1.0.0/tests/test_exit_tools.py +167 -0
- lib_cli_exit_tools-1.0.0/tests/test_lib_extra.py +76 -0
- lib_cli_exit_tools-1.0.0/tools/bump_version.py +438 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Copy to .env and fill values as needed.
|
|
2
|
+
|
|
3
|
+
# Codecov upload token (required for private repos; optional for public repos)
|
|
4
|
+
CODECOV_TOKEN=
|
|
5
|
+
|
|
6
|
+
# PyPI API token for release workflow (.github/workflows/release.yml)
|
|
7
|
+
# Format: pypi-AgENdGVzdC5weXBpLm9yZwIk...
|
|
8
|
+
PYPI_API_TOKEN=
|
|
9
|
+
|
|
10
|
+
# Optional: GitHub token for API-limited tasks (e.g., brew audits against GitHub API)
|
|
11
|
+
GITHUB_TOKEN=
|
|
12
|
+
|
|
13
|
+
# Optional: Anaconda/conda-forge token if you automate conda uploads (not included in CI)
|
|
14
|
+
ANACONDA_API_TOKEN=
|
|
15
|
+
|
|
16
|
+
# Optional: Homebrew resources may be fetched via GitHub; token can increase rate limits
|
|
17
|
+
HOMEBREW_GITHUB_API_TOKEN=
|
|
18
|
+
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ main, master ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ main, master ]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
name: Tests (Python ${{ matrix.python }}, ${{ matrix.os }})
|
|
12
|
+
runs-on: ${{ matrix.os }}
|
|
13
|
+
strategy:
|
|
14
|
+
fail-fast: false
|
|
15
|
+
matrix:
|
|
16
|
+
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
17
|
+
# Test against Python 3.10 and the latest 3.x available on Actions runners
|
|
18
|
+
python: ["3.10", "3.x"]
|
|
19
|
+
steps:
|
|
20
|
+
- uses: actions/checkout@v4
|
|
21
|
+
- uses: actions/setup-python@v5
|
|
22
|
+
with:
|
|
23
|
+
python-version: ${{ matrix.python }}
|
|
24
|
+
- name: Install make on Windows
|
|
25
|
+
if: runner.os == 'Windows'
|
|
26
|
+
shell: pwsh
|
|
27
|
+
run: |
|
|
28
|
+
choco install -y make
|
|
29
|
+
echo "C:\\ProgramData\\chocolatey\\bin" >> $env:GITHUB_PATH
|
|
30
|
+
- name: Install dev deps
|
|
31
|
+
shell: bash
|
|
32
|
+
run: |
|
|
33
|
+
python -m pip install --upgrade pip
|
|
34
|
+
pip install -e .[dev]
|
|
35
|
+
- name: Run full test suite (lint, types, tests, coverage, codecov)
|
|
36
|
+
shell: bash
|
|
37
|
+
run: make test
|
|
38
|
+
- name: Build wheel/sdist
|
|
39
|
+
shell: bash
|
|
40
|
+
run: python -m build
|
|
41
|
+
- name: Verify wheel install in clean env
|
|
42
|
+
shell: bash
|
|
43
|
+
run: |
|
|
44
|
+
python -m venv .venv_wheel
|
|
45
|
+
. .venv_wheel/bin/activate 2>/dev/null || . .venv_wheel/Scripts/activate 2>/dev/null
|
|
46
|
+
pip install dist/*.whl
|
|
47
|
+
lib_cli_exit_tools --version || python -m lib_cli_exit_tools --version
|
|
48
|
+
|
|
49
|
+
pipx-uv:
|
|
50
|
+
name: pipx/uv verification (ubuntu)
|
|
51
|
+
runs-on: ubuntu-latest
|
|
52
|
+
steps:
|
|
53
|
+
- uses: actions/checkout@v4
|
|
54
|
+
- uses: actions/setup-python@v5
|
|
55
|
+
with:
|
|
56
|
+
python-version: "3.12"
|
|
57
|
+
- name: Build wheel
|
|
58
|
+
run: |
|
|
59
|
+
python -m pip install --upgrade pip build
|
|
60
|
+
python -m build
|
|
61
|
+
- name: pipx install from wheel
|
|
62
|
+
run: |
|
|
63
|
+
python -m pip install pipx
|
|
64
|
+
pipx install dist/*.whl
|
|
65
|
+
lib_cli_exit_tools --version
|
|
66
|
+
- name: uv tool install
|
|
67
|
+
run: |
|
|
68
|
+
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
69
|
+
export PATH="$HOME/.local/bin:$HOME/.cargo/bin:$HOME/.local/share/uv/bin:$PATH"
|
|
70
|
+
uv tool install .
|
|
71
|
+
lib_cli_exit_tools --version
|
|
72
|
+
|
|
73
|
+
# nix and conda packaging builds are disabled for now to keep CI green.
|
|
74
|
+
nix:
|
|
75
|
+
name: Nix build (flake)
|
|
76
|
+
runs-on: ubuntu-latest
|
|
77
|
+
steps:
|
|
78
|
+
- uses: actions/checkout@v4
|
|
79
|
+
- name: Install Nix (flakes)
|
|
80
|
+
uses: cachix/install-nix-action@v27
|
|
81
|
+
with:
|
|
82
|
+
extra_nix_config: |
|
|
83
|
+
experimental-features = nix-command flakes
|
|
84
|
+
- name: Build with Nix flake
|
|
85
|
+
working-directory: packaging/nix
|
|
86
|
+
run: |
|
|
87
|
+
nix build .#default -L
|
|
88
|
+
echo "Built path: $(readlink -f result || true)"
|
|
89
|
+
|
|
90
|
+
conda:
|
|
91
|
+
name: Conda build
|
|
92
|
+
runs-on: ubuntu-latest
|
|
93
|
+
steps:
|
|
94
|
+
- uses: actions/checkout@v4
|
|
95
|
+
- name: Setup Miniconda
|
|
96
|
+
uses: conda-incubator/setup-miniconda@v3
|
|
97
|
+
with:
|
|
98
|
+
auto-update-conda: true
|
|
99
|
+
python-version: "3.12"
|
|
100
|
+
- name: Build conda recipe (local source, no test)
|
|
101
|
+
shell: bash -l {0}
|
|
102
|
+
env:
|
|
103
|
+
CONDA_USE_LOCAL: "1"
|
|
104
|
+
run: |
|
|
105
|
+
conda config --add channels conda-forge
|
|
106
|
+
conda config --add channels defaults
|
|
107
|
+
conda install -y conda-build
|
|
108
|
+
conda build packaging/conda/recipe --no-test -c conda-forge -c defaults
|
|
109
|
+
|
|
110
|
+
notebooks:
|
|
111
|
+
name: Execute notebooks (ubuntu, Python 3.10)
|
|
112
|
+
runs-on: ubuntu-latest
|
|
113
|
+
steps:
|
|
114
|
+
- uses: actions/checkout@v4
|
|
115
|
+
- uses: actions/setup-python@v5
|
|
116
|
+
with:
|
|
117
|
+
python-version: "3.10"
|
|
118
|
+
- name: Install notebook runner deps
|
|
119
|
+
run: |
|
|
120
|
+
python -m pip install --upgrade pip
|
|
121
|
+
pip install nbclient nbformat ipykernel jupyter_client
|
|
122
|
+
python -m ipykernel install --user --name python3 --display-name "Python 3"
|
|
123
|
+
- name: Execute Quickstart notebook
|
|
124
|
+
env:
|
|
125
|
+
PIP_DISABLE_PIP_VERSION_CHECK: "1"
|
|
126
|
+
PIP_NO_INPUT: "1"
|
|
127
|
+
run: |
|
|
128
|
+
python - << 'PY'
|
|
129
|
+
import json, sys
|
|
130
|
+
from pathlib import Path
|
|
131
|
+
import nbformat
|
|
132
|
+
try:
|
|
133
|
+
from nbformat.validator import normalize # type: ignore
|
|
134
|
+
except Exception:
|
|
135
|
+
normalize = None # type: ignore
|
|
136
|
+
from nbclient import NotebookClient
|
|
137
|
+
|
|
138
|
+
nb_path = Path('notebooks/Quickstart.ipynb')
|
|
139
|
+
if not nb_path.exists():
|
|
140
|
+
raise SystemExit(f"Notebook not found: {nb_path}")
|
|
141
|
+
|
|
142
|
+
with nb_path.open('r', encoding='utf-8') as f:
|
|
143
|
+
nb = nbformat.read(f, as_version=4)
|
|
144
|
+
# Normalize to ensure required fields like cell ids are present (supports older nbformat return types)
|
|
145
|
+
if normalize is not None:
|
|
146
|
+
nb_norm = normalize(nb) # may return notebook or a tuple
|
|
147
|
+
# pick the first element that looks like a notebook
|
|
148
|
+
cand = nb_norm
|
|
149
|
+
if isinstance(nb_norm, tuple):
|
|
150
|
+
for item in nb_norm:
|
|
151
|
+
if hasattr(item, 'cells') and hasattr(item, 'metadata'):
|
|
152
|
+
cand = item
|
|
153
|
+
break
|
|
154
|
+
nb = cand
|
|
155
|
+
# Final guard for robustness
|
|
156
|
+
if isinstance(nb, tuple) or not (hasattr(nb, 'cells') and hasattr(nb, 'metadata')):
|
|
157
|
+
raise SystemExit(f"Unexpected notebook object type after normalize: {type(nb)}")
|
|
158
|
+
|
|
159
|
+
client = NotebookClient(nb, timeout=900, kernel_name='python3', allow_errors=False)
|
|
160
|
+
client.execute()
|
|
161
|
+
|
|
162
|
+
# Optionally write executed notebook artifact (not committed)
|
|
163
|
+
out_path = Path('notebooks/Quickstart-executed.ipynb')
|
|
164
|
+
with out_path.open('w', encoding='utf-8') as f:
|
|
165
|
+
nbformat.write(nb, f)
|
|
166
|
+
print(f"Executed notebook written to: {out_path}")
|
|
167
|
+
PY
|
|
168
|
+
|
|
169
|
+
packaging-consistency:
|
|
170
|
+
name: Packaging files in sync
|
|
171
|
+
runs-on: ubuntu-latest
|
|
172
|
+
steps:
|
|
173
|
+
- uses: actions/checkout@v4
|
|
174
|
+
- uses: actions/setup-python@v5
|
|
175
|
+
with:
|
|
176
|
+
python-version: '3.x'
|
|
177
|
+
- name: Verify packaging matches pyproject
|
|
178
|
+
run: |
|
|
179
|
+
python - << 'PY'
|
|
180
|
+
import re, sys
|
|
181
|
+
from pathlib import Path
|
|
182
|
+
|
|
183
|
+
py = Path('pyproject.toml').read_text(encoding='utf-8')
|
|
184
|
+
m_ver = re.search(r'^version\s*=\s*"([^"]+)"', py, re.M)
|
|
185
|
+
m_req = re.search(r'^requires-python\s*=\s*"([^"]+)"', py, re.M)
|
|
186
|
+
if not (m_ver and m_req):
|
|
187
|
+
print('pyproject missing version or requires-python'); sys.exit(1)
|
|
188
|
+
version = m_ver.group(1)
|
|
189
|
+
requires = m_req.group(1)
|
|
190
|
+
m_min = re.search(r'>=\s*(3\.[0-9]+)', requires)
|
|
191
|
+
if not m_min:
|
|
192
|
+
print('requires-python must be like ">=3.X"'); sys.exit(1)
|
|
193
|
+
min_py = m_min.group(1)
|
|
194
|
+
min_digits = min_py.replace('.', '')
|
|
195
|
+
|
|
196
|
+
# Conda
|
|
197
|
+
conda = Path('packaging/conda/recipe/meta.yaml').read_text(encoding='utf-8')
|
|
198
|
+
if not re.search(r'\{\%\s*set\s+version\s*=\s*"' + re.escape(version) + r'"\s*\%\}', conda):
|
|
199
|
+
print('conda/meta.yaml: version mismatch'); sys.exit(1)
|
|
200
|
+
if len(re.findall(r'python\s*>?=\s*' + re.escape(min_py), conda)) < 2:
|
|
201
|
+
print('conda/meta.yaml: python constraint not aligned (host/run)'); sys.exit(1)
|
|
202
|
+
|
|
203
|
+
# Brew
|
|
204
|
+
brew = Path('packaging/brew/Formula/lib-cli-exit-tools.rb').read_text(encoding='utf-8')
|
|
205
|
+
if f"refs/tags/v{version}.tar.gz" not in brew:
|
|
206
|
+
print('brew formula: url tag mismatch'); sys.exit(1)
|
|
207
|
+
if f'"python@{min_py}"' not in brew:
|
|
208
|
+
print('brew formula: python dependency not aligned'); sys.exit(1)
|
|
209
|
+
|
|
210
|
+
# Nix
|
|
211
|
+
nix = Path('packaging/nix/flake.nix').read_text(encoding='utf-8')
|
|
212
|
+
if not re.search(r'pname\s*=\s*"lib_cli_exit_tools";\s*[^}]*?version\s*=\s*"' + re.escape(version) + r'";', nix, re.S):
|
|
213
|
+
print('nix flake: version mismatch'); sys.exit(1)
|
|
214
|
+
if not re.search(r'pypkgs\s*=\s*pkgs\.python' + re.escape(min_digits) + r'Packages', nix):
|
|
215
|
+
print('nix flake: python package set not aligned'); sys.exit(1)
|
|
216
|
+
if not re.search(r'pkgs\.python' + re.escape(min_digits) + r'\b', nix):
|
|
217
|
+
print('nix flake: devShell python not aligned'); sys.exit(1)
|
|
218
|
+
print('Packaging files are consistent with pyproject.')
|
|
219
|
+
PY
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
name: CodeQL
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ main, master ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ main, master ]
|
|
8
|
+
schedule:
|
|
9
|
+
- cron: '0 8 * * 1'
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
analyze:
|
|
13
|
+
name: CodeQL Analyze
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
permissions:
|
|
16
|
+
actions: read
|
|
17
|
+
contents: read
|
|
18
|
+
security-events: write
|
|
19
|
+
strategy:
|
|
20
|
+
fail-fast: false
|
|
21
|
+
matrix:
|
|
22
|
+
language: [ 'python' ]
|
|
23
|
+
|
|
24
|
+
steps:
|
|
25
|
+
- name: Checkout repository
|
|
26
|
+
uses: actions/checkout@v4
|
|
27
|
+
|
|
28
|
+
- name: Initialize CodeQL
|
|
29
|
+
uses: github/codeql-action/init@v3
|
|
30
|
+
with:
|
|
31
|
+
languages: ${{ matrix.language }}
|
|
32
|
+
|
|
33
|
+
- name: Autobuild
|
|
34
|
+
uses: github/codeql-action/autobuild@v3
|
|
35
|
+
|
|
36
|
+
- name: Perform CodeQL Analysis
|
|
37
|
+
uses: github/codeql-action/analyze@v3
|
|
38
|
+
with:
|
|
39
|
+
category: "/language:${{ matrix.language }}"
|
|
40
|
+
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
workflow_dispatch: {}
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
build-and-publish:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
permissions:
|
|
12
|
+
contents: read
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v4
|
|
15
|
+
- name: Verify PyPI token is set
|
|
16
|
+
run: |
|
|
17
|
+
if [ -z "${{ secrets.PYPI_API_TOKEN }}" ]; then
|
|
18
|
+
echo "::error title=Missing PyPI token::Set the PYPI_API_TOKEN secret in GitHub repository settings to enable PyPI publishing on releases."
|
|
19
|
+
echo "See: https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions"
|
|
20
|
+
exit 1
|
|
21
|
+
fi
|
|
22
|
+
- uses: actions/setup-python@v5
|
|
23
|
+
with:
|
|
24
|
+
python-version: '3.12'
|
|
25
|
+
- name: Build artifacts
|
|
26
|
+
run: |
|
|
27
|
+
python -m pip install --upgrade pip build
|
|
28
|
+
python -m build
|
|
29
|
+
- name: Publish to PyPI
|
|
30
|
+
# Use the rolling major tag to get latest Twine/standards support (e.g., Core Metadata 2.4)
|
|
31
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
32
|
+
with:
|
|
33
|
+
password: ${{ secrets.PYPI_API_TOKEN }}
|
|
34
|
+
skip-existing: true
|
|
35
|
+
- name: Upload artifacts
|
|
36
|
+
uses: actions/upload-artifact@v4
|
|
37
|
+
with:
|
|
38
|
+
name: dist
|
|
39
|
+
path: dist/*
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
# ====================================
|
|
2
|
+
# ROTEK SPEZIFISCH: Git commands you might run once
|
|
3
|
+
# git add .gitignore && git commit -m "Ignore IDE settings"
|
|
4
|
+
# git push
|
|
5
|
+
# git rm -r --cached .idea
|
|
6
|
+
# git commit -m "Remove .idea and add to .gitignore"
|
|
7
|
+
# git push
|
|
8
|
+
# alternative : BE CAREFUL: overwrites remote history
|
|
9
|
+
# git push origin master --force
|
|
10
|
+
|
|
11
|
+
# ====================================
|
|
12
|
+
# APP
|
|
13
|
+
# ====================================
|
|
14
|
+
website/build/
|
|
15
|
+
website/.docusaurus/
|
|
16
|
+
website/node_modules/
|
|
17
|
+
node_modules/
|
|
18
|
+
web-local-preview/
|
|
19
|
+
translation_app*.log
|
|
20
|
+
translation_web*.log
|
|
21
|
+
tmp_github_web_pages/
|
|
22
|
+
tmp_linkcheck_web_pages/
|
|
23
|
+
.eslintcache
|
|
24
|
+
.vitest/
|
|
25
|
+
npm-debug.log*
|
|
26
|
+
yarn-error.log*
|
|
27
|
+
pnpm-debug.log*
|
|
28
|
+
.env.*
|
|
29
|
+
!.env.example
|
|
30
|
+
todo.md
|
|
31
|
+
tmp_*
|
|
32
|
+
|
|
33
|
+
# ====================================
|
|
34
|
+
# IDEs & Editors
|
|
35
|
+
# ====================================
|
|
36
|
+
# IntelliJ, PyCharm, etc.
|
|
37
|
+
.idea/
|
|
38
|
+
# VS Code workspace settings
|
|
39
|
+
.vscode/
|
|
40
|
+
*.code-workspace
|
|
41
|
+
|
|
42
|
+
# ====================================
|
|
43
|
+
# Python bytecode & caches
|
|
44
|
+
# ====================================
|
|
45
|
+
# __pycache__: compiled .pyc files at any depth
|
|
46
|
+
# *.py[cod]: catches .pyc, .pyo, .pyd
|
|
47
|
+
__pycache__/
|
|
48
|
+
*.py[cod]
|
|
49
|
+
*$py.class # other compiled artifacts
|
|
50
|
+
|
|
51
|
+
# pytest, coverage, MyPy, Hypothesis
|
|
52
|
+
.pytest_cache/
|
|
53
|
+
.mypy_cache/
|
|
54
|
+
.pyright/
|
|
55
|
+
.coverage*
|
|
56
|
+
htmlcov/
|
|
57
|
+
nosetests.xml
|
|
58
|
+
coverage.xml
|
|
59
|
+
*.cover
|
|
60
|
+
.hypothesis/
|
|
61
|
+
.tox/
|
|
62
|
+
.nox/
|
|
63
|
+
|
|
64
|
+
# general cache directories (any project-level caching)
|
|
65
|
+
.cache/
|
|
66
|
+
.run/
|
|
67
|
+
|
|
68
|
+
# ====================================
|
|
69
|
+
# Build & distribution artifacts
|
|
70
|
+
# ====================================
|
|
71
|
+
# source/package builds
|
|
72
|
+
build/
|
|
73
|
+
dist/
|
|
74
|
+
*.egg-info/ # metadata for pip installs
|
|
75
|
+
*.egg
|
|
76
|
+
*.whl
|
|
77
|
+
pip-wheel-metadata/
|
|
78
|
+
*.manifest # PyInstaller metadata
|
|
79
|
+
*.spec # PyInstaller spec files
|
|
80
|
+
|
|
81
|
+
# Eggs, parts, wheels, sdist, etc.
|
|
82
|
+
develop-eggs/
|
|
83
|
+
.eggs/
|
|
84
|
+
parts/
|
|
85
|
+
sdist/
|
|
86
|
+
wheels/
|
|
87
|
+
downloads/
|
|
88
|
+
var/
|
|
89
|
+
|
|
90
|
+
# pip logs & installer leftovers
|
|
91
|
+
pip-log.txt
|
|
92
|
+
pip-delete-this-directory.txt
|
|
93
|
+
.installed.cfg
|
|
94
|
+
|
|
95
|
+
# ====================================
|
|
96
|
+
# Virtual environments & secrets
|
|
97
|
+
# ====================================
|
|
98
|
+
# common venv folder names
|
|
99
|
+
env/
|
|
100
|
+
venv/
|
|
101
|
+
ENV/
|
|
102
|
+
.venv/
|
|
103
|
+
# backups, alternate names
|
|
104
|
+
env.bak/
|
|
105
|
+
venv.bak/
|
|
106
|
+
# dotenv files with credentials
|
|
107
|
+
.env
|
|
108
|
+
|
|
109
|
+
# ====================================
|
|
110
|
+
# Project-specific & framework files
|
|
111
|
+
# ====================================
|
|
112
|
+
# Django logs & local overrides
|
|
113
|
+
*.log
|
|
114
|
+
local_settings.py
|
|
115
|
+
|
|
116
|
+
# Flask instance folder
|
|
117
|
+
instance/
|
|
118
|
+
.webassets-cache
|
|
119
|
+
|
|
120
|
+
# Scrapy cache
|
|
121
|
+
.scrapy
|
|
122
|
+
|
|
123
|
+
# Sphinx docs
|
|
124
|
+
docs/_build/
|
|
125
|
+
|
|
126
|
+
# PyBuilder output
|
|
127
|
+
target/
|
|
128
|
+
|
|
129
|
+
# Jupyter notebooks checkpoints
|
|
130
|
+
.ipynb_checkpoints
|
|
131
|
+
|
|
132
|
+
# pyenv Python version file
|
|
133
|
+
.python-version
|
|
134
|
+
|
|
135
|
+
# Celery beat schedule
|
|
136
|
+
celerybeat-schedule
|
|
137
|
+
|
|
138
|
+
# SageMath parsed files
|
|
139
|
+
*.sage.py
|
|
140
|
+
|
|
141
|
+
# Spyder IDE
|
|
142
|
+
.spyderproject
|
|
143
|
+
.spyproject
|
|
144
|
+
|
|
145
|
+
# Rope IDE
|
|
146
|
+
.ropeproject
|
|
147
|
+
|
|
148
|
+
# MkDocs static site folder
|
|
149
|
+
/site
|
|
150
|
+
|
|
151
|
+
# ====================================
|
|
152
|
+
# OS-specific files
|
|
153
|
+
# ====================================
|
|
154
|
+
# macOS
|
|
155
|
+
.DS_Store
|
|
156
|
+
# Windows
|
|
157
|
+
Thumbs.db
|
|
158
|
+
ehthumbs.db
|
|
159
|
+
|
|
160
|
+
# Archives
|
|
161
|
+
*.zip
|
|
162
|
+
|
|
163
|
+
# Thunderbird build artifact (created temporarily by pack script)
|
|
164
|
+
sources/manifest.json
|
|
165
|
+
|
|
166
|
+
# ====================================
|
|
167
|
+
# Tool-specific extras
|
|
168
|
+
# ====================================
|
|
169
|
+
# Codecov uploader script (downloaded during local uploads)
|
|
170
|
+
codecov.sh
|
|
171
|
+
codecov.xml
|
|
172
|
+
|
|
173
|
+
# Nix build result symlink
|
|
174
|
+
result
|
|
175
|
+
|
|
176
|
+
# Optional lockfiles (for alternative managers)
|
|
177
|
+
poetry.lock
|
|
178
|
+
pdm.lock
|
|
179
|
+
uv.lock
|
|
@@ -0,0 +1,96 @@
|
|
|
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
|
|
13
|
+
- python_clean_code.md
|
|
14
|
+
- python_small_functions_style.md
|
|
15
|
+
- python_libraries_to_use.md
|
|
16
|
+
- python_structure_template.md
|
|
17
|
+
|
|
18
|
+
always apply those Rules :
|
|
19
|
+
|
|
20
|
+
- core_programming_solid.md
|
|
21
|
+
|
|
22
|
+
when writing or refracturing Bash scripts, apply those Rules :
|
|
23
|
+
|
|
24
|
+
- core_programming_solid.md
|
|
25
|
+
- bash_clean_architecture.md
|
|
26
|
+
- bash_clean_code.md
|
|
27
|
+
- bash_small_functions.md
|
|
28
|
+
|
|
29
|
+
when writing or refracturing Python scripts, apply those Rules :
|
|
30
|
+
- core_programming_solid.md
|
|
31
|
+
- python_solid_architecture_enforcer.md
|
|
32
|
+
- python_clean_architecture.md
|
|
33
|
+
- python_clean_code.md
|
|
34
|
+
- python_small_functions_style.md
|
|
35
|
+
- python_libraries_to_use.md
|
|
36
|
+
- python_lib_structure_template.md
|
|
37
|
+
|
|
38
|
+
## Project Structure & Module Organization
|
|
39
|
+
|
|
40
|
+
## Build, Test, and Development Commands
|
|
41
|
+
|
|
42
|
+
- `make help` — list all targets with one‑line docs.
|
|
43
|
+
- `make test` — run ruff (lint + format check), pyright, pytest with coverage (enabled by default), and upload to Codecov (if configured via `.env`).
|
|
44
|
+
- 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.
|
|
45
|
+
- Coverage control: `COVERAGE=on|auto|off` (default `on` locally). Uses a unique `COVERAGE_FILE` each run to avoid DB locks.
|
|
46
|
+
- `make build` — build Python wheel/sdist and attempt Conda/Homebrew/Nix builds (auto‑installs missing tools when needed).
|
|
47
|
+
- `make clean` — remove caches, coverage, and build artifacts (includes `dist/` and `build/`).
|
|
48
|
+
|
|
49
|
+
### Versioning & Releases
|
|
50
|
+
|
|
51
|
+
- Single source of truth for the package version is `pyproject.toml` (`[project].version`).
|
|
52
|
+
- Runtime code reads metadata via `importlib.metadata`; do not duplicate the version in code files.
|
|
53
|
+
- 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.
|
|
54
|
+
- Tag releases `vX.Y.Z` and push tags; CI will build artifacts and publish when configured.
|
|
55
|
+
|
|
56
|
+
### Common Make Targets (Alphabetical)
|
|
57
|
+
|
|
58
|
+
| Target | One‑line description |
|
|
59
|
+
| --------- | -------------------- |
|
|
60
|
+
| `build` | Build wheel/sdist and attempt Conda/Brew/Nix builds (auto‑installs tools). |
|
|
61
|
+
| `clean` | Remove caches, coverage, and build artifacts (includes `dist/` and `build/`). |
|
|
62
|
+
| `dev` | Editable install with dev extras. |
|
|
63
|
+
| `help` | Show this table. |
|
|
64
|
+
| `install` | Editable install. |
|
|
65
|
+
| `push` | Commit changes once and push to GitHub (no CI monitoring). |
|
|
66
|
+
| `run` | Run module entry (`python -m ... --help`). |
|
|
67
|
+
| `test` | Lint, format, type‑check, tests with coverage, Codecov upload. |
|
|
68
|
+
|
|
69
|
+
## Coding Style & Naming Conventions
|
|
70
|
+
|
|
71
|
+
## Testing Guidelines
|
|
72
|
+
|
|
73
|
+
## Commit & Pull Request Guidelines
|
|
74
|
+
|
|
75
|
+
## Architecture Overview
|
|
76
|
+
|
|
77
|
+
## Security & Configuration Tips
|
|
78
|
+
|
|
79
|
+
## Translations (Docs)
|
|
80
|
+
|
|
81
|
+
## Translations (App UI Strings)
|
|
82
|
+
|
|
83
|
+
## Changes in WEB Documentation
|
|
84
|
+
|
|
85
|
+
- when asked to update documentation - only do that in the english docs under /website/docs because other languages will be translated automatically,
|
|
86
|
+
unless stated otherwise by the user. In doubt - ask the user
|
|
87
|
+
|
|
88
|
+
## Changes in APP Strings
|
|
89
|
+
|
|
90
|
+
- when i18 strings are changed, only to that in sources/\_locales/en because other languages will be translated automatically,
|
|
91
|
+
unless stated otherwise by the user. In doubt - ask the user
|
|
92
|
+
|
|
93
|
+
## commit/push/GitHub policy
|
|
94
|
+
|
|
95
|
+
- run "make test" before any push to avoid lint/test breakage.
|
|
96
|
+
- after push, monitor errors in the github actions and try to correct the errors
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [1.0.0] - 2025-09-15
|
|
4
|
+
|
|
5
|
+
- public release
|
|
6
|
+
|
|
7
|
+
## [Unreleased]
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
- CI job to execute Jupyter notebook on Python 3.10 (installs ipykernel, normalizes notebook IDs) and a tag‑time packaging‑consistency check.
|
|
11
|
+
- Packaging auto‑sync: `make test`, `make push`, and the bump script now align Conda/Brew/Nix files to `pyproject.toml` version, `requires-python`, and runtime deps. Homebrew resources are updated (URL + sha256) using PyPI metadata. A sync‑only mode is available via `python tools/bump_version.py --sync-packaging`.
|
|
12
|
+
- Tests covering SystemExit variants, tolerant output printing, English CLI messages, and Windows mapping via monkeypatched `os.name`.
|
|
13
|
+
|
|
14
|
+
### Changed
|
|
15
|
+
- Robust SystemExit handling in `get_system_exit_code` (handles `None`, strings, and non‑int codes safely). Behavior remains backwards‑compatible for common cases.
|
|
16
|
+
- OS mapping now uses `os.name == 'posix'` instead of `sys.builtin_module_names`.
|
|
17
|
+
- `_print_output` now accepts `bytes` or `str` for `stdout`/`stderr` and avoids assertions; decodes bytes with UTF‑8 and `errors='replace'`.
|
|
18
|
+
- CLI signal messages switched to English: “Aborted (SIGINT).”, “Terminated (SIGTERM/SIGBREAK).”, “Terminated (SIGBREAK).”.
|
|
19
|
+
- Metadata lookup in `__init__conf__` resolved once and reused.
|
|
20
|
+
- Coverage gate relaxed to 80% and removed `# pragma: no cover` comments.
|
|
21
|
+
- Quickstart notebook defaults to install from GitHub; added cell IDs; last cell prints exit code example instead of exiting.
|
|
22
|
+
|
|
23
|
+
### Fixed
|
|
24
|
+
- Pyright 3.10 compatibility in `__init__conf__` by typing to a minimal metadata protocol; resolved unknown `.get` errors.
|
|
25
|
+
- Ruff F401 false positive on notebook by adding a per‑file ignore in `pyproject.toml`.
|
|
26
|
+
|
|
27
|
+
### Docs
|
|
28
|
+
- README: documented packaging sync behavior and notebook usage.
|
|
29
|
+
- CONTRIBUTING: clarified versioning (bump only `pyproject.toml` + `CHANGELOG.md`), and documented packaging sync workflow.
|
|
30
|
+
|
|
31
|
+
## [0.1.1] - 2025-09-15
|
|
32
|
+
|
|
33
|
+
- _Describe changes here._
|
|
34
|
+
|
|
35
|
+
## [0.1.0] - 2025-09-14
|
|
36
|
+
|
|
37
|
+
- Unify package name to `lib_cli_exit_tools` (project name, module path, console scripts).
|
|
38
|
+
- Fix public API imports in `__init__.py`.
|
|
39
|
+
- Add `from __future__ import annotations` and module docstring.
|
|
40
|
+
- Add tests for exit code mapping and CLI behavior.
|
|
41
|
+
- Expand README and add Makefile; add dev extras (pytest/ruff/pyright).
|
|
42
|
+
|
|
43
|
+
## [0.0.1] - 2025-09-13
|
|
44
|
+
|
|
45
|
+
- Initial public release.
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
All notable changes to this project will be documented in this file.
|
|
50
|
+
The format is based on Keep a Changelog, and this project adheres to
|
|
51
|
+
Semantic Versioning (where applicable for add-on releases).
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Contributing Guide
|
|
2
|
+
|
|
3
|
+
Thanks for helping improve lib_cli_exit_tools! This guide keeps changes small, safe, and easy to review.
|
|
4
|
+
|
|
5
|
+
## 1) Workflow at a Glance
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
## 2) Branches & Commits
|
|
9
|
+
|
|
10
|
+
- Branch names:
|
|
11
|
+
- Commits: imperative, concise. Examples:
|
|
12
|
+
|
|
13
|
+
## 3) Coding Standards (Python)
|
|
14
|
+
|
|
15
|
+
- Follow the existing style; no sweeping refactors in unrelated code.
|
|
16
|
+
|
|
17
|
+
## 4) Build & Packaging
|
|
18
|
+
|
|
19
|
+
### Packaging Sync (Conda/Brew/Nix)
|
|
20
|
+
|
|
21
|
+
- Sync is automatic on common workflows:
|
|
22
|
+
- `make test` and `make push` run a sync step that aligns packaging files under `packaging/` with `pyproject.toml`.
|
|
23
|
+
- `make bump` also updates packaging files when bumping the version.
|
|
24
|
+
- What gets synced from `pyproject.toml`:
|
|
25
|
+
- Version and minimum Python (`requires-python`).
|
|
26
|
+
- Runtime dependencies (from `[project].dependencies`).
|
|
27
|
+
- Conda: rewrites `requirements: run` with `python >=X.Y` plus all deps (exact `==` pins kept; ranges copied as-is).
|
|
28
|
+
- Homebrew: ensures a `resource "<dep>"` for each dep; if pinned, uses that version; otherwise pins to the latest PyPI release, updating `url` + `sha256`.
|
|
29
|
+
- Nix: updates the package version, `pkgs.pythonXYZPackages`/`pkgs.pythonXYZ` to match the min Python, and `propagatedBuildInputs` to include all deps as `pypkgs.<name>`.
|
|
30
|
+
- Network note: Homebrew resource updates fetch PyPI metadata; if offline, those updates may be skipped.
|
|
31
|
+
- If packaging drifts, run: `python tools/bump_version.py --sync-packaging`.
|
|
32
|
+
- CI enforces consistency on tags via a `packaging-consistency` job.
|
|
33
|
+
|
|
34
|
+
## 5) Tests & Style
|
|
35
|
+
|
|
36
|
+
- Run all checks: `make test` (ruff + pyright + pytest with coverage)
|
|
37
|
+
- Keep diffs focused; no unrelated refactors.
|
|
38
|
+
|
|
39
|
+
## 6) Docs
|
|
40
|
+
|
|
41
|
+
Checklist:
|
|
42
|
+
|
|
43
|
+
- [ ] Tests updated and passing (`make test`).
|
|
44
|
+
- [ ] Docs updated
|
|
45
|
+
- [ ] No generated artifacts committed
|
|
46
|
+
- [ ] Version bump: update only `pyproject.toml` and `CHANGELOG.md` (do not edit `src/lib_cli_exit_tools/__init__conf__.py`; version is read from installed metadata). After bump, tag the commit `vX.Y.Z`.
|
|
47
|
+
|
|
48
|
+
## 8) Security & Configuration
|
|
49
|
+
|
|
50
|
+
- No secrets in code or logs. Keep dependencies minimal.
|
|
51
|
+
|
|
52
|
+
Happy hacking!
|