From f995fba9a66a820c7f06dd86f39d40d0ae18acaa Mon Sep 17 00:00:00 2001 From: Jeremy Stanley Date: Thu, 11 Mar 2021 19:50:40 +0000 Subject: [PATCH] Update testing to Python 3.9 and linters In preparation for an upcoming release, add testing for latest Python (3.9). Switch tox to use Python 3 by default, and rename the testenv for flake8 from pep8 to linters, consistent with other tools and libraries OpenDev maintains. Update to a newer hacking plugin, which will use newer flake8 as well. Ignore rules about line breaks around comparison operators, as well as those related to ambiguous variable names, at least for now. Also build distribution artifacts on a more recent platform so we get newer Setuptools with support for the latest package metadata, in preparation for a coming change to update that. Change-Id: I2130d66fc9aadaa9fe09635b59475be71938132e --- .zuul.yaml | 17 ++++++++++++----- test-requirements.txt | 2 +- tox.ini | 8 +++++--- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/.zuul.yaml b/.zuul.yaml index 49e6f97..57e537c 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -60,19 +60,25 @@ - publish-opendev-tox-docs check: jobs: - - tox-pep8 + - tox-linters - tox-py27 - tox-py35: nodeset: ubuntu-xenial - - build-python-release + - tox-py39: + nodeset: ubuntu-focal + - build-python-release: + nodeset: ubuntu-focal - gear-build-opendev-image gate: jobs: - - tox-pep8 + - tox-linters - tox-py27 - tox-py35: nodeset: ubuntu-xenial - - build-python-release + - tox-py39: + nodeset: ubuntu-focal + - build-python-release: + nodeset: ubuntu-focal - gear-upload-opendev-image promote: jobs: @@ -80,7 +86,8 @@ - gear-promote-opendev-image release: jobs: - - opendev-release-python + - opendev-release-python: + nodeset: ubuntu-focal - upload-docker-image: secrets: name: docker_credentials diff --git a/test-requirements.txt b/test-requirements.txt index 45cf7b4..9a33e71 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,4 +1,4 @@ -hacking>=0.12.0,!=0.13.0,<0.14 # Apache-2.0 +hacking>=2.0.0,<2.1.0 # Apache-2.0 coverage>=3.6 fixtures>=0.3.12 diff --git a/tox.ini b/tox.ini index 5984ff7..27a7c09 100644 --- a/tox.ini +++ b/tox.ini @@ -1,11 +1,13 @@ [tox] minversion = 1.6 skipsdist = True -envlist = py34,py35,py27,pep8 +envlist = py3,py27,linters +ignore_basepython_conflict = true [testenv] setenv = VIRTUAL_ENV={envdir} usedevelop = True +basepython = python3 install_command = pip install {opts} {packages} deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt @@ -15,7 +17,7 @@ commands = [tox:jenkins] sitepackages = True -[testenv:pep8] +[testenv:linters] commands = flake8 [testenv:cover] @@ -30,7 +32,7 @@ commands = {posargs} exclude = .venv,.tox,dist,doc,*.egg show-source = true # E123, E125, E129 and H ignored intentionally in this code-base -ignore = E123,E125,E129,H +ignore = E123,E125,E129,E741,W504,H [testenv:docs] basepython = python3