Skip to content

Commit

Permalink
Update tests for 2.7
Browse files Browse the repository at this point in the history
  • Loading branch information
avylove committed Jul 6, 2023
1 parent 3ff99aa commit 7c2559a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 19 deletions.
33 changes: 16 additions & 17 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,30 @@ jobs:

Tests:
runs-on: ${{ matrix.os || 'ubuntu-latest' }}
container: ${{ matrix.container }}
name: ${{ startsWith(matrix.toxenv, 'py') && matrix.python-version || format('{0} ({1})', matrix.toxenv, matrix.python-version) }} ${{ matrix.optional && '[OPTIONAL]' }}
continue-on-error: ${{ matrix.optional || false }}

strategy:
fail-fast: false

matrix:
python-version: ['3.11']
toxenv: [lint, docs, coverage]
python-version: ['3.7', '3.8', '3.9', '3.10']
include:

- python-version: '3.10'
toxenv: py310
- python-version: '3.11'
toxenv: lint

- python-version: '3.9'
toxenv: py39
- python-version: '3.11'
toxenv: docs

- python-version: '3.8'
toxenv: py38
- python-version: '3.12-dev'
optional: true
toxenv: py312
toxpython: '3.12'

- python-version: '3.7'
toxenv: py37
- python-version: '3.11'
toxenv: coverage

- python-version: '3.6'
toxenv: py36
Expand All @@ -44,22 +46,17 @@ jobs:
os: ubuntu-20.04

- python-version: '2.7'
container: {image: 'python:2.7.18-buster'}
toxenv: py27
os: ubuntu-20.04

- python-version: pypy-2.7
toxenv: pypy27

- python-version: pypy-3.9
toxenv: pypy39

- python-version: '3.12-dev'
optional: true
toxenv: py312
toxpython: '3.12'

env:
TOXENV: ${{ matrix.toxenv }}
TOXENV: ${{ matrix.toxenv || format('py{0}', matrix.python-version) }}
TOXPYTHON: python${{ matrix.toxpython || matrix.python-version }}

steps:
Expand All @@ -69,6 +66,8 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
if: ${{ matrix.python-version != '2.7' }}


- name: Install tox
run: pip install tox
Expand Down
8 changes: 6 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
[tox]
requires =
# Pin virtualenv to the last version supporting 2.7 and 3.6
virtualenv<=20.21.1
ignore_basepython_conflict = True
envlist =
lint
copyright
coverage
docs
PY3{10,9,8,7,6,5}
PY3{12,10,9,8,7,6,5}
py27
pypy{27,39}

[testenv]
basepython = python3.11
usedevelop = True
download=True
deps =
pypy27,py27: unittest2
pypy27,py27,py2.7: unittest2

commands =
{envpython} -m unittest discover -s {toxinidir}/tests {posargs}
Expand Down

0 comments on commit 7c2559a

Please sign in to comment.