lib-detect-testenv 2.0.8__tar.gz → 3.0.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.
- lib_detect_testenv-3.0.1/.devcontainer/devcontainer.json +22 -0
- lib_detect_testenv-3.0.1/.devcontainer/settings.json +6 -0
- lib_detect_testenv-3.0.1/.env.example +11 -0
- lib_detect_testenv-3.0.1/.github/dependabot.yml +22 -0
- lib_detect_testenv-3.0.1/.github/workflows/ci.yml +200 -0
- lib_detect_testenv-3.0.1/.github/workflows/codeql.yml +39 -0
- lib_detect_testenv-3.0.1/.github/workflows/release.yml +50 -0
- lib_detect_testenv-3.0.1/.gitignore +181 -0
- lib_detect_testenv-3.0.1/.qlty/qlty.toml +2 -0
- lib_detect_testenv-3.0.1/.snyk +5 -0
- lib_detect_testenv-3.0.1/CHANGELOG.md +109 -0
- lib_detect_testenv-3.0.1/CLAUDE.md +176 -0
- lib_detect_testenv-3.0.1/CONTRIBUTING.md +48 -0
- lib_detect_testenv-3.0.1/DEVELOPMENT.md +134 -0
- lib_detect_testenv-3.0.1/INSTALL.md +193 -0
- {lib_detect_testenv-2.0.8 → lib_detect_testenv-3.0.1}/LICENSE +2 -1
- lib_detect_testenv-3.0.1/Makefile +60 -0
- lib_detect_testenv-3.0.1/PKG-INFO +418 -0
- lib_detect_testenv-3.0.1/README.md +375 -0
- lib_detect_testenv-3.0.1/codecov.yml +28 -0
- lib_detect_testenv-3.0.1/concept.md +312 -0
- lib_detect_testenv-3.0.1/docs/systemdesign/module_reference.md +484 -0
- lib_detect_testenv-3.0.1/notebooks/Quickstart.ipynb +165 -0
- lib_detect_testenv-3.0.1/pyproject.toml +160 -0
- lib_detect_testenv-3.0.1/reset_git_history.sh +54 -0
- lib_detect_testenv-3.0.1/scripts/__init__.py +3 -0
- lib_detect_testenv-3.0.1/scripts/__main__.py +7 -0
- lib_detect_testenv-3.0.1/scripts/_utils.py +768 -0
- lib_detect_testenv-3.0.1/scripts/build.py +52 -0
- lib_detect_testenv-3.0.1/scripts/bump.py +32 -0
- lib_detect_testenv-3.0.1/scripts/bump_major.py +20 -0
- lib_detect_testenv-3.0.1/scripts/bump_minor.py +20 -0
- lib_detect_testenv-3.0.1/scripts/bump_patch.py +20 -0
- lib_detect_testenv-3.0.1/scripts/bump_version.py +80 -0
- lib_detect_testenv-3.0.1/scripts/clean.py +75 -0
- lib_detect_testenv-3.0.1/scripts/cli.py +232 -0
- lib_detect_testenv-3.0.1/scripts/dependencies.py +590 -0
- lib_detect_testenv-3.0.1/scripts/dev.py +19 -0
- lib_detect_testenv-3.0.1/scripts/help.py +41 -0
- lib_detect_testenv-3.0.1/scripts/install.py +19 -0
- lib_detect_testenv-3.0.1/scripts/menu.py +582 -0
- lib_detect_testenv-3.0.1/scripts/push.py +309 -0
- lib_detect_testenv-3.0.1/scripts/release.py +92 -0
- lib_detect_testenv-3.0.1/scripts/run_cli.py +154 -0
- lib_detect_testenv-3.0.1/scripts/target_metadata.py +202 -0
- lib_detect_testenv-3.0.1/scripts/test.py +1004 -0
- lib_detect_testenv-3.0.1/scripts/toml_config.py +433 -0
- lib_detect_testenv-3.0.1/scripts/version_current.py +20 -0
- lib_detect_testenv-3.0.1/src/lib_detect_testenv/__init__.py +44 -0
- lib_detect_testenv-3.0.1/src/lib_detect_testenv/__init__conf__.py +74 -0
- lib_detect_testenv-3.0.1/src/lib_detect_testenv/__main__.py +20 -0
- lib_detect_testenv-3.0.1/src/lib_detect_testenv/behaviors.py +145 -0
- lib_detect_testenv-3.0.1/src/lib_detect_testenv/cli.py +363 -0
- {lib_detect_testenv-2.0.8 → lib_detect_testenv-3.0.1/src}/lib_detect_testenv/lib_detect_testenv.py +47 -57
- {lib_detect_testenv-2.0.8 → lib_detect_testenv-3.0.1/src}/lib_detect_testenv/py.typed +0 -0
- lib_detect_testenv-3.0.1/tests/conftest.py +47 -0
- lib_detect_testenv-3.0.1/tests/test_behaviors.py +61 -0
- lib_detect_testenv-3.0.1/tests/test_cli.py +254 -0
- lib_detect_testenv-3.0.1/tests/test_lib_detect_testenv.py +325 -0
- lib_detect_testenv-3.0.1/tests/test_metadata.py +111 -0
- lib_detect_testenv-3.0.1/tests/test_module_entry.py +65 -0
- lib_detect_testenv-3.0.1/tests/test_scripts.py +266 -0
- lib_detect_testenv-2.0.8/.3rd_party_stubs/readme.txt +0 -22
- lib_detect_testenv-2.0.8/.coveragerc +0 -36
- lib_detect_testenv-2.0.8/.docs/README_template.rst +0 -62
- lib_detect_testenv-2.0.8/.docs/acknowledgment.rst +0 -1
- lib_detect_testenv-2.0.8/.docs/badges.rst +0 -46
- lib_detect_testenv-2.0.8/.docs/commandline_help.rst +0 -1
- lib_detect_testenv-2.0.8/.docs/contribute.rst +0 -2
- lib_detect_testenv-2.0.8/.docs/description.rst +0 -1
- lib_detect_testenv-2.0.8/.docs/index.rst +0 -12
- lib_detect_testenv-2.0.8/.docs/installation.rst +0 -45
- lib_detect_testenv-2.0.8/.docs/installation_via_makefile.rst +0 -21
- lib_detect_testenv-2.0.8/.docs/installation_via_pypi.rst +0 -13
- lib_detect_testenv-2.0.8/.docs/licence_mit.rst +0 -1
- lib_detect_testenv-2.0.8/.docs/tested_under.rst +0 -3
- lib_detect_testenv-2.0.8/.docs/try_in_jupyter.rst +0 -5
- lib_detect_testenv-2.0.8/.docs/usage.rst +0 -52
- lib_detect_testenv-2.0.8/.flake8 +0 -5
- lib_detect_testenv-2.0.8/.github/workflows/codeql-analysis.yml +0 -70
- lib_detect_testenv-2.0.8/.github/workflows/python-package.yml +0 -259
- lib_detect_testenv-2.0.8/.gitignore +0 -105
- lib_detect_testenv-2.0.8/CHANGES.rst +0 -88
- lib_detect_testenv-2.0.8/CODE_OF_CONDUCT.md +0 -70
- lib_detect_testenv-2.0.8/CONTRIBUTING.md +0 -17
- lib_detect_testenv-2.0.8/ISSUE_TEMPLATE.md +0 -36
- lib_detect_testenv-2.0.8/MANIFEST.in +0 -4
- lib_detect_testenv-2.0.8/Makefile +0 -31
- lib_detect_testenv-2.0.8/PKG-INFO +0 -502
- lib_detect_testenv-2.0.8/PULL_REQUEST_TEMPLATE.md +0 -23
- lib_detect_testenv-2.0.8/README.rst +0 -480
- lib_detect_testenv-2.0.8/conftest.py +0 -10
- lib_detect_testenv-2.0.8/lib_detect_testenv/__init__.py +0 -22
- lib_detect_testenv-2.0.8/lib_detect_testenv/__init__conf__.py +0 -22
- lib_detect_testenv-2.0.8/lib_detect_testenv.egg-info/PKG-INFO +0 -502
- lib_detect_testenv-2.0.8/lib_detect_testenv.egg-info/SOURCES.txt +0 -51
- lib_detect_testenv-2.0.8/lib_detect_testenv.egg-info/dependency_links.txt +0 -1
- lib_detect_testenv-2.0.8/lib_detect_testenv.egg-info/requires.txt +0 -14
- lib_detect_testenv-2.0.8/lib_detect_testenv.egg-info/top_level.txt +0 -1
- lib_detect_testenv-2.0.8/lib_detect_testenv.ipynb +0 -62
- lib_detect_testenv-2.0.8/pyproject.toml +0 -82
- lib_detect_testenv-2.0.8/requirements.txt +0 -1
- lib_detect_testenv-2.0.8/requirements_test.txt +0 -13
- lib_detect_testenv-2.0.8/setup.cfg +0 -4
- lib_detect_testenv-2.0.8/tests/local_testscripts/lib_bash_functions.sh +0 -275
- lib_detect_testenv-2.0.8/tests/local_testscripts/run_clean.sh +0 -10
- lib_detect_testenv-2.0.8/tests/local_testscripts/run_pytest.sh +0 -35
- lib_detect_testenv-2.0.8/tests/local_testscripts/run_testloop.sh +0 -61
- lib_detect_testenv-2.0.8/tests/local_testscripts/run_testloop_pytest_and_mypy_only_no_setup.sh +0 -61
- lib_detect_testenv-2.0.8/tests/local_testscripts/run_testloop_windows.cmd +0 -33
- lib_detect_testenv-2.0.8/tests/local_testscripts/shellcheck.sh +0 -50
- lib_detect_testenv-2.0.8/tests/local_testscripts/testing_tools.py +0 -139
|
@@ -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,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,200 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ main, master ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ main, master ]
|
|
8
|
+
schedule:
|
|
9
|
+
# Run daily at 3:17 AM UTC (off-peak hours, odd minute to avoid congestion)
|
|
10
|
+
- cron: '17 3 * * *'
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
test:
|
|
14
|
+
name: Tests (Python ${{ matrix.python }}, ${{ matrix.os }})
|
|
15
|
+
runs-on: ${{ matrix.os }}
|
|
16
|
+
strategy:
|
|
17
|
+
fail-fast: false
|
|
18
|
+
matrix:
|
|
19
|
+
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
20
|
+
# Test against Python 3.13 and the latest 3.x available on Actions runners
|
|
21
|
+
python: ["3.13", "3.x"]
|
|
22
|
+
env:
|
|
23
|
+
PYO3_USE_ABI3_FORWARD_COMPATIBILITY: "1"
|
|
24
|
+
PYTHONIOENCODING: "utf-8"
|
|
25
|
+
steps:
|
|
26
|
+
- uses: actions/checkout@v6
|
|
27
|
+
- uses: actions/setup-python@v6
|
|
28
|
+
with:
|
|
29
|
+
python-version: ${{ matrix.python }}
|
|
30
|
+
cache: 'pip'
|
|
31
|
+
cache-dependency-path: 'pyproject.toml'
|
|
32
|
+
- name: Install uv
|
|
33
|
+
uses: astral-sh/setup-uv@v7
|
|
34
|
+
with:
|
|
35
|
+
enable-cache: true
|
|
36
|
+
- name: Extract project metadata
|
|
37
|
+
shell: python
|
|
38
|
+
run: |
|
|
39
|
+
import os
|
|
40
|
+
import tomllib
|
|
41
|
+
from pathlib import Path
|
|
42
|
+
|
|
43
|
+
data = tomllib.loads(Path('pyproject.toml').read_text('utf-8'))
|
|
44
|
+
project = data['project']['name']
|
|
45
|
+
module = project.replace('-', '_')
|
|
46
|
+
dash = project.replace('_', '-')
|
|
47
|
+
scripts = list(data['project'].get('scripts', {}).keys())
|
|
48
|
+
cli_bin = scripts[0] if scripts else dash
|
|
49
|
+
|
|
50
|
+
with open(os.environ['GITHUB_ENV'], 'a', encoding='utf-8') as env:
|
|
51
|
+
env.write(f"PROJECT_NAME={project}\n")
|
|
52
|
+
env.write(f"PACKAGE_MODULE={module}\n")
|
|
53
|
+
env.write(f"CLI_BIN={cli_bin}\n")
|
|
54
|
+
- name: Install make on Windows
|
|
55
|
+
if: runner.os == 'Windows'
|
|
56
|
+
shell: pwsh
|
|
57
|
+
run: |
|
|
58
|
+
choco install -y make
|
|
59
|
+
echo "C:\\ProgramData\\chocolatey\\bin" >> $env:GITHUB_PATH
|
|
60
|
+
- name: Install journald prerequisites
|
|
61
|
+
if: runner.os == 'Linux'
|
|
62
|
+
shell: bash
|
|
63
|
+
run: |
|
|
64
|
+
sudo apt-get update
|
|
65
|
+
sudo apt-get install -y python3-systemd
|
|
66
|
+
|
|
67
|
+
- name: Upgrade pip
|
|
68
|
+
shell: bash
|
|
69
|
+
run: python -m pip install --upgrade pip
|
|
70
|
+
|
|
71
|
+
- name: Install dev deps
|
|
72
|
+
shell: bash
|
|
73
|
+
run: |
|
|
74
|
+
uv pip install -e .[dev] --system
|
|
75
|
+
|
|
76
|
+
- name: Install Windows Event Log prerequisites
|
|
77
|
+
if: runner.os == 'Windows'
|
|
78
|
+
shell: bash
|
|
79
|
+
run: |
|
|
80
|
+
uv pip install pywin32 --system
|
|
81
|
+
- name: Cache ruff
|
|
82
|
+
uses: actions/cache@v5
|
|
83
|
+
with:
|
|
84
|
+
path: .ruff_cache
|
|
85
|
+
key: ruff-${{ runner.os }}-${{ github.sha }}
|
|
86
|
+
restore-keys: |
|
|
87
|
+
ruff-${{ runner.os }}-
|
|
88
|
+
- name: Cache pyright
|
|
89
|
+
uses: actions/cache@v5
|
|
90
|
+
with:
|
|
91
|
+
path: .pyright
|
|
92
|
+
key: pyright-${{ runner.os }}-py${{ matrix.python }}-${{ github.sha }}
|
|
93
|
+
restore-keys: |
|
|
94
|
+
pyright-${{ runner.os }}-py${{ matrix.python }}-
|
|
95
|
+
pyright-${{ runner.os }}-
|
|
96
|
+
- name: Run full test suite (lint, types, tests, coverage, codecov)
|
|
97
|
+
shell: bash
|
|
98
|
+
env:
|
|
99
|
+
TEST_VERBOSE: "1"
|
|
100
|
+
run: make test
|
|
101
|
+
- name: Build wheel/sdist
|
|
102
|
+
shell: bash
|
|
103
|
+
run: python -m build
|
|
104
|
+
- name: Verify wheel install in clean env
|
|
105
|
+
shell: bash
|
|
106
|
+
run: |
|
|
107
|
+
python -m venv .venv_wheel
|
|
108
|
+
. .venv_wheel/bin/activate 2>/dev/null || . .venv_wheel/Scripts/activate 2>/dev/null
|
|
109
|
+
pip install dist/*.whl
|
|
110
|
+
"$CLI_BIN" --version 2>/dev/null || python -m "$PACKAGE_MODULE" --version
|
|
111
|
+
|
|
112
|
+
pipx-uv:
|
|
113
|
+
name: pipx/uv verification (ubuntu)
|
|
114
|
+
runs-on: ubuntu-latest
|
|
115
|
+
steps:
|
|
116
|
+
- uses: actions/checkout@v6
|
|
117
|
+
- uses: actions/setup-python@v6
|
|
118
|
+
with:
|
|
119
|
+
python-version: "3.13"
|
|
120
|
+
cache: 'pip'
|
|
121
|
+
cache-dependency-path: 'pyproject.toml'
|
|
122
|
+
- name: Extract project metadata
|
|
123
|
+
shell: python
|
|
124
|
+
run: |
|
|
125
|
+
import os
|
|
126
|
+
import tomllib
|
|
127
|
+
from pathlib import Path
|
|
128
|
+
|
|
129
|
+
data = tomllib.loads(Path('pyproject.toml').read_text('utf-8'))
|
|
130
|
+
project = data['project']['name']
|
|
131
|
+
module = project.replace('-', '_')
|
|
132
|
+
dash = project.replace('_', '-')
|
|
133
|
+
scripts = list(data['project'].get('scripts', {}).keys())
|
|
134
|
+
cli_bin = scripts[0] if scripts else dash
|
|
135
|
+
|
|
136
|
+
with open(os.environ['GITHUB_ENV'], 'a', encoding='utf-8') as env:
|
|
137
|
+
env.write(f"PROJECT_NAME={project}\n")
|
|
138
|
+
env.write(f"PACKAGE_MODULE={module}\n")
|
|
139
|
+
env.write(f"CLI_BIN={cli_bin}\n")
|
|
140
|
+
- name: Build wheel
|
|
141
|
+
run: |
|
|
142
|
+
python -m pip install --upgrade pip build
|
|
143
|
+
python -m build
|
|
144
|
+
- name: pipx install from wheel
|
|
145
|
+
run: |
|
|
146
|
+
python -m pip install pipx
|
|
147
|
+
pipx install dist/*.whl
|
|
148
|
+
"$CLI_BIN" --version 2>/dev/null || python -m "$PACKAGE_MODULE" --version
|
|
149
|
+
- name: Install uv
|
|
150
|
+
uses: astral-sh/setup-uv@v7
|
|
151
|
+
with:
|
|
152
|
+
enable-cache: true
|
|
153
|
+
- name: uv tool install
|
|
154
|
+
run: |
|
|
155
|
+
uv tool install .
|
|
156
|
+
"$CLI_BIN" --version 2>/dev/null || python -m "$PACKAGE_MODULE" --version
|
|
157
|
+
|
|
158
|
+
notebooks:
|
|
159
|
+
name: Execute notebooks (ubuntu, Python 3.13)
|
|
160
|
+
runs-on: ubuntu-latest
|
|
161
|
+
steps:
|
|
162
|
+
- uses: actions/checkout@v6
|
|
163
|
+
- uses: actions/setup-python@v6
|
|
164
|
+
with:
|
|
165
|
+
python-version: "3.13"
|
|
166
|
+
cache: 'pip'
|
|
167
|
+
cache-dependency-path: 'pyproject.toml'
|
|
168
|
+
- name: Install notebook runner deps
|
|
169
|
+
run: |
|
|
170
|
+
python -m pip install --upgrade pip
|
|
171
|
+
pip install nbclient nbformat ipykernel jupyter_client
|
|
172
|
+
python -m ipykernel install --user --name python3 --display-name "Python 3"
|
|
173
|
+
- name: Execute Quickstart notebook
|
|
174
|
+
env:
|
|
175
|
+
PIP_DISABLE_PIP_VERSION_CHECK: "1"
|
|
176
|
+
PIP_NO_INPUT: "1"
|
|
177
|
+
run: |
|
|
178
|
+
python - << 'PY'
|
|
179
|
+
from pathlib import Path
|
|
180
|
+
|
|
181
|
+
import nbformat
|
|
182
|
+
from nbclient import NotebookClient
|
|
183
|
+
|
|
184
|
+
nb_path = Path('notebooks/Quickstart.ipynb')
|
|
185
|
+
if not nb_path.exists():
|
|
186
|
+
raise SystemExit(f"Notebook not found: {nb_path}")
|
|
187
|
+
|
|
188
|
+
notebook = nbformat.read(nb_path, as_version=4)
|
|
189
|
+
client = NotebookClient(
|
|
190
|
+
notebook,
|
|
191
|
+
timeout=900,
|
|
192
|
+
kernel_name='python3',
|
|
193
|
+
allow_errors=False,
|
|
194
|
+
)
|
|
195
|
+
client.execute()
|
|
196
|
+
|
|
197
|
+
out_path = Path('notebooks/Quickstart-executed.ipynb')
|
|
198
|
+
nbformat.write(notebook, out_path)
|
|
199
|
+
print(f"Executed notebook written to: {out_path}")
|
|
200
|
+
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@v6
|
|
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,50 @@
|
|
|
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@v6
|
|
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
|
+
cache: 'pip'
|
|
29
|
+
cache-dependency-path: 'pyproject.toml'
|
|
30
|
+
- name: Install uv
|
|
31
|
+
uses: astral-sh/setup-uv@v7
|
|
32
|
+
with:
|
|
33
|
+
enable-cache: true
|
|
34
|
+
- name: Build artifacts
|
|
35
|
+
run: |
|
|
36
|
+
python -m pip install --upgrade pip
|
|
37
|
+
uv pip install build --system
|
|
38
|
+
python -m build
|
|
39
|
+
- name: Publish to PyPI
|
|
40
|
+
# Use the rolling major tag to get latest Twine/standards support (e.g., Core Metadata 2.4)
|
|
41
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
42
|
+
with:
|
|
43
|
+
password: ${{ secrets.PYPI_API_TOKEN }}
|
|
44
|
+
attestations: false
|
|
45
|
+
skip-existing: true
|
|
46
|
+
- name: Upload artifacts
|
|
47
|
+
uses: actions/upload-artifact@v6
|
|
48
|
+
with:
|
|
49
|
+
name: dist
|
|
50
|
+
path: dist/*
|
|
@@ -0,0 +1,181 @@
|
|
|
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
|
+
.claude
|
|
33
|
+
|
|
34
|
+
# ====================================
|
|
35
|
+
# IDEs & Editors
|
|
36
|
+
# ====================================
|
|
37
|
+
# IntelliJ, PyCharm, etc.
|
|
38
|
+
.idea/
|
|
39
|
+
# VS Code workspace settings
|
|
40
|
+
.vscode/
|
|
41
|
+
*.code-workspace
|
|
42
|
+
|
|
43
|
+
# ====================================
|
|
44
|
+
# Python bytecode & caches
|
|
45
|
+
# ====================================
|
|
46
|
+
# __pycache__: compiled .pyc files at any depth
|
|
47
|
+
# *.py[cod]: catches .pyc, .pyo, .pyd
|
|
48
|
+
__pycache__/
|
|
49
|
+
*.py[cod]
|
|
50
|
+
*$py.class # other compiled artifacts
|
|
51
|
+
|
|
52
|
+
# pytest, coverage, MyPy, Hypothesis
|
|
53
|
+
.pytest_cache/
|
|
54
|
+
.mypy_cache/
|
|
55
|
+
.pyright/
|
|
56
|
+
.coverage*
|
|
57
|
+
htmlcov/
|
|
58
|
+
nosetests.xml
|
|
59
|
+
coverage.xml
|
|
60
|
+
*.cover
|
|
61
|
+
.hypothesis/
|
|
62
|
+
.tox/
|
|
63
|
+
.nox/
|
|
64
|
+
|
|
65
|
+
# general cache directories (any project-level caching)
|
|
66
|
+
.cache/
|
|
67
|
+
.run/
|
|
68
|
+
.import_linter_cache/
|
|
69
|
+
|
|
70
|
+
# ====================================
|
|
71
|
+
# Build & distribution artifacts
|
|
72
|
+
# ====================================
|
|
73
|
+
# source/package builds
|
|
74
|
+
build/
|
|
75
|
+
dist/
|
|
76
|
+
*.egg-info/ # metadata for pip installs
|
|
77
|
+
*.egg
|
|
78
|
+
*.whl
|
|
79
|
+
pip-wheel-metadata/
|
|
80
|
+
*.manifest # PyInstaller metadata
|
|
81
|
+
*.spec # PyInstaller spec files
|
|
82
|
+
|
|
83
|
+
# Eggs, parts, wheels, sdist, etc.
|
|
84
|
+
develop-eggs/
|
|
85
|
+
.eggs/
|
|
86
|
+
parts/
|
|
87
|
+
sdist/
|
|
88
|
+
wheels/
|
|
89
|
+
downloads/
|
|
90
|
+
var/
|
|
91
|
+
|
|
92
|
+
# pip logs & installer leftovers
|
|
93
|
+
pip-log.txt
|
|
94
|
+
pip-delete-this-directory.txt
|
|
95
|
+
.installed.cfg
|
|
96
|
+
|
|
97
|
+
# ====================================
|
|
98
|
+
# Virtual environments & secrets
|
|
99
|
+
# ====================================
|
|
100
|
+
# common venv folder names
|
|
101
|
+
env/
|
|
102
|
+
venv/
|
|
103
|
+
ENV/
|
|
104
|
+
.venv/
|
|
105
|
+
# backups, alternate names
|
|
106
|
+
env.bak/
|
|
107
|
+
venv.bak/
|
|
108
|
+
# dotenv files with credentials
|
|
109
|
+
.env
|
|
110
|
+
|
|
111
|
+
# ====================================
|
|
112
|
+
# Project-specific & framework files
|
|
113
|
+
# ====================================
|
|
114
|
+
# Django logs & local overrides
|
|
115
|
+
*.log
|
|
116
|
+
local_settings.py
|
|
117
|
+
|
|
118
|
+
# Flask instance folder
|
|
119
|
+
instance/
|
|
120
|
+
.webassets-cache
|
|
121
|
+
|
|
122
|
+
# Scrapy cache
|
|
123
|
+
.scrapy
|
|
124
|
+
|
|
125
|
+
# Sphinx docs
|
|
126
|
+
docs/_build/
|
|
127
|
+
|
|
128
|
+
# PyBuilder output
|
|
129
|
+
target/
|
|
130
|
+
|
|
131
|
+
# Jupyter notebooks checkpoints
|
|
132
|
+
.ipynb_checkpoints
|
|
133
|
+
|
|
134
|
+
# pyenv Python version file
|
|
135
|
+
.python-version
|
|
136
|
+
|
|
137
|
+
# Celery beat schedule
|
|
138
|
+
celerybeat-schedule
|
|
139
|
+
|
|
140
|
+
# SageMath parsed files
|
|
141
|
+
*.sage.py
|
|
142
|
+
|
|
143
|
+
# Spyder IDE
|
|
144
|
+
.spyderproject
|
|
145
|
+
.spyproject
|
|
146
|
+
|
|
147
|
+
# Rope IDE
|
|
148
|
+
.ropeproject
|
|
149
|
+
|
|
150
|
+
# MkDocs static site folder
|
|
151
|
+
/site
|
|
152
|
+
|
|
153
|
+
# ====================================
|
|
154
|
+
# OS-specific files
|
|
155
|
+
# ====================================
|
|
156
|
+
# macOS
|
|
157
|
+
.DS_Store
|
|
158
|
+
# Windows
|
|
159
|
+
Thumbs.db
|
|
160
|
+
ehthumbs.db
|
|
161
|
+
|
|
162
|
+
# Archives
|
|
163
|
+
*.zip
|
|
164
|
+
|
|
165
|
+
# Thunderbird build artifact (created temporarily by pack script)
|
|
166
|
+
sources/manifest.json
|
|
167
|
+
|
|
168
|
+
# ====================================
|
|
169
|
+
# Tool-specific extras
|
|
170
|
+
# ====================================
|
|
171
|
+
# Codecov uploader script (downloaded during local uploads)
|
|
172
|
+
codecov.sh
|
|
173
|
+
codecov.xml
|
|
174
|
+
|
|
175
|
+
# Nix build result symlink
|
|
176
|
+
result
|
|
177
|
+
|
|
178
|
+
# Optional lockfiles (for alternative managers)
|
|
179
|
+
poetry.lock
|
|
180
|
+
pdm.lock
|
|
181
|
+
uv.lock
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [3.0.1] - 2025-12-15
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- Replaced `tomllib`/`tomli` with `rtoml` for TOML parsing in scripts
|
|
13
|
+
- Updated GitHub Actions dependencies:
|
|
14
|
+
- `actions/cache` v4 → v5
|
|
15
|
+
- `actions/upload-artifact` v5 → v6
|
|
16
|
+
- Added `PYTHONIOENCODING: "utf-8"` environment variable to CI workflow for consistent encoding
|
|
17
|
+
|
|
18
|
+
## [3.0.0] - 2025-11-04
|
|
19
|
+
|
|
20
|
+
### Added
|
|
21
|
+
|
|
22
|
+
**Core Library Features:**
|
|
23
|
+
- `add_path_to_syspath()` function to add paths to sys.path with duplicate prevention
|
|
24
|
+
- Full support for PathLike objects and string paths
|
|
25
|
+
- Automatic resolution of relative paths to absolute paths
|
|
26
|
+
- File path handling (adds parent directory when given a file)
|
|
27
|
+
|
|
28
|
+
**CLI Detection Commands:**
|
|
29
|
+
- `check` - Check if any test environment is active (pytest, doctest, setup.py test)
|
|
30
|
+
- `pytest` - Check if pytest is active
|
|
31
|
+
- `doctest` - Check if doctest is active
|
|
32
|
+
- `setup` - Check if setup.py is active
|
|
33
|
+
- `--quiet` flag for all detection commands (exit code only, no output)
|
|
34
|
+
- `--arg-string` option to test custom argument strings
|
|
35
|
+
- `--test-only` flag for setup command (check only "setup.py test")
|
|
36
|
+
|
|
37
|
+
**CLI Utility Commands:**
|
|
38
|
+
- `hello` - Demo command to print greeting message
|
|
39
|
+
- `fail` - Demo command to trigger intentional failure for testing error handling
|
|
40
|
+
- `info` - Display package metadata and version information
|
|
41
|
+
|
|
42
|
+
**3-Level Exit Code System:**
|
|
43
|
+
- Exit code **0** = Test environment detected (success)
|
|
44
|
+
- Exit code **1** = No test environment detected (normal negative result)
|
|
45
|
+
- Exit code **2** = Error occurred (command failed with exception)
|
|
46
|
+
- Follows Unix conventions for intuitive shell scripting
|
|
47
|
+
- All detection commands implement consistent exit code behavior
|
|
48
|
+
|
|
49
|
+
**Comprehensive Test Suite:**
|
|
50
|
+
- 68 tests total (100% passing rate)
|
|
51
|
+
- 28 tests for core library functions (test_lib_detect_testenv.py)
|
|
52
|
+
- Tests for all detection functions
|
|
53
|
+
- Tests for add_path_to_syspath with edge cases
|
|
54
|
+
- Tests for PathLike support and duplicate prevention
|
|
55
|
+
- 23 tests for CLI commands (test_cli.py)
|
|
56
|
+
- Tests for all detection commands
|
|
57
|
+
- Tests for exit codes
|
|
58
|
+
- Tests for quiet mode and flags
|
|
59
|
+
- Full coverage of test environment detection scenarios
|
|
60
|
+
|
|
61
|
+
**Documentation:**
|
|
62
|
+
- Comprehensive README.md with CLI and Python API usage
|
|
63
|
+
- Exit code documentation with shell scripting examples
|
|
64
|
+
- Function reference with parameters, returns, and examples
|
|
65
|
+
- Common usage patterns section
|
|
66
|
+
- INSTALL.md updated for optional dependencies
|
|
67
|
+
|
|
68
|
+
### Changed
|
|
69
|
+
|
|
70
|
+
**BREAKING CHANGES:**
|
|
71
|
+
- Renamed internal module `detect_testenv.py` to `lib_detect_testenv.py`
|
|
72
|
+
- Minimal dependencies - Only `rich-click>=1.9.4` required for CLI functionality
|
|
73
|
+
- `dependencies = ["rich-click>=1.9.4"]` - Required for CLI entry point
|
|
74
|
+
- Core detection library functions have no external dependencies (pure stdlib)
|
|
75
|
+
- Users can import detection functions (`is_pytest_active()`, etc.) without using rich-click
|
|
76
|
+
- CLI commands require rich-click for beautiful terminal output
|
|
77
|
+
|
|
78
|
+
**Configuration:**
|
|
79
|
+
- Keywords updated from `["logging", "rich", "cli", "terminal", "ansi"]` to `["testing", "pytest", "doctest", "unittest", "test-detection", "test-environment"]` for accurate PyPI discoverability
|
|
80
|
+
- Import linter configuration updated to check correct architecture (CLI → lib_detect_testenv → behaviors)
|
|
81
|
+
- pyproject.toml restructured with optional dependency groups
|
|
82
|
+
|
|
83
|
+
**Documentation:**
|
|
84
|
+
- Updated README.md from RST format to Markdown with:
|
|
85
|
+
- Complete function reference documentation
|
|
86
|
+
- CLI usage examples with exit code explanations
|
|
87
|
+
- Shell scripting patterns and best practices
|
|
88
|
+
- Common usage patterns section
|
|
89
|
+
- Default CLI behavior now runs `check` command when invoked without arguments
|
|
90
|
+
- All CLI commands documented with examples
|
|
91
|
+
|
|
92
|
+
### Fixed
|
|
93
|
+
- CLI now uses actual library detection functions instead of template boilerplate
|
|
94
|
+
- Import paths updated throughout codebase to reflect renamed module
|
|
95
|
+
- Documentation accurately reflects actual functionality
|
|
96
|
+
- All 68 tests passing with proper coverage of core functionality
|
|
97
|
+
- Exit code handling consistent across all detection commands
|
|
98
|
+
- Error handling improved with try/except blocks returning exit code 2
|
|
99
|
+
|
|
100
|
+
### Documentation Improvements
|
|
101
|
+
- Added comprehensive 3-level exit code system documentation
|
|
102
|
+
- Added shell scripting examples for all detection commands
|
|
103
|
+
- Documented hello/fail demo commands
|
|
104
|
+
- Added comprehensive Python API reference with all function signatures
|
|
105
|
+
- Exit code handling examples for different shell scripting scenarios
|
|
106
|
+
- Added case statement examples for handling all three exit codes
|
|
107
|
+
|
|
108
|
+
## [1.0.0] - 2025-11-04
|
|
109
|
+
- Bootstrap `lib_detect_testenv`
|