opkssh-wrapper 0.1.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.
@@ -0,0 +1,39 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "pip"
4
+ directory: "/"
5
+ schedule:
6
+ interval: "weekly"
7
+ groups:
8
+ lint:
9
+ patterns:
10
+ - "ruff"
11
+ - "mypy"
12
+ - "pyright"
13
+ - "bandit"
14
+ test:
15
+ patterns:
16
+ - "pytest*"
17
+ - "hypothesis"
18
+ build:
19
+ patterns:
20
+ - "build"
21
+ - "twine"
22
+ - "nuitka"
23
+ - "ordered-set"
24
+ - "zstandard"
25
+ - "hatchling"
26
+ audit:
27
+ patterns:
28
+ - "pip-audit"
29
+ - "safety"
30
+ - "pip-licenses"
31
+
32
+ - package-ecosystem: "github-actions"
33
+ directory: "/"
34
+ schedule:
35
+ interval: "weekly"
36
+ groups:
37
+ actions:
38
+ patterns:
39
+ - "*"
@@ -0,0 +1,167 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+ workflow_call:
9
+
10
+ jobs:
11
+ lint:
12
+ name: Linting
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - uses: actions/checkout@v4
16
+
17
+ - uses: actions/setup-python@v5
18
+ with:
19
+ python-version: "3.12"
20
+
21
+ - name: Install package with lint dependencies
22
+ run: pip install -e ".[lint]"
23
+
24
+ - name: Ruff lint
25
+ run: ruff check src/ tests/
26
+
27
+ - name: Ruff format check
28
+ run: ruff format --check src/ tests/
29
+
30
+ - name: Mypy
31
+ run: mypy src/ --strict
32
+
33
+ - name: Pyright
34
+ run: pyright src/
35
+
36
+ - name: Bandit
37
+ run: bandit -r src/ -c pyproject.toml
38
+
39
+ test:
40
+ name: Tests
41
+ runs-on: ubuntu-latest
42
+ strategy:
43
+ matrix:
44
+ python-version: ["3.10", "3.11", "3.12", "3.13"]
45
+ steps:
46
+ - uses: actions/checkout@v4
47
+
48
+ - uses: actions/setup-python@v5
49
+ with:
50
+ python-version: ${{ matrix.python-version }}
51
+
52
+ - name: Install package with test dependencies
53
+ run: pip install -e ".[test]" babel
54
+
55
+ - name: Compile gettext catalogues
56
+ run: pybabel compile -d src/opkssh_wrapper/locale -D opkssh_wrapper
57
+
58
+ - name: Run tests with coverage
59
+ run: |
60
+ python -m pytest tests/ -v --tb=short \
61
+ --cov=opkssh_wrapper --cov-branch --cov-report=xml:coverage.xml --cov-report=term-missing
62
+ - name: Upload coverage reports to Codecov
63
+ uses: codecov/codecov-action@v5
64
+ with:
65
+ token: ${{ secrets.CODECOV_TOKEN }}
66
+ - name: Upload coverage artifact
67
+ uses: actions/upload-artifact@v4
68
+ with:
69
+ name: coverage-${{ matrix.python-version }}
70
+ path: coverage.xml
71
+ retention-days: 14
72
+
73
+ - name: Enforce minimum coverage (3.12 only)
74
+ if: matrix.python-version == '3.12'
75
+ run: python -m coverage report --fail-under=90
76
+
77
+ build-sdist-wheel:
78
+ name: Build Wheel
79
+ runs-on: ubuntu-latest
80
+ steps:
81
+ - uses: actions/checkout@v4
82
+
83
+ - uses: actions/setup-python@v5
84
+ with:
85
+ python-version: "3.12"
86
+
87
+ - name: Install build tools
88
+ run: pip install ".[build]"
89
+
90
+ - name: Build sdist and wheel
91
+ run: python -m build
92
+
93
+ - name: Validate distributions
94
+ run: twine check dist/*
95
+
96
+ - name: Upload artifacts
97
+ uses: actions/upload-artifact@v4
98
+ with:
99
+ name: python-package
100
+ path: dist/
101
+ retention-days: 14
102
+
103
+ build-nuitka:
104
+ name: Build Binary
105
+ runs-on: ${{ matrix.os }}
106
+ strategy:
107
+ matrix:
108
+ os: [ubuntu-latest, macos-latest]
109
+ steps:
110
+ - uses: actions/checkout@v4
111
+
112
+ - uses: actions/setup-python@v5
113
+ with:
114
+ python-version: "3.12"
115
+
116
+ - name: Install package with Nuitka dependencies
117
+ run: pip install ".[nuitka]" babel
118
+
119
+ - name: Compile gettext catalogues
120
+ run: pybabel compile -d src/opkssh_wrapper/locale -D opkssh_wrapper
121
+
122
+ - name: Install patchelf (Ubuntu only)
123
+ if: runner.os == 'Linux'
124
+ run: sudo apt-get install -y patchelf
125
+
126
+ - name: Build binary
127
+ run: bash scripts/build-nuitka.sh
128
+
129
+ - name: Smoke-test the binary
130
+ run: |
131
+ ./opkssh-wrapper --help || true
132
+ file ./opkssh-wrapper
133
+
134
+ - name: Security scan (Ubuntu only)
135
+ if: runner.os == 'Linux'
136
+ run: |
137
+ sudo apt-get install -y checksec
138
+ checksec --file=./opkssh-wrapper
139
+
140
+ - name: Upload artifact
141
+ uses: actions/upload-artifact@v4
142
+ with:
143
+ name: nuitka-binary-${{ runner.os == 'Linux' && 'linux' || 'macos' }}
144
+ path: ./opkssh-wrapper
145
+ retention-days: 14
146
+
147
+ audit:
148
+ name: Audit
149
+ runs-on: ubuntu-latest
150
+ steps:
151
+ - uses: actions/checkout@v4
152
+
153
+ - uses: actions/setup-python@v5
154
+ with:
155
+ python-version: "3.12"
156
+
157
+ - name: Install package with audit dependencies
158
+ run: pip install ".[audit]"
159
+
160
+ - name: pip-audit
161
+ run: pip-audit .
162
+
163
+ - name: safety check
164
+ run: safety check
165
+
166
+ - name: License check
167
+ run: pip-licenses --from=mixed --fail-on="GPL-3.0-or-later;AGPL-3.0-or-later"
@@ -0,0 +1,175 @@
1
+ name: Release
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ inputs:
6
+ bump:
7
+ description: "Version bump type"
8
+ required: true
9
+ type: choice
10
+ options:
11
+ - patch
12
+ - minor
13
+ - major
14
+ - custom
15
+ custom_version:
16
+ description: "Custom version (without v prefix, e.g. 2.0.0-rc1). Only used when bump is 'custom'."
17
+ required: false
18
+ type: string
19
+
20
+ # Restrict the top-level token to read-only; individual jobs escalate as needed.
21
+ permissions:
22
+ contents: read
23
+
24
+ jobs:
25
+ # ── 1. Resolve the next version string ──────────────────────────────
26
+ resolve-version:
27
+ name: Resolve version
28
+ runs-on: ubuntu-latest
29
+ outputs:
30
+ version: ${{ steps.version.outputs.version }}
31
+ tag: ${{ steps.version.outputs.tag }}
32
+ steps:
33
+ - uses: actions/checkout@v4
34
+ with:
35
+ fetch-depth: 0 # need full history for tag listing
36
+
37
+ - name: Determine version
38
+ id: version
39
+ shell: bash
40
+ run: |
41
+ set -euo pipefail
42
+
43
+ BUMP="${{ inputs.bump }}"
44
+
45
+ if [[ "$BUMP" == "custom" ]]; then
46
+ V="${{ inputs.custom_version }}"
47
+ if [[ -z "$V" ]]; then
48
+ echo "::error::custom_version is required when bump is 'custom'"
49
+ exit 1
50
+ fi
51
+ # Strip leading v if the user accidentally included it
52
+ V="${V#v}"
53
+ else
54
+ # Find the latest vX.Y.Z tag (ignore pre-release / custom tags)
55
+ LATEST=$(git tag --list 'v[0-9]*.[0-9]*.[0-9]*' --sort=-v:refname \
56
+ | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' \
57
+ | head -n1 || true)
58
+
59
+ if [[ -z "$LATEST" ]]; then
60
+ # No previous release — start at 0.1.0
61
+ LATEST="v0.0.0"
62
+ fi
63
+
64
+ # Strip the v prefix and split into components
65
+ IFS='.' read -r MAJOR MINOR PATCH <<< "${LATEST#v}"
66
+
67
+ case "$BUMP" in
68
+ major) MAJOR=$((MAJOR + 1)); MINOR=0; PATCH=0 ;;
69
+ minor) MINOR=$((MINOR + 1)); PATCH=0 ;;
70
+ patch) PATCH=$((PATCH + 1)) ;;
71
+ esac
72
+
73
+ V="${MAJOR}.${MINOR}.${PATCH}"
74
+ fi
75
+
76
+ echo "version=${V}" >> "$GITHUB_OUTPUT"
77
+ echo "tag=v${V}" >> "$GITHUB_OUTPUT"
78
+ echo "### :rocket: Releasing **v${V}**" >> "$GITHUB_STEP_SUMMARY"
79
+
80
+ # ── 2. Run the full CI suite before releasing ───────────────────────
81
+ ci:
82
+ name: CI
83
+ needs: [resolve-version]
84
+ uses: ./.github/workflows/ci.yml
85
+
86
+ # ── 3. Build release artifacts ──────────────────────────────────────
87
+ build:
88
+ name: Build release artifacts
89
+ needs: [resolve-version, ci]
90
+ runs-on: ubuntu-latest
91
+ steps:
92
+ - uses: actions/checkout@v4
93
+
94
+ - uses: actions/setup-python@v5
95
+ with:
96
+ python-version: "3.12"
97
+
98
+ - name: Install build tools
99
+ run: pip install ".[build]"
100
+
101
+ - name: Stamp version
102
+ shell: bash
103
+ run: |
104
+ set -euo pipefail
105
+ V="${{ needs.resolve-version.outputs.version }}"
106
+
107
+ # Update pyproject.toml
108
+ sed -i "s/^version = \".*\"/version = \"${V}\"/" pyproject.toml
109
+
110
+ # Update __init__.py
111
+ sed -i "s/^__version__ = \".*\"/__version__ = \"${V}\"/" \
112
+ src/opkssh_wrapper/__init__.py
113
+
114
+ echo "Stamped version to ${V}"
115
+ grep '^version' pyproject.toml
116
+ grep '__version__' src/opkssh_wrapper/__init__.py
117
+
118
+ - name: Build sdist and wheel
119
+ run: python -m build
120
+
121
+ - name: Validate distributions
122
+ run: twine check dist/*
123
+
124
+ - name: Upload release artifacts
125
+ uses: actions/upload-artifact@v4
126
+ with:
127
+ name: release-dist
128
+ path: dist/
129
+ retention-days: 90
130
+
131
+ # ── 4. Publish to PyPI via trusted publishing (OIDC) ────────────────
132
+ publish-pypi:
133
+ name: Publish to PyPI
134
+ needs: [resolve-version, build]
135
+ runs-on: ubuntu-latest
136
+ environment: pypi # use a GitHub environment for deployment protection
137
+ permissions:
138
+ id-token: write # required for OIDC trusted publishing
139
+ steps:
140
+ - name: Download release artifacts
141
+ uses: actions/download-artifact@v4
142
+ with:
143
+ name: release-dist
144
+ path: dist/
145
+
146
+ - name: Publish to PyPI
147
+ uses: pypa/gh-action-pypi-publish@release/v1
148
+
149
+ # ── 5. Tag the commit and create a GitHub Release ───────────────────
150
+ github-release:
151
+ name: GitHub Release
152
+ needs: [resolve-version, build, publish-pypi]
153
+ runs-on: ubuntu-latest
154
+ permissions:
155
+ contents: write # required for creating tags and releases
156
+ steps:
157
+ - uses: actions/checkout@v4
158
+
159
+ - name: Download release artifacts
160
+ uses: actions/download-artifact@v4
161
+ with:
162
+ name: release-dist
163
+ path: dist/
164
+
165
+ - name: Create tag and GitHub Release
166
+ env:
167
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
168
+ TAG: ${{ needs.resolve-version.outputs.tag }}
169
+ VERSION: ${{ needs.resolve-version.outputs.version }}
170
+ run: |
171
+ git tag "$TAG"
172
+ git push origin "$TAG"
173
+ gh release create "$TAG" dist/* \
174
+ --title "$TAG" \
175
+ --generate-notes
@@ -0,0 +1,207 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[codz]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py.cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # UV
98
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ #uv.lock
102
+
103
+ # poetry
104
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
106
+ # commonly ignored for libraries.
107
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108
+ #poetry.lock
109
+ #poetry.toml
110
+
111
+ # pdm
112
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
113
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
114
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
115
+ #pdm.lock
116
+ #pdm.toml
117
+ .pdm-python
118
+ .pdm-build/
119
+
120
+ # pixi
121
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
122
+ #pixi.lock
123
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
124
+ # in the .venv directory. It is recommended not to include this directory in version control.
125
+ .pixi
126
+
127
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
128
+ __pypackages__/
129
+
130
+ # Celery stuff
131
+ celerybeat-schedule
132
+ celerybeat.pid
133
+
134
+ # SageMath parsed files
135
+ *.sage.py
136
+
137
+ # Environments
138
+ .env
139
+ .envrc
140
+ .venv
141
+ env/
142
+ venv/
143
+ ENV/
144
+ env.bak/
145
+ venv.bak/
146
+
147
+ # Spyder project settings
148
+ .spyderproject
149
+ .spyproject
150
+
151
+ # Rope project settings
152
+ .ropeproject
153
+
154
+ # mkdocs documentation
155
+ /site
156
+
157
+ # mypy
158
+ .mypy_cache/
159
+ .dmypy.json
160
+ dmypy.json
161
+
162
+ # Pyre type checker
163
+ .pyre/
164
+
165
+ # pytype static type analyzer
166
+ .pytype/
167
+
168
+ # Cython debug symbols
169
+ cython_debug/
170
+
171
+ # PyCharm
172
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
173
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
174
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
175
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
176
+ #.idea/
177
+
178
+ # Abstra
179
+ # Abstra is an AI-powered process automation framework.
180
+ # Ignore directories containing user credentials, local state, and settings.
181
+ # Learn more at https://abstra.io/docs
182
+ .abstra/
183
+
184
+ # Visual Studio Code
185
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
186
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
187
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
188
+ # you could uncomment the following to ignore the entire vscode folder
189
+ # .vscode/
190
+
191
+ # Ruff stuff:
192
+ .ruff_cache/
193
+
194
+ # PyPI configuration file
195
+ .pypirc
196
+
197
+ # Cursor
198
+ # Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
199
+ # exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
200
+ # refer to https://docs.cursor.com/context/ignore-files
201
+ .cursorignore
202
+ .cursorindexingignore
203
+
204
+ # Marimo
205
+ marimo/_static/
206
+ marimo/_lsp/
207
+ __marimo__/
@@ -0,0 +1,19 @@
1
+ # Pre-commit configuration file
2
+
3
+ repos:
4
+ - repo: https://github.com/pre-commit/pre-commit-hooks
5
+ rev: v6.0.0
6
+ hooks:
7
+ - id: end-of-file-fixer
8
+ - id: trailing-whitespace
9
+ - id: check-yaml
10
+ - id: check-json
11
+ - id: check-merge-conflict
12
+ - id: check-docstring-first
13
+ - id: check-toml
14
+
15
+ - repo: https://github.com/psf/black
16
+ rev: 26.1.0
17
+ hooks:
18
+ - id: black
19
+ language_version: python3