Skip to content
Open
Show file tree
Hide file tree
Changes from 3 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
112 changes: 112 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
name: CI

on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]

jobs:
test:
name: ${{ matrix.tox-env }} (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, windows-latest, macos-latest]
tox-env:
- py38-cover
- py38-nocov
- py39-cover
- py39-nocov
- py310-cover
- py310-nocov
- py311-cover
- py311-nocov
- py312-cover
- py312-nocov
- pypy38-cover
- pypy38-nocov
- pypy39-cover
- pypy39-nocov
- pypy310-cover
- pypy310-nocov
include:
- tox-env: py38-cover
python-version: "3.8"
- tox-env: py38-nocov
python-version: "3.8"
- tox-env: py39-cover
python-version: "3.9"
- tox-env: py39-nocov
python-version: "3.9"
- tox-env: py310-cover
python-version: "3.10"
- tox-env: py310-nocov
python-version: "3.10"
- tox-env: py311-cover
python-version: "3.11"
- tox-env: py311-nocov
python-version: "3.11"
- tox-env: py312-cover
python-version: "3.12"
- tox-env: py312-nocov
python-version: "3.12"
- tox-env: pypy38-cover
python-version: "pypy-3.8"
- tox-env: pypy38-nocov
python-version: "pypy-3.8"
- tox-env: pypy39-cover
python-version: "pypy-3.9"
- tox-env: pypy39-nocov
python-version: "pypy-3.9"
- tox-env: pypy310-cover
python-version: "pypy-3.10"
- tox-env: pypy310-nocov
python-version: "pypy-3.10"

steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: x64

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade setuptools wheel
python -m pip install tox tox-gh-actions

- name: Test with tox
env:
TOXENV: ${{ matrix.tox-env }}
run: tox -v

check:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox
- run: tox -e check

docs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox
- run: tox -e docs
80 changes: 16 additions & 64 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,72 +10,24 @@ passenv =

; a generative tox configuration, see: https://tox.wiki/en/latest/user_guide.html#generative-environments
[tox]
envlist =
clean,
check,
docs,
{py38,py39,py310,py311,py312,pypy38,pypy39,pypy310}-{cover,nocov},
report
ignore_basepython_conflict = true
envlist =
py{38,39,310,311,312}
pypy{38,39,310}

[testenv]
basepython =
pypy38: {env:TOXPYTHON:pypy3.8}
pypy39: {env:TOXPYTHON:pypy3.9}
pypy310: {env:TOXPYTHON:pypy3.10}
py38: {env:TOXPYTHON:python3.8}
py39: {env:TOXPYTHON:python3.9}
py310: {env:TOXPYTHON:python3.10}
py311: {env:TOXPYTHON:python3.11}
py312: {env:TOXPYTHON:python3.12}
{bootstrap,clean,check,report,docs,codecov}: {env:TOXPYTHON:python3}
setenv =
PYTHONPATH={toxinidir}/tests
PYTHONUNBUFFERED=yes
passenv =
*
usedevelop =
cover: true
nocov: false
deps =
pytest
cover: pytest-cov
commands =
nocov: {posargs:pytest -vv --ignore=src}
cover: {posargs:pytest --cov --cov-report=term-missing --cov-report=xml -vv}

[testenv:check]
deps =
docutils
check-manifest
pre-commit
readme-renderer
pygments
isort
skip_install = true
pytest>=6.0
pytest-cov
# Add any other test dependencies
pip_pre = true
commands =
python setup.py check --strict --metadata --restructuredtext
check-manifest .
pre-commit run --all-files --show-diff-on-failure
pytest {posargs:tests}

[testenv:docs]
usedevelop = true
deps =
-r{toxinidir}/docs/requirements.txt
commands =
sphinx-build {posargs:-E} -b html docs dist/docs
sphinx-build -b linkcheck docs dist/docs

[testenv:report]
deps =
coverage
skip_install = true
commands =
coverage report
coverage html

[testenv:clean]
commands = coverage erase
skip_install = true
deps =
coverage
[gh-actions]
python =
pypy-3.8: pypy38
3.8: py38
3.9: py39
3.10: py310
3.11: py311
3.12: py312