keep-github-workflows-active 2.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.
Files changed (59) hide show
  1. keep_github_workflows_active-2.0.0/.devcontainer/devcontainer.json +22 -0
  2. keep_github_workflows_active-2.0.0/.devcontainer/settings.json +6 -0
  3. keep_github_workflows_active-2.0.0/.env.example +11 -0
  4. keep_github_workflows_active-2.0.0/.github/dependabot.yml +22 -0
  5. keep_github_workflows_active-2.0.0/.github/workflows/ci.yml +158 -0
  6. keep_github_workflows_active-2.0.0/.github/workflows/codeql.yml +39 -0
  7. keep_github_workflows_active-2.0.0/.github/workflows/release.yml +43 -0
  8. keep_github_workflows_active-2.0.0/.gitignore +180 -0
  9. keep_github_workflows_active-2.0.0/.qlty/qlty.toml +2 -0
  10. keep_github_workflows_active-2.0.0/.snyk +5 -0
  11. keep_github_workflows_active-2.0.0/AGENTS.md +207 -0
  12. keep_github_workflows_active-2.0.0/CHANGELOG.md +27 -0
  13. keep_github_workflows_active-2.0.0/CONTRIBUTING.md +48 -0
  14. keep_github_workflows_active-2.0.0/DEVELOPMENT.md +134 -0
  15. keep_github_workflows_active-2.0.0/INSTALL.md +75 -0
  16. keep_github_workflows_active-2.0.0/LICENSE +22 -0
  17. keep_github_workflows_active-2.0.0/Makefile +54 -0
  18. keep_github_workflows_active-2.0.0/PKG-INFO +192 -0
  19. keep_github_workflows_active-2.0.0/README.md +157 -0
  20. keep_github_workflows_active-2.0.0/codecov.yml +28 -0
  21. keep_github_workflows_active-2.0.0/concept.md +312 -0
  22. keep_github_workflows_active-2.0.0/docs/systemdesign/module_reference.md +273 -0
  23. keep_github_workflows_active-2.0.0/notebooks/Quickstart.ipynb +165 -0
  24. keep_github_workflows_active-2.0.0/pyproject.toml +105 -0
  25. keep_github_workflows_active-2.0.0/reset_git_history.sh +54 -0
  26. keep_github_workflows_active-2.0.0/scripts/__init__.py +3 -0
  27. keep_github_workflows_active-2.0.0/scripts/__main__.py +7 -0
  28. keep_github_workflows_active-2.0.0/scripts/_utils.py +581 -0
  29. keep_github_workflows_active-2.0.0/scripts/build.py +52 -0
  30. keep_github_workflows_active-2.0.0/scripts/bump.py +32 -0
  31. keep_github_workflows_active-2.0.0/scripts/bump_major.py +20 -0
  32. keep_github_workflows_active-2.0.0/scripts/bump_minor.py +20 -0
  33. keep_github_workflows_active-2.0.0/scripts/bump_patch.py +20 -0
  34. keep_github_workflows_active-2.0.0/scripts/bump_version.py +80 -0
  35. keep_github_workflows_active-2.0.0/scripts/clean.py +48 -0
  36. keep_github_workflows_active-2.0.0/scripts/cli.py +213 -0
  37. keep_github_workflows_active-2.0.0/scripts/dev.py +19 -0
  38. keep_github_workflows_active-2.0.0/scripts/help.py +41 -0
  39. keep_github_workflows_active-2.0.0/scripts/install.py +19 -0
  40. keep_github_workflows_active-2.0.0/scripts/menu.py +568 -0
  41. keep_github_workflows_active-2.0.0/scripts/push.py +77 -0
  42. keep_github_workflows_active-2.0.0/scripts/release.py +90 -0
  43. keep_github_workflows_active-2.0.0/scripts/run_cli.py +154 -0
  44. keep_github_workflows_active-2.0.0/scripts/target_metadata.py +174 -0
  45. keep_github_workflows_active-2.0.0/scripts/test.py +535 -0
  46. keep_github_workflows_active-2.0.0/scripts/version_current.py +20 -0
  47. keep_github_workflows_active-2.0.0/src/keep_github_workflows_active/__init__.py +19 -0
  48. keep_github_workflows_active-2.0.0/src/keep_github_workflows_active/__init__conf__.py +67 -0
  49. keep_github_workflows_active-2.0.0/src/keep_github_workflows_active/__main__.py +114 -0
  50. keep_github_workflows_active-2.0.0/src/keep_github_workflows_active/behaviors.py +145 -0
  51. keep_github_workflows_active-2.0.0/src/keep_github_workflows_active/cli.py +584 -0
  52. keep_github_workflows_active-2.0.0/src/keep_github_workflows_active/keep_github_workflow_active.py +516 -0
  53. keep_github_workflows_active-2.0.0/src/keep_github_workflows_active/py.typed +0 -0
  54. keep_github_workflows_active-2.0.0/tests/conftest.py +99 -0
  55. keep_github_workflows_active-2.0.0/tests/test_behaviors.py +61 -0
  56. keep_github_workflows_active-2.0.0/tests/test_cli.py +347 -0
  57. keep_github_workflows_active-2.0.0/tests/test_metadata.py +101 -0
  58. keep_github_workflows_active-2.0.0/tests/test_module_entry.py +164 -0
  59. keep_github_workflows_active-2.0.0/tests/test_scripts.py +266 -0
@@ -0,0 +1,22 @@
1
+ {
2
+ "image": "mcr.microsoft.com/devcontainers/python:3.13",
3
+
4
+ "postCreateCommand": "bash -lc '\nPY=/usr/local/bin/python;\n$PY -m pip install -U pip && \\\n$PY -m pip install ipykernel && \\\n$PY -m pip install -e . && \\\n# register kernel using this exact interpreter\n$PY -m ipykernel install --name=python3 --display-name=\"Python 3 (3.13)\" --user && \\\n# patch the notebook to point to the python3 kernelspec (VS Code will bind to /usr/local/bin/python)\n$PY - <<\"PY\"\nimport json, pathlib\np = pathlib.Path(\"notebooks/Quickstart.ipynb\")\nif p.exists():\n nb = json.loads(p.read_text(encoding=\"utf-8\"))\n md = nb.setdefault(\"metadata\", {})\n md[\"kernelspec\"] = {\n \"name\": \"python3\",\n \"display_name\": \"Python 3 (3.13)\",\n \"language\": \"python\"\n }\n md[\"language_info\"] = {\"name\": \"python\"}\n p.write_text(json.dumps(nb, ensure_ascii=False, indent=1), encoding=\"utf-8\")\n print(\"Pinned kernelspec to python3 in\", p)\nelse:\n print(\"Notebook not found:\", p)\nPY'\n",
5
+
6
+ "customizations": {
7
+ "vscode": {
8
+ "extensions": ["ms-toolsai.jupyter", "ms-python.python"],
9
+ "settings": {
10
+ "workbench.startupEditor": "none",
11
+ "jupyter.alwaysTrustNotebooks": true,
12
+ "jupyter.kernelPickerType": "OnlyRecommended",
13
+ "python.defaultInterpreterPath": "/usr/local/bin/python"
14
+ }
15
+ },
16
+ "codespaces": {
17
+ "openFiles": ["README.md"]
18
+ }
19
+ },
20
+
21
+ "postAttachCommand": "bash -lc 'if [ -f notebooks/Quickstart.ipynb ]; then code -r notebooks/Quickstart.ipynb; fi'"
22
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "python.defaultInterpreterPath": "/usr/local/bin/python3.13",
3
+ "jupyter.alwaysTrustNotebooks": true,
4
+ "jupyter.kernelPickerType": "OnlyRecommended",
5
+ "jupyter.askForKernelRestart": false
6
+ }
@@ -0,0 +1,11 @@
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
11
+ GITHUB_TOKEN=
@@ -0,0 +1,22 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "pip"
4
+ directory: "/"
5
+ schedule:
6
+ interval: "weekly"
7
+ allow:
8
+ - dependency-type: "direct"
9
+ labels:
10
+ - "dependencies"
11
+ commit-message:
12
+ prefix: "deps"
13
+ include: "scope"
14
+ - package-ecosystem: "github-actions"
15
+ directory: "/"
16
+ schedule:
17
+ interval: "weekly"
18
+ labels:
19
+ - "dependencies"
20
+ commit-message:
21
+ prefix: "deps"
22
+ include: "scope"
@@ -0,0 +1,158 @@
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]
17
+ # Test against the latest CPython 3.x release provided by Actions
18
+ python: ["3.x"]
19
+ steps:
20
+ - uses: actions/checkout@v5
21
+ - uses: actions/setup-python@v6
22
+ with:
23
+ python-version: ${{ matrix.python }}
24
+ - name: Extract project metadata
25
+ shell: python
26
+ run: |
27
+ import os
28
+ import tomllib
29
+ from pathlib import Path
30
+
31
+ data = tomllib.loads(Path('pyproject.toml').read_text('utf-8'))
32
+ project = data['project']['name']
33
+ module = project.replace('-', '_')
34
+ dash = project.replace('_', '-')
35
+ scripts = list(data['project'].get('scripts', {}).keys())
36
+ cli_bin = scripts[0] if scripts else dash
37
+
38
+ with open(os.environ['GITHUB_ENV'], 'a', encoding='utf-8') as env:
39
+ env.write(f"PROJECT_NAME={project}\n")
40
+ env.write(f"PACKAGE_MODULE={module}\n")
41
+ env.write(f"CLI_BIN={cli_bin}\n")
42
+ - name: Install journald prerequisites
43
+ if: runner.os == 'Linux'
44
+ shell: bash
45
+ run: |
46
+ sudo apt-get update
47
+ sudo apt-get install -y python3-systemd
48
+
49
+ - name: Upgrade pip
50
+ shell: bash
51
+ run: python -m pip install --upgrade pip
52
+
53
+ - name: Install dev deps
54
+ shell: bash
55
+ run: |
56
+ pip install -e .[dev]
57
+
58
+ - name: Run full test suite (lint, types, tests, coverage, codecov)
59
+ shell: bash
60
+ env:
61
+ TEST_VERBOSE: "1"
62
+ run: make test
63
+ - name: Build wheel/sdist
64
+ shell: bash
65
+ run: python -m build
66
+ - name: Verify wheel install in clean env
67
+ shell: bash
68
+ run: |
69
+ python -m venv .venv_wheel
70
+ . .venv_wheel/bin/activate 2>/dev/null || . .venv_wheel/Scripts/activate 2>/dev/null
71
+ pip install dist/*.whl
72
+ "$CLI_BIN" --version 2>/dev/null || python -m "$PACKAGE_MODULE" --version
73
+
74
+ pipx-uv:
75
+ name: pipx/uv verification (ubuntu)
76
+ runs-on: ubuntu-latest
77
+ steps:
78
+ - uses: actions/checkout@v5
79
+ - uses: actions/setup-python@v6
80
+ with:
81
+ python-version: "3.13"
82
+ - name: Extract project metadata
83
+ shell: python
84
+ run: |
85
+ import os
86
+ import tomllib
87
+ from pathlib import Path
88
+
89
+ data = tomllib.loads(Path('pyproject.toml').read_text('utf-8'))
90
+ project = data['project']['name']
91
+ module = project.replace('-', '_')
92
+ dash = project.replace('_', '-')
93
+ scripts = list(data['project'].get('scripts', {}).keys())
94
+ cli_bin = scripts[0] if scripts else dash
95
+
96
+ with open(os.environ['GITHUB_ENV'], 'a', encoding='utf-8') as env:
97
+ env.write(f"PROJECT_NAME={project}\n")
98
+ env.write(f"PACKAGE_MODULE={module}\n")
99
+ env.write(f"CLI_BIN={cli_bin}\n")
100
+ - name: Build wheel
101
+ run: |
102
+ python -m pip install --upgrade pip build
103
+ python -m build
104
+ - name: pipx install from wheel
105
+ run: |
106
+ python -m pip install pipx
107
+ pipx install dist/*.whl
108
+ "$CLI_BIN" --version 2>/dev/null || python -m "$PACKAGE_MODULE" --version
109
+ - name: Install uv
110
+ uses: astral-sh/setup-uv@v7
111
+ with:
112
+ enable-cache: true
113
+ - name: uv tool install
114
+ run: |
115
+ uv tool install .
116
+ "$CLI_BIN" --version 2>/dev/null || python -m "$PACKAGE_MODULE" --version
117
+
118
+ notebooks:
119
+ name: Execute notebooks (ubuntu, Python 3.13)
120
+ runs-on: ubuntu-latest
121
+ steps:
122
+ - uses: actions/checkout@v5
123
+ - uses: actions/setup-python@v6
124
+ with:
125
+ python-version: "3.13"
126
+ - name: Install notebook runner deps
127
+ run: |
128
+ python -m pip install --upgrade pip
129
+ pip install nbclient nbformat ipykernel jupyter_client
130
+ python -m ipykernel install --user --name python3 --display-name "Python 3"
131
+ - name: Execute Quickstart notebook
132
+ env:
133
+ PIP_DISABLE_PIP_VERSION_CHECK: "1"
134
+ PIP_NO_INPUT: "1"
135
+ run: |
136
+ python - << 'PY'
137
+ from pathlib import Path
138
+
139
+ import nbformat
140
+ from nbclient import NotebookClient
141
+
142
+ nb_path = Path('notebooks/Quickstart.ipynb')
143
+ if not nb_path.exists():
144
+ raise SystemExit(f"Notebook not found: {nb_path}")
145
+
146
+ notebook = nbformat.read(nb_path, as_version=4)
147
+ client = NotebookClient(
148
+ notebook,
149
+ timeout=900,
150
+ kernel_name='python3',
151
+ allow_errors=False,
152
+ )
153
+ client.execute()
154
+
155
+ out_path = Path('notebooks/Quickstart-executed.ipynb')
156
+ nbformat.write(notebook, out_path)
157
+ print(f"Executed notebook written to: {out_path}")
158
+ PY
@@ -0,0 +1,39 @@
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@v5
27
+
28
+ - name: Initialize CodeQL
29
+ uses: github/codeql-action/init@v4
30
+ with:
31
+ languages: ${{ matrix.language }}
32
+
33
+ - name: Autobuild
34
+ uses: github/codeql-action/autobuild@v4
35
+
36
+ - name: Perform CodeQL Analysis
37
+ uses: github/codeql-action/analyze@v4
38
+ with:
39
+ category: "/language:${{ matrix.language }}"
@@ -0,0 +1,43 @@
1
+ name: Release
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+ push:
7
+ tags:
8
+ - 'v*'
9
+ workflow_dispatch: {}
10
+
11
+ jobs:
12
+ build-and-publish:
13
+ runs-on: ubuntu-latest
14
+ permissions:
15
+ contents: read
16
+ steps:
17
+ - uses: actions/checkout@v5
18
+ - name: Verify PyPI token is set
19
+ run: |
20
+ if [ -z "${{ secrets.PYPI_API_TOKEN }}" ]; then
21
+ echo "::error title=Missing PyPI token::Set the PYPI_API_TOKEN secret in GitHub repository settings to enable PyPI publishing on releases."
22
+ echo "See: https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions"
23
+ exit 1
24
+ fi
25
+ - uses: actions/setup-python@v6
26
+ with:
27
+ python-version: '3.13'
28
+ - name: Build artifacts
29
+ run: |
30
+ python -m pip install --upgrade pip build
31
+ python -m build
32
+ - name: Publish to PyPI
33
+ # Use the rolling major tag to get latest Twine/standards support (e.g., Core Metadata 2.4)
34
+ uses: pypa/gh-action-pypi-publish@release/v1
35
+ with:
36
+ password: ${{ secrets.PYPI_API_TOKEN }}
37
+ attestations: false
38
+ skip-existing: true
39
+ - name: Upload artifacts
40
+ uses: actions/upload-artifact@v4
41
+ with:
42
+ name: dist
43
+ path: dist/*
@@ -0,0 +1,180 @@
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
+ .import_linter_cache/
68
+
69
+ # ====================================
70
+ # Build & distribution artifacts
71
+ # ====================================
72
+ # source/package builds
73
+ build/
74
+ dist/
75
+ *.egg-info/ # metadata for pip installs
76
+ *.egg
77
+ *.whl
78
+ pip-wheel-metadata/
79
+ *.manifest # PyInstaller metadata
80
+ *.spec # PyInstaller spec files
81
+
82
+ # Eggs, parts, wheels, sdist, etc.
83
+ develop-eggs/
84
+ .eggs/
85
+ parts/
86
+ sdist/
87
+ wheels/
88
+ downloads/
89
+ var/
90
+
91
+ # pip logs & installer leftovers
92
+ pip-log.txt
93
+ pip-delete-this-directory.txt
94
+ .installed.cfg
95
+
96
+ # ====================================
97
+ # Virtual environments & secrets
98
+ # ====================================
99
+ # common venv folder names
100
+ env/
101
+ venv/
102
+ ENV/
103
+ .venv/
104
+ # backups, alternate names
105
+ env.bak/
106
+ venv.bak/
107
+ # dotenv files with credentials
108
+ .env
109
+
110
+ # ====================================
111
+ # Project-specific & framework files
112
+ # ====================================
113
+ # Django logs & local overrides
114
+ *.log
115
+ local_settings.py
116
+
117
+ # Flask instance folder
118
+ instance/
119
+ .webassets-cache
120
+
121
+ # Scrapy cache
122
+ .scrapy
123
+
124
+ # Sphinx docs
125
+ docs/_build/
126
+
127
+ # PyBuilder output
128
+ target/
129
+
130
+ # Jupyter notebooks checkpoints
131
+ .ipynb_checkpoints
132
+
133
+ # pyenv Python version file
134
+ .python-version
135
+
136
+ # Celery beat schedule
137
+ celerybeat-schedule
138
+
139
+ # SageMath parsed files
140
+ *.sage.py
141
+
142
+ # Spyder IDE
143
+ .spyderproject
144
+ .spyproject
145
+
146
+ # Rope IDE
147
+ .ropeproject
148
+
149
+ # MkDocs static site folder
150
+ /site
151
+
152
+ # ====================================
153
+ # OS-specific files
154
+ # ====================================
155
+ # macOS
156
+ .DS_Store
157
+ # Windows
158
+ Thumbs.db
159
+ ehthumbs.db
160
+
161
+ # Archives
162
+ *.zip
163
+
164
+ # Thunderbird build artifact (created temporarily by pack script)
165
+ sources/manifest.json
166
+
167
+ # ====================================
168
+ # Tool-specific extras
169
+ # ====================================
170
+ # Codecov uploader script (downloaded during local uploads)
171
+ codecov.sh
172
+ codecov.xml
173
+
174
+ # Nix build result symlink
175
+ result
176
+
177
+ # Optional lockfiles (for alternative managers)
178
+ poetry.lock
179
+ pdm.lock
180
+ uv.lock
@@ -0,0 +1,2 @@
1
+ exclude_patterns = ["scripts/**"]
2
+ test_patterns = ["tests/**"]
@@ -0,0 +1,5 @@
1
+ # Snyk (https://snyk.io) policy file
2
+ exclude:
3
+ global:
4
+ - scripts/**
5
+ - tests/**