Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Update CI configuration for PyPy compatibility #47

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 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
61 changes: 61 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: CI

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

jobs:
test:
name: ${{ matrix.python-version }} / ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, windows-latest, macos-latest]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "pypy-3.8", "pypy-3.9", "pypy-3.10"]

steps:
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
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
run: tox --skip-missing-interpreters false

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
65 changes: 36 additions & 29 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -14,68 +14,75 @@ envlist =
clean,
check,
docs,
{py38,py39,py310,py311,py312,pypy38,pypy39,pypy310}-{cover,nocov},
py{38,39,310,311,312}-{cover,nocov},
pypy{38,39,310}-{cover,nocov},
report
ignore_basepython_conflict = true
skip_missing_interpreters = true

[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}
py38: python3.8
py39: python3.9
py310: python3.10
py311: python3.11
py312: python3.12
pypy38: pypy3.8
pypy39: pypy3.9
pypy310: pypy3.10
{clean,check,docs,report}: python3
setenv =
PYTHONPATH={toxinidir}/tests
PYTHONUNBUFFERED=yes
cover: SETUPPY_CFLAGS=-coverage
passenv =
*
usedevelop =
cover: true
nocov: false
deps =
pytest
cover: pytest-cov
pytest>=6.0
pytest-cov
commands =
nocov: {posargs:pytest -vv --ignore=src}
cover: {posargs:pytest --cov --cov-report=term-missing --cov-report=xml -vv}
{posargs:pytest --cov --cov-report=term-missing -vv tests}

[testenv:check]
deps =
docutils
check-manifest
pre-commit
flake8
readme-renderer
pygments
isort
skip_install = true
commands =
python setup.py check --strict --metadata --restructuredtext
check-manifest .
pre-commit run --all-files --show-diff-on-failure
check-manifest {toxinidir}
flake8 src tests setup.py
isort --verbose --check-only --diff --filter-files src tests setup.py

[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:clean]
commands = coverage erase
skip_install = true
deps = coverage

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

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