Skip to content

MNT: drop unused pre-commit hook #1806

MNT: drop unused pre-commit hook

MNT: drop unused pre-commit hook #1806

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
paths-ignore:
- README.md
- CHANGELOG.md
workflow_dispatch:
env:
PYTHONWARNDEFAULTENCODING: 1
permissions: {}
jobs:
unit-tests:
strategy:
matrix:
os:
- ubuntu-latest
python-version:
- '3.11'
- '3.12'
- '3.13'
- '3.14'
- '3.15'
python-jit: [null]
include:
- os: ubuntu-22.04
python-version: 3.11.0
label: oldestdeps
- os: macos-latest
python-version: 3.11.0
- os: macos-latest
python-version: '3.14'
- os: windows-latest
# 3.11.0 and 3.11.1 have a platform-specific self-triggered warning
# breaking pytest at collection time, and that I don't want to just
# ignore unconditionally
python-version: 3.11.2
- os: windows-latest
python-version: '3.14'
- os: ubuntu-latest
python-version: '3.15'
python-jit: 1
label: JIT
- os: ubuntu-latest
python-version: 3.14t
label: free-threading-314
- os: ubuntu-latest
python-version: 3.15t
label: free-threading-315
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
# 3.11.0 isn't available through setup-uv
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6
with:
enable-cache: true
prune-cache: false
cache-suffix: covcheck
- if: ${{ matrix.label == 'oldestdeps' }}
run: echo "UV_RESOLUTION=lowest" >> "$GITHUB_ENV"
- name: Run tests (without coverage)
if: ${{ ! startswith( matrix.os, 'ubuntu' ) }}
shell: bash # for windows portability
run: |
uv sync --frozen --all-packages --group test --no-editable
uv run --no-sync \
pytest --color=yes
env:
PYTHON_JIT: ${{ matrix.python-jit }}
- name: Run tests (with coverage)
if: ${{ startswith( matrix.os, 'ubuntu' ) }}
run: |
uv sync --frozen --all-packages --group covcheck
uv run --no-sync \
coverage run --parallel-mode -m \
pytest --color=yes
env:
PYTHON_JIT: ${{ matrix.python-jit }}
- name: Upload coverage data
# only using reports from ubuntu because
# combining reports from multiple platforms is tricky (or impossible ?)
if: ${{ startswith( matrix.os, 'ubuntu' ) }}
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: inifix_coverage_data-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.label }}
path: .coverage.*
if-no-files-found: ignore
include-hidden-files: true
concurrency-tests:
strategy:
matrix:
os:
- ubuntu-latest
python-version:
- 3.11.0
- '3.14'
- 3.14t
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
# 3.11.0 isn't available through setup-uv
with:
python-version: ${{ matrix.python-version }}
- uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6
with:
enable-cache: true
prune-cache: false
cache-suffix: concurrency
- run: uv sync --frozen --all-packages --no-editable --group concurrency
- run: |
uv run --no-sync \
pytest --color=yes --count 100 -k concurrency
coverage:
name: Combine & check coverage
runs-on: ubuntu-latest
needs: unit-tests
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6
with:
python-version: '3.13'
activate-environment: true
enable-cache: true
prune-cache: false
cache-suffix: covcheck
- run: uv sync --group covcheck
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
pattern: inifix_coverage_data-*
merge-multiple: true
- name: Check coverage
run: |
coverage combine
coverage html --skip-covered --skip-empty
coverage report --skip-covered --format=markdown >> "$GITHUB_STEP_SUMMARY"
coverage report --fail-under=100
- name: Upload HTML report if check failed.
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: inifix_coverage_report
path: htmlcov
if: ${{ failure() }}
type-check:
strategy:
matrix:
python-version:
- '3.11'
- '3.14'
typechecker:
- mypy
- pyright
runs-on: ubuntu-latest
name: type check
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6
with:
python-version: ${{ matrix.python-version }}
activate-environment: true
enable-cache: true
prune-cache: false
cache-suffix: typecheck
- run: uv sync --frozen --all-packages --group typecheck
- name: Typecheck source code (inifix)
run: ${{ matrix.typechecker }} src tests
- name: Typecheck source code (inifix-cli)
run: ${{ matrix.typechecker }} cli/inifix-cli
- name: Verify Types (pyright only)
if: ${{ startsWith( matrix.typechecker , 'pyright' ) }}
run: ${{ matrix.typechecker }} --verifytypes inifix
optimized_python:
runs-on: ubuntu-latest
name: optimized Python
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
persist-credentials: false
- uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6
with:
python-version: '3.13'
enable-cache: true
prune-cache: false
cache-suffix: test
- run: uv sync --frozen --all-packages --no-editable --group test
- name: Run pytest with PYTHONOPTIMIZE=2
run: |
uv run --no-sync \
pytest --color=yes -Wdefault:'assertions not in test modules or plugins will be ignored'
env:
PYTHONOPTIMIZE: 2
pre-publish-checks:
runs-on: ubuntu-latest
name: pre-publication checks
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
persist-credentials: false
- uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6
with:
enable-cache: true
prune-cache: false
cache-suffix: pre-publish-checks
- run: uv run scripts/pre_publish_checks.py