Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions .bumpversion.cfg

This file was deleted.

19 changes: 19 additions & 0 deletions .bumpversion.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[tool.bumpversion]
current_version = "2.6.0"
commit = false
tag = false

[[tool.bumpversion.files]]
filename = "pyproject.toml"
search = 'version = "{current_version}"'
replace = 'version = "{new_version}"'

[[tool.bumpversion.files]]
filename = "src/scpi/__init__.py"
search = '__version__ = "{current_version}"'
replace = '__version__ = "{new_version}"'

[[tool.bumpversion.files]]
filename = "tests/test_scpi.py"
search = '__version__ == "{current_version}"'
replace = '__version__ == "{new_version}"'
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,9 @@ Dockerfile
**/.mypy_cache/
**/.dmypy.json
**/dmypy.json

HANDOFF.md
Dockerfile_alpine
.ruff_cache
.pyrefly_cache
pytest*.xml
2 changes: 0 additions & 2 deletions .flake8

This file was deleted.

62 changes: 62 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Checks
on: [push, pull_request]
permissions:
contents: read
jobs:
python:
runs-on: ubuntu-latest
strategy:
matrix:
python: ['3.12', '3.13', '3.14']
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v6
with:
version: '0.12.12'
python-version: ${{ matrix.python }}
- run: uv sync --locked
- run: uv run --locked prek run --all-files
env:
SKIP: no-commit-to-branch
- run: uv run --locked pytest
- run: uv run --locked bandit -r src --skip B101
- run: uv build
containers:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
variant: [debian, alpine]
target: [test, tox, devel_shell, production]
steps:
- uses: actions/checkout@v4
- run: ./run_tests.sh
env:
VARIANTS: ${{ matrix.variant }}
TARGETS: ${{ matrix.target }}
tag:
needs: [python, containers]
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
permissions:
contents: write
concurrency:
group: version-tag
cancel-in-progress: false
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Tag package version
shell: bash
run: |
set -euo pipefail
version=$(python -c 'import tomllib; print(tomllib.load(open("pyproject.toml", "rb"))["project"]["version"])')
git check-ref-format "refs/tags/$version"
existing=$(git ls-remote --tags origin "refs/tags/$version")
if [ -n "$existing" ]; then
echo "Tag $version already exists; leaving it unchanged."
exit 0
fi
git push origin "HEAD:refs/tags/$version"
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,7 @@ dmypy.json

# Pyre type checker
.pyre/

# Modern tooling caches
.ruff_cache/
.pyrefly_cache/
64 changes: 40 additions & 24 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
# See https://pre-commit.com for more information
# Run these hooks with prek: https://prek.j178.dev/
# See https://pre-commit.com/hooks.html for more hooks
default_language_version:
python: python3
default_install_hook_types:
- pre-commit
- commit-msg
repos:
- repo: https://github.com/compilerla/conventional-pre-commit
rev: v4.2.0
hooks:
- id: conventional-pre-commit
stages: [commit-msg]
args: []
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v5.0.0
hooks:
- id: no-commit-to-branch
- id: check-executables-have-shebangs
Expand All @@ -21,31 +30,35 @@ repos:
- id: pretty-format-json
args:
- --autofix
- repo: https://github.com/psf/black
rev: 24.1.1
hooks:
- id: black
language_version: python3
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.8.0
- repo: local
hooks:
- id: mypy
- id: ruff-check
name: Ruff lint
entry: uv run --locked ruff check --fix
language: system
args: ["--strict"]
- repo: https://github.com/pycqa/pylint
rev: v3.0.3
types_or: [python, pyi]
- id: ruff-format
name: Ruff format
entry: uv run --locked ruff format
language: system
types_or: [python, pyi]
- repo: local
hooks:
- id: pylint
- id: pyrefly
name: Pyrefly type check
entry: uv run --locked pyrefly check
language: system
pass_filenames: false
files: \.(py|pyi|toml)$
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.4
rev: v1.5.5
hooks:
- id: forbid-crlf
- id: remove-crlf
- id: forbid-tabs
- id: remove-tabs
- repo: https://github.com/PyCQA/bandit
rev: 1.7.7
rev: 1.8.3
hooks:
- id: bandit
args: ["--skip=B101"]
Expand All @@ -54,20 +67,23 @@ repos:
hooks:
- id: rst-linter
- repo: https://github.com/Yelp/detect-secrets
rev: v1.4.0
rev: v1.5.0
hooks:
- id: detect-secrets
entry: uv run --locked detect-secrets-hook
language: system
exclude: "poetry.lock"
exclude: '^uv\.lock$'
# args: ['--baseline', '.secrets.baseline']
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.9.0.6
rev: v0.10.0.1
hooks:
- id: shellcheck
args: ["--external-sources"]
- repo: https://github.com/python-poetry/poetry
rev: '1.7.1'
- repo: local
hooks:
- id: poetry-check
- id: poetry-lock
args: ["--no-update"]
- id: uv-lock
name: Check uv lockfile
entry: uv lock --check
language: system
files: ^(pyproject\.toml|uv\.lock)$
pass_filenames: false
Loading
Loading