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
This commit is contained in:
Jeremy Stanley 2021-03-11 19:50:40 +00:00 committed by Guillaume Chauvel
parent 66ba8442dc
commit f995fba9a6
3 changed files with 18 additions and 9 deletions

View File

@ -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

View File

@ -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

View File

@ -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