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
65 changes: 14 additions & 51 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,20 @@ on:
- "releases"

jobs:
tox:
name: "Tox (${{ matrix.os.name }})"
code:
name:
"Code (${{
(startswith(matrix.runner, 'ubuntu') && 'Linux')
|| (startswith(matrix.runner, 'macos') && 'macOS')
|| (startswith(matrix.runner, 'windows') && 'Windows')
}})"

strategy:
matrix:
os:
- name: "Linux"
runner: "ubuntu-latest"
- name: "macOS"
runner: "macos-latest"
- name: "Windows"
runner: "windows-latest"
runner:
- "ubuntu-latest"
- "macos-latest"
- "windows-latest"

# Each operating system should test all Python interpreters simultaneously.
# This nested-list syntax accomplishes that goal
Expand All @@ -42,49 +44,10 @@ jobs:
- "3.10"
fail-fast: false

runs-on: "${{ matrix.os.runner }}"
steps:
- name: "Checkout the repository"
uses: "actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b" # v4.1.4

- name: "Setup Pythons"
uses: "actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d" # v5.1.0
with:
python-version: "${{
format(
'{0}\n{1}\n{2}',
format('pypy{0}', join(matrix.pypys, '\npypy')),
matrix.cpython-beta,
join(matrix.cpythons, '\n')
)
}}"
allow-prereleases: true

- name: "Detect Pythons"
uses: "./"

- name: "Restore cache"
id: "restore-cache"
uses: "actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319" # v4.0.1
with:
path: |
.tox/
.venv
key: "tox-os=${{ matrix.os.runner }}-hash=${{ hashFiles('.python-identifiers', 'tox.ini') }}"

- name: "Identify .venv path"
shell: "bash"
run: "echo 'venv-path=.venv/${{ runner.os == 'Windows' && 'Scripts' || 'bin' }}' >> $GITHUB_ENV"

- name: "Create a virtual environment"
if: "steps.restore-cache.outputs.cache-hit == false"
run: |
python -m venv .venv
${{ env.venv-path }}/python -m pip install --upgrade pip setuptools wheel
${{ env.venv-path }}/pip install tox
uses: "kurtmckee/github-workflows/.github/workflows/tox.yaml@73024397dba10c866931a1d26cc2a0e7d223472f" # v0.2
with:
config: "${{ toJSON(matrix) }}"

- name: "Run the test suite"
run: "${{ env.venv-path }}/tox"

inputs:
name: "Inputs (${{ matrix.os.name }})"
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ repos:
hooks:
- id: "flake8"
additional_dependencies:
- "flake8-bugbear==24.1.17"
- "flake8-bugbear==24.4.26"

- repo: "https://github.com/editorconfig-checker/editorconfig-checker.python"
rev: "2.7.3"
Expand Down Expand Up @@ -66,7 +66,7 @@ repos:
pass_filenames: false

- repo: "https://github.com/python-jsonschema/check-jsonschema"
rev: "0.28.2"
rev: "0.28.3"
hooks:
- id: "check-github-workflows"
- id: "check-dependabot"
17 changes: 11 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,21 @@ min_version = 4.3.5

envlist =
coverage_erase
py{313, 312, 311, 310, 39, 38, py310, py39, py38}
py{3.13, 3.12, 3.11, 3.10, 3.9, 3.8, py3.10, py3.9, py3.8}
coverage_report

skip_missing_interpreters = True
isolated_build = True
labels =
update=update


[testenv]
package = wheel
wheel_build_env = build_wheel

depends =
py{313, 312, 311, 310, 39, 38, py310, py39, py38}: coverage_erase
py{3.13, 3.12, 3.11, 3.10, 3.9, 3.8, py3.10, py3.9, py3.8}: coverage_erase
deps =
coverage[toml]
pytest
Expand All @@ -33,7 +35,7 @@ commands = coverage erase

[testenv:coverage_report]
depends =
py{313, 312, 311, 310, 39, 38, py310, py39, py38}
py{3.13, 3.12, 3.11, 3.10, 3.9, 3.8, py3.10, py3.9, py3.8}
skipsdist = true
skip_install = true
deps = coverage[toml]
Expand All @@ -44,17 +46,20 @@ commands = coverage report


[testenv:update]
description = Update tool versions
base_python = py3.12
recreate = true
skip_install = true
deps =
pre-commit
upadup
skip_install = true
commands =
# Update pre-commit hooks and additional dependencies.
pre-commit autoupdate
upadup

# Run pre-commit.
pre-commit run --all-files
# Run pre-commit immediately, but ignore its exit code.
- pre-commit run -a


[flake8]
Expand Down