From 7c2559ad2d5ccbebd24b1c8d7f30532d3547e9b7 Mon Sep 17 00:00:00 2001 From: Avram Lubkin Date: Thu, 6 Jul 2023 08:40:13 -0400 Subject: [PATCH] Update tests for 2.7 --- .github/workflows/tests.yml | 33 ++++++++++++++++----------------- tox.ini | 8 ++++++-- 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 960d4ff..da16295 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -12,6 +12,7 @@ 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 }} @@ -19,21 +20,22 @@ jobs: 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 @@ -44,8 +46,8 @@ 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 @@ -53,13 +55,8 @@ jobs: - 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: @@ -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 diff --git a/tox.ini b/tox.ini index 7778778..fdf521d 100644 --- a/tox.ini +++ b/tox.ini @@ -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}