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
10 changes: 10 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,13 @@ updates:
- "*"
cooldown:
default-days: 7
- package-ecosystem: "pre-commit"
directory: "/"
labels:
- dependencies
- skip news
schedule:
interval: "weekly"
day: "tuesday"
cooldown:
default-days: 7
118 changes: 52 additions & 66 deletions .github/workflows/check.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: check
name: πŸ§ͺ check
on:
workflow_dispatch:
push:
branches: ["main"]
tags-ignore: ["**"]
pull_request:
types: [opened, reopened, synchronize, labeled, unlabeled]
types: [opened, reopened, synchronize]
schedule:
- cron: "0 8 * * *"
concurrency:
Expand All @@ -15,7 +15,7 @@ permissions:
contents: read
jobs:
test:
name: test ${{ matrix.py }} - ${{ matrix.os }}
name: πŸ§ͺ test ${{ matrix.py }} - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand All @@ -30,47 +30,50 @@ jobs:
- "3.11"
os:
- ubuntu-24.04
- windows-2025
- macos-15
- windows-2025-vs2026
- macos-26
exclude:
- {os: windows-2025, py: pypy3.11}
- {os: windows-2025-vs2026, py: pypy3.11}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: πŸ“₯ Check out code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false
- name: Install the latest version of uv
uses: astral-sh/setup-uv@1c37ad07a6a961277cf70c0d37d6f313000f5884 # v10.3.0
- name: 🐍 Install uv
uses: astral-sh/setup-uv@07a047e608db84b3d8c06cd9a7c7dcc9c355c18e # v10.3.2
with:
version: latest-known
python-version: "3.15"
enable-cache: false
- name: Install tox
- name: πŸ“¦ Install tox
run: uv tool install --python-preference only-managed --python 3.15 tox --with tox-uv
- name: Install Python
- name: 🐍 Install Python ${{ matrix.py }}
run: uv python install --python-preference only-managed ${{ matrix.py }}
- name: Setup test suite
- name: πŸ“¦ Set up test suite
run: tox run -vv --notest --skip-missing-interpreters false -e ${{ matrix.py }}
env:
UV_PYTHON_PREFERENCE: only-managed
- name: Run test suite
- name: πŸ§ͺ Run test suite
run: |
if [[ "${{ matrix.py }}" == pypy* ]]; then
tox run --skip-pkg-install -e ${{ matrix.py }} --
if [[ "$MATRIX_PY" == pypy* ]]; then
tox run --skip-pkg-install -e "$MATRIX_PY" --
else
tox run --skip-pkg-install -e ${{ matrix.py }}
tox run --skip-pkg-install -e "$MATRIX_PY"
fi
shell: bash
env:
MATRIX_PY: ${{ matrix.py }}
PYTEST_ADDOPTS: "-vv --durations=20"
UV_PYTHON_PREFERENCE: only-managed
DIFF_AGAINST: HEAD
- name: Rename coverage report file
- name: πŸ“Š Rename coverage report file
if: ${{ !startsWith(matrix.py, 'pypy')}}
run: |
import os; import sys
os.rename(f".tox/.coverage.${{ matrix.py }}", f".tox/.coverage.${{ matrix.py }}-{sys.platform}")
shell: python
- name: Upload coverage data
- name: πŸ“€ Upload coverage data
if: ${{ !startsWith(matrix.py, 'pypy')}}
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
Expand All @@ -79,110 +82,93 @@ jobs:
path: ".tox/.coverage.*"
retention-days: 3
coverage:
name: Combine coverage
name: πŸ“Š Combine coverage
runs-on: ubuntu-24.04
needs: test
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: πŸ“₯ Check out code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false
- name: Download coverage data
- name: πŸ“© Download coverage data
id: coverage-data
background: true
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
path: .tox
pattern: .coverage.*
merge-multiple: true
- name: Install the latest version of uv
uses: astral-sh/setup-uv@1c37ad07a6a961277cf70c0d37d6f313000f5884 # v10.3.0
- name: 🐍 Install uv
uses: astral-sh/setup-uv@07a047e608db84b3d8c06cd9a7c7dcc9c355c18e # v10.3.2
with:
version: latest-known
python-version: "3.15"
enable-cache: false
- name: Install tox
- name: πŸ“¦ Install tox
run: uv tool install --python-preference only-managed --python 3.15 tox --with tox-uv
- name: Build package to generate version
- name: πŸ—οΈ Build package to generate version
run: uv build --python 3.15 --python-preference only-managed --wheel . --out-dir dist
- name: Setup coverage tool
- name: πŸ“¦ Set up coverage tool
run: tox -e coverage --notest
env:
UV_PYTHON_PREFERENCE: only-managed
- wait: coverage-data
- name: Combine and report coverage
- name: ⏳ Wait for coverage data
wait: coverage-data
- name: πŸ“Š Combine and report coverage
run: tox -e coverage --skip-pkg-install
env:
UV_PYTHON_PREFERENCE: only-managed
- name: Upload HTML report
- name: πŸ“€ Upload HTML report
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: html-report
path: .tox/htmlcov
check:
name: ${{ matrix.tox_env }} - ${{ matrix.os }}
name: πŸ” ${{ matrix.tox_env }} - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-24.04
- windows-2025
- windows-2025-vs2026
tox_env:
- dev
- type
- docs
- pkg_meta
exclude:
- {os: windows-2025, tox_env: pkg_meta}
- {os: windows-2025-vs2026, tox_env: pkg_meta}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: πŸ“₯ Check out code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false
- name: Install the latest version of uv
uses: astral-sh/setup-uv@1c37ad07a6a961277cf70c0d37d6f313000f5884 # v10.3.0
- name: 🐍 Install uv
uses: astral-sh/setup-uv@07a047e608db84b3d8c06cd9a7c7dcc9c355c18e # v10.3.2
with:
version: latest-known
python-version: "3.15"
enable-cache: false
- name: Install tox
- name: πŸ“¦ Install tox
run: uv tool install --python-preference only-managed --python 3.15 tox --with tox-uv
- name: Setup test suite
- name: πŸ“¦ Set up check suite
run: tox run -vv --notest --skip-missing-interpreters false -e ${{ matrix.tox_env }}
env:
UV_PYTHON_PREFERENCE: only-managed
- name: Run test suite
- name: πŸ§ͺ Run check for ${{ matrix.tox_env }}
run: tox run --skip-pkg-install -e ${{ matrix.tox_env }}
env:
UV_PYTHON_PREFERENCE: only-managed
changelog:
name: πŸ“ News fragment
runs-on: ubuntu-24.04
if: github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'skip news')
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false
- name: Install the latest version of uv
uses: astral-sh/setup-uv@1c37ad07a6a961277cf70c0d37d6f313000f5884 # v10.3.0
with:
python-version: "3.15"
enable-cache: false
- name: Require a news fragment
run: uvx towncrier check --compare-with "origin/${GITHUB_BASE_REF}"
gate:
name: Required checks pass
if: always()
needs: [test, coverage, check, changelog]
name: 🚦 ${{ github.event_name == 'pull_request' && 'Required checks pass' || 'Non-PR checks pass' }}
if: ${{ !cancelled() }} # codespell:ignore cancelled
needs: [test, coverage, check]
runs-on: ubuntu-24.04
steps:
- env:
- name: 🚦 Require all needed jobs to pass
env:
NEEDS_JSON: ${{ toJSON(needs) }}
run: |
jq -e '
all(
to_entries[];
.value.result == "success" or
(.key == "changelog" and .value.result == "skipped")
)
' <<< "$NEEDS_JSON"
run: jq -e 'all(to_entries[]; .value.result == "success")' <<<"$NEEDS_JSON"
41 changes: 41 additions & 0 deletions .github/workflows/codeql.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: πŸ›‘οΈ CodeQL
on:
workflow_dispatch:
push:
branches: ["main"]
pull_request:
schedule:
- cron: "0 9 * * 2"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions: {}
jobs:
analyze:
name: πŸ›‘οΈ Analyze ${{ matrix.language }}
runs-on: ubuntu-26.04
permissions:
contents: read # check out the code to analyze
security-events: write # upload the analysis results to code scanning
strategy:
fail-fast: false
matrix:
language: [actions, python]
steps:
- name: πŸ“₯ Check out code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: πŸ›‘οΈ Initialize CodeQL
uses: github/codeql-action/init@6f2ac81f5cd81fe351a197ba0b00d91d03cd2aee # v4.39.0
with:
languages: ${{ matrix.language }}
build-mode: none
queries: security-extended
config: |
paths-ignore:
- tests
- name: πŸ›‘οΈ Analyze
uses: github/codeql-action/analyze@6f2ac81f5cd81fe351a197ba0b00d91d03cd2aee # v4.39.0
with:
category: "/language:${{ matrix.language }}"
32 changes: 32 additions & 0 deletions .github/workflows/news.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: πŸ“ Changelog
on:
pull_request:
types: [opened, reopened, synchronize, labeled, unlabeled]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
permissions:
contents: read
jobs:
changelog:
name: πŸ“ News fragment
runs-on: ubuntu-26.04
steps:
- name: πŸ“₯ Check out code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false
- name: 🐍 Install uv
uses: astral-sh/setup-uv@07a047e608db84b3d8c06cd9a7c7dcc9c355c18e # v10.3.2
with:
version: latest-known
python-version: "3.15"
enable-cache: false
- name: πŸ“¦ Install locked release tools
uses: tox-dev/github-workflows/install-locked-tools@259a3d3fb578d00517ffb73341fdd463259b0b2f # 6.0.1
with:
groups: release-news
venv: ${{ runner.temp }}/release-tools
- name: πŸ” Validate news fragments
uses: tox-dev/github-workflows/validate-news@259a3d3fb578d00517ffb73341fdd463259b0b2f # 6.0.1
Loading
Loading