From 3b9965a6bd08be71bc73d2e39ea731f7c0a9a772 Mon Sep 17 00:00:00 2001 From: David Lord Date: Fri, 27 Jan 2023 07:27:05 -0800 Subject: [PATCH] update tox config for v4, update tests workflow --- .github/workflows/tests.yaml | 17 ++++++++++++----- tox.ini | 13 +++++++++---- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 153f5451..996dceaa 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -24,24 +24,31 @@ jobs: fail-fast: false matrix: include: + - {name: '3.11', python: '3.11', tox: py311} + - {name: 'Lowest', python: '3.11', tox: py311-lowest} - {name: '3.10', python: '3.10', tox: py310} - - {name: 'Lowest', python: '3.10', tox: py310-lowest} - {name: '3.9', python: '3.9', tox: py39} - {name: '3.8', python: '3.8', tox: py38} - {name: '3.7', python: '3.7', tox: py37} - - {name: 'Typing', python: '3.10', os: ubuntu-latest, tox: typing} + - {name: 'Typing', python: '3.11', os: ubuntu-latest, tox: typing} steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c + - uses: actions/setup-python@5ccb29d8773c3f3f653e1705f474dfaa8a06a912 with: python-version: ${{ matrix.python }} cache: 'pip' cache-dependency-path: 'pdm.lock' - - uses: actions/cache@v3 + - uses: actions/cache@58c146cc91c5b9e778e71775dfe9bf1442ad9a12 with: path: ~/.cache/pdm key: ${{ matrix.python }}-pdm-${{ hashFiles('pdm.lock') }} restore-keys: ${{ matrix.python }}-pdm- + - name: cache mypy + uses: actions/cache@58c146cc91c5b9e778e71775dfe9bf1442ad9a12 + with: + path: ./.mypy_cache + key: mypy|${{ matrix.python }}|${{ hashFiles('pyproject.toml') }} + if: matrix.tox == 'typing' - run: | pip install pdm pdm config install.cache true diff --git a/tox.ini b/tox.ini index 1941f908..18a5eeb7 100644 --- a/tox.ini +++ b/tox.ini @@ -1,15 +1,16 @@ [tox] envlist = py3{11,10,9,8,7} - pypy3{9,8,7} - py310-lowest + pypy39 + py311-lowest style typing docs skip_missing_interpreters = true -isolated_build = true [testenv] +package = wheel +wheel_build_env = .pkg groups = tests deps = lowest: flask==2.2 @@ -19,12 +20,16 @@ commands = pytest -v --tb=short --basetemp={envtmpdir} {posargs} [testenv:style] groups = pre-commit skip_install = true -commands = pre-commit run --all-files --show-diff-on-failure +commands = pre-commit run --all-files [testenv:typing] +package = wheel +wheel_build_env = .pkg groups = mypy commands = mypy [testenv:docs] +package = wheel +wheel_build_env = .pkg groups = docs commands = sphinx-build -W -b html -d {envtmpdir}/doctrees docs {envtmpdir}/html