Cleanup tox.ini and zuul files from older releases

tox changes:
 - remove python2.7 and python3.6 unit test targets
from tox.ini since only python 3.9 is supported
 - remove the (junk) functional target from tox.ini
 - fix yamllint target in tox.ini so it will actually
 process files. Also added a basic yammlint settings file.
 - nova-api-proxy tox jobs are now setup for py39
 - Removed the py27 limitations from requirements files.
 - Removed the upper limits for pylint and astroid.
 - Added additional suppressions for new pylint codes.

Zuul changes:
 - remove py27 job from zuul
 - remove the unused (never working) devstack job
 - set the parent zuul jobs to be the jobs defined under
openstack-zuul-jobs rather than just zuul-jobs
 - Specify debian-bullseye (python3.9) as the nodeset.
  ubuntu-jammy iss python3.10, ubuntu-focal is python3.8
 - override tox constraints file to use the STX constraints
   This means starlingx/root needs to be a required project
 - Removed the nodeset from the pep8 jobs.

Note: these changes do not affect runtime for NFV.

Test Plan:
  Pass tox in nfv directory of (debian) dev env.
  Pass tox in nova-api-proxy directory of (debian) dev env.
  build-pkgs -p nfv

Story: 2010531
Task: 47146

Signed-off-by: Al Bailey <al.bailey@windriver.com>
Change-Id: I6dad77bec40e9b64a9314b237270af046728efb3
This commit is contained in:
Al Bailey 2022-12-14 22:01:28 +00:00
parent bfded2ded6
commit e6114addac
9 changed files with 78 additions and 143 deletions

8
.yamllint Normal file
View File

@ -0,0 +1,8 @@
---
extends: default
rules:
# 80 chars should be enough, but don't fail if a line is longer
line-length:
max: 80
level: warning

View File

@ -8,7 +8,6 @@
jobs:
- openstack-tox-linters
- nfv-tox-pep8
- nfv-tox-py27
- nfv-tox-py39
- nfv-tox-pylint
- nova-api-proxy-tox-pep8
@ -17,7 +16,6 @@
jobs:
- openstack-tox-linters
- nfv-tox-pep8
- nfv-tox-py27
- nfv-tox-py39
- nfv-tox-pylint
- nova-api-proxy-tox-pep8
@ -26,51 +24,37 @@
jobs:
- stx-nfv-upload-git-mirror
- job:
name: nfv-tox-py27
parent: tox
description: Run py27 for nfv
nodeset: ubuntu-xenial
required-projects:
- starlingx/fault
vars:
tox_envlist: py27
tox_extra_args: -c nfv/tox.ini
- job:
name: nfv-tox-py39
parent: tox-py39
parent: openstack-tox-py39
description: Run py39 for nfv
nodeset: debian-bullseye
required-projects:
- starlingx/fault
- starlingx/root
vars:
tox_envlist: py39
tox_extra_args: -c nfv/tox.ini
bindep_profile: test py39
python_version: 3.9
tox_constraints_file: '{{ ansible_user_dir }}/src/opendev.org/starlingx/root/build-tools/requirements/debian/upper-constraints.txt'
- job:
name: nfv-tox-pep8
parent: tox
parent: openstack-tox-pep8
description: Run pep8 for nfv
required-projects:
- starlingx/fault
vars:
tox_envlist: pep8
tox_extra_args: -c nfv/tox.ini
- job:
name: nfv-tox-pylint
parent: tox
description: Run pylint for nfv
nodeset: ubuntu-xenial
nodeset: debian-bullseye
required-projects:
- starlingx/fault
- starlingx/root
vars:
tox_envlist: pylint
tox_extra_args: -c nfv/tox.ini
tox_constraints_file: '{{ ansible_user_dir }}/src/opendev.org/starlingx/root/build-tools/requirements/debian/upper-constraints.txt'
- job:
name: nova-api-proxy-tox-pep8
@ -84,42 +68,14 @@
name: nova-api-proxy-tox-pylint
parent: tox
description: Run pylint for nova-api-proxy
nodeset: ubuntu-xenial
nodeset: debian-bullseye
required-projects:
- starlingx/root
vars:
tox_envlist: pylint
tox_extra_args: -c nova-api-proxy/tox.ini
tox_constraints_file: '{{ ansible_user_dir }}/src/opendev.org/starlingx/root/build-tools/requirements/debian/upper-constraints.txt'
- job:
name: flock-devstack-nfv
parent: flock-devstack-base-min
required-projects:
- openstack/barbican
- openstack/python-barbicanclient
- starlingx/config
- starlingx/fault
- starlingx/integ
- starlingx/metal
- starlingx/update
vars:
tox_envlist: functional
devstack_services:
# StarlingX services
cgtsclient: true
fm-common: true
fm-api: true
fm-rest-api: true
fm-mgr: true
nfv-common: true
nfv-vim: true
nfv-client: true
devstack_plugins:
barbican: https://opendev.org/openstack/barbican
config: https://opendev.org/starlingx/config
fault: https://opendev.org/starlingx/fault
integ: https://opendev.org/starlingx/integ
metal: https://opendev.org/starlingx/metal
nfv: https://opendev.org/starlingx/nfv
update: https://opendev.org/starlingx/update
- job:
name: stx-nfv-upload-git-mirror
parent: upload-git-mirror

View File

@ -117,21 +117,33 @@ enable=E1603,E1609,E1610,E1602,E1606,E1608,E1607,E1605,E1604,E1601,E1611,W1652,
# W0401 wildcard-import
# W0404 reimported
# W0511 fixme
# W0602 global-variable-not-assigned
# W0603 Using the global statement warning
# W0612 Unused variable warning
# W0613 Unused argument warning
# W0621 redefined-outer-name
# W0622 redefined-builtin
# W0703 broad except warning
# W0706: The except handler raises immediately (try-except-raise)
# W0706 The except handler raises immediately (try-except-raise)
# W0707 raise-missing-from
# W1310 format-string-without-interpolation
# W1401 anomalous-backslash-in-string
# W1505: Using deprecated method getargspec() (deprecated-method)
# E0012: pylint for python3 does not support inline deprecation
# Disable Python3 checkers:
# W1618: no-absolute-import
disable=C, R, E0012, W0120, W0125, W0212, W0221, W0223, W0231, W0235,
W0401, W0404, W0511, W0603, W0612, W0613, W0621, W0622, W0703, W1401,
W0107, W0706, W1505, W1618
# W1406 redundant-u-string-prefix
# W1505 Using deprecated method getargspec() (deprecated-method)
# W1514 unspecified-encoding
# W1618 no-absolute-import (Python3 checker)
# W0237 arguments-renamed
# W4904 deprecated-class
# W4905 deprecated-decorator
# E0012 pylint for python3 does not support inline deprecation
# E1101 no-member
# E1111 assignment-from-no-return
# E1120 no-value-for-parameter
# E1121 too-many-function-args
disable=C, R, W0120, W0125, W0212, W0221, W0223, W0231, W0235,
W0401, W0404, W0511, W0602, W0603, W0612, W0613, W0621, W0622, W0703, W1401,
W0107, W0706, W0707, W1310, W1406, W1505, W1514, W1618, W0237, W4904, W4905,
E0012, E1101, E1111, E1120, E1121
[REPORTS]
# Set the output format. Available formats are text, parseable, colorized, msvs

View File

@ -2,12 +2,9 @@
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.
hacking>=1.1.0,<=2.0.0 # Apache-2.0
astroid<2.0;python_version<"3.0" # GPLv2
astroid<= 2.2.5;python_version>="3.0" # GPLv2
bandit<1.6.0;python_version>="3.0"
bandit<1.6.0
coverage>=3.6
fixtures>=3.0.0 # Apache-2.0/BSD
mock>=2.0.0 # BSD
pylint<2.1.0;python_version<"3.0" # GPLv2
pylint<2.4.0;python_version>="3.0" # GPLv2
pylint
testtools>=2.2.0 # MIT

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2018 Wind River Systems, Inc.
# Copyright (c) 2018-2023 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
@ -10,18 +10,18 @@
# and then run "tox" from this directory.
[tox]
toxworkdir = /tmp/{env:USER}_nfvtox
envlist = pep8,py27,py36,py39,pylint
envlist = pep8,py39,pylint
skipsdist = True
stxdir = {toxinidir}/../..
[testenv]
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
install_command = pip install \
-c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/stable/stein/upper-constraints.txt} \
-c{env:TOX_CONSTRAINTS_FILE:https://opendev.org/starlingx/root/raw/branch/master/build-tools/requirements/debian/upper-constraints.txt} \
{opts} {packages}
allowlist_externals = cp
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
[nfv]
nfv_base_dir = .
@ -91,7 +91,6 @@ enable-extensions = H106,H203
max-line-length = 185
[testenv:pep8]
basepython = python3
usedevelop = False
skip_install = True
deps = -r{toxinidir}/test-requirements.txt
@ -100,7 +99,6 @@ commands =
[testenv:pylint]
basepython = python3
deps = {[nfv]deps}
-r{toxinidir}/test-requirements.txt
{[nfv]nfv_test_dir}/nfv_scenario_tests
@ -126,40 +124,9 @@ exclude = ./nfv-docs,./nfv-tests,./nfv-debug-tools,unit_test
[testenv:bandit]
deps = {[nfv]deps}
-r{toxinidir}/test-requirements.txt
basepython = python3
commands = bandit --ini tox.ini -f txt -r {[nfv]nfv_base_dir}
[testenv:py27]
basepython = python2.7
deps = {[nfv]deps}
coverage
fixtures
mock
stestr
testtools
setenv = PYTHONDONTWRITEBYTECODE=True
commands = cp -v {[nfv]nfv_base_dir}/nfv-tests/nfv_unit_tests/test_data/nfv_vim_db_stx_19.12 {envdir}/
stestr --test-path={[nfv]nfv_base_dir}/nfv-tests/nfv_unit_tests/tests run '{posargs}'
stestr slowest
[testenv:py36]
basepython = python3.6
deps = {[nfv]deps}
coverage
fixtures
mock
stestr
testtools
setenv = PYTHONDONTWRITEBYTECODE=True
commands = cp -v {[nfv]nfv_base_dir}/nfv-tests/nfv_unit_tests/test_data/nfv_vim_db_stx_19.12 {envdir}/
stestr --test-path={[nfv]nfv_base_dir}/nfv-tests/nfv_unit_tests/tests run '{posargs}'
stestr slowest
[testenv:py39]
basepython = python3.9
install_command = pip install \
-c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/starlingx/root/raw/branch/master/build-tools/requirements/debian/upper-constraints.txt} \
{opts} {packages}
deps = {[nfv]deps}
coverage
fixtures
@ -173,7 +140,6 @@ commands = cp -v {[nfv]nfv_base_dir}/nfv-tests/nfv_unit_tests/test_data/nfv_vim_
[testenv:cover]
basepython = python3
deps = {[nfv]deps}
coverage
fixtures

View File

@ -106,17 +106,23 @@ enable=E1603,E1609,E1610,E1602,E1606,E1608,E1607,E1605,E1604,E1601,E1611,W1652,
# can either give multiple identifier separated by comma (,) or put this option
# multiple time (only on the command line, not in the configuration file where
# it should appear only once).
# E1101 no-member
# E1121: Too many positional arguments for function call
# W0404 reimported
# W0601 Global variable %r undefined at the module level
# W0602 global-variable-not-assigned
# W0603 Using the global statement warning
# W0613 Unused argument warning
# W0621 Redefining name %r from outer scope
# W0703 broad except warning
# Disable Python3 checkers:
# W1618: no-absolute-import
disable=C, R, E1101, E1121, W0404, W0601, W0603, W0613, W0621, W0703, W1618
# W0707 raise-missing-from
# W1310 format-string-without-interpolation
# W1514 unspecified-encoding
# W1618: no-absolute-import (py3 enable from above)
# E1101 no-member
# E1121: Too many positional arguments for function call
# E1128 assignment-from-none
disable=C, R,
W0404, W0601, W0602, W0603, W0613, W0621, W0703, W0707, W1310, W1514, W1618,
E1101, E1121, E1128,
[REPORTS]

View File

@ -2,11 +2,8 @@
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.
hacking>=1.1.0,<=2.0.0 # Apache-2.0
astroid<2.0;python_version<"3.0" # GPLv2
astroid<= 2.2.5;python_version>="3.0" # GPLv2
bandit<1.6.0;python_version>="3.0"
coverage>=3.6
fixtures>=3.0.0 # Apache-2.0/BSD
mock>=2.0.0 # BSD
pylint<2.1.0;python_version<"3.0" # GPLv2
pylint<2.4.0;python_version>="3.0" # GPLv2
pylint

View File

@ -1,13 +1,13 @@
[tox]
envlist = pep8,pylint
minversion = 2.3
minversion = 2.9
skipsdist = True
[testenv]
basepython = python3
sitepackages = False
install_command = pip install \
-c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/stable/stein/upper-constraints.txt} \
-c{env:TOX_CONSTRAINTS_FILE:https://opendev.org/starlingx/root/raw/branch/master/build-tools/requirements/debian/upper-constraints.txt} \
{opts} {packages}
setenv = VIRTUAL_ENV={envdir}
OS_STDOUT_CAPTURE=1
@ -43,7 +43,6 @@ commands =
flake8
[testenv:pylint]
basepython = python2.7
deps=
-r{toxinidir}/test-requirements.txt
eventlet

44
tox.ini
View File

@ -1,47 +1,49 @@
[tox]
envlist = linters
minversion = 2.3
minversion = 2.9
skipsdist = True
[testenv]
allowlist_externals = find
basepython = python3
commands = find {toxinidir} -type f -not -path '{toxinidir}/.tox/*' -not -path '*/__pycache__/*' -name '*.py[c|o]' -delete
deps = -r{toxinidir}/test-requirements.txt
install_command = pip install -U \
-c{env:TOX_CONSTRAINTS_FILE:https://opendev.org/starlingx/root/raw/branch/master/build-tools/requirements/debian/upper-constraints.txt} \
{opts} {packages}
setenv = VIRTUAL_ENV={envdir}
OS_STDOUT_CAPTURE=1
OS_STDERR_CAPTURE=1
OS_TEST_TIMEOUT=60
PYTHONDONTWRITEBYTECODE=True
install_command = pip install -U {opts} {packages}
commands = find {toxinidir} -type f -not -path '{toxinidir}/.tox/*' -not -path '*/__pycache__/*' -name '*.py[c|o]' -delete
deps = -r{toxinidir}/test-requirements.txt
allowlist_externals = find
[testenv:venv]
basepython = python3
commands = {posargs}
[testenv:flake8]
basepython = python3
description = Dummy environment to allow flake8 to be run in subdir tox
[testenv:pep8]
basepython = python3
description = Dummy environment to allow pep8 to be run in subdir tox
[testenv:pylint]
basepython = python2.7
description = Dummy environment to allow pylint to be run in subdir tox
[testenv:linters]
basepython = python3
[testenv:yamllint]
allowlist_externals = bash
commands =
bash -c "find {toxinidir} \
\( -name middleware/io-monitor/recipes-common/io-monitor/io-monitor/io_monitor/test-tools/yaml/* -prune \) \
-o \( -name .tox -prune \) \
-o -type f -name '*.yaml' \
-print0 | xargs -0 yamllint"
bash -c "find {toxinidir} \
-name .tox -prune \
-o -type f -name '*.yaml' \
-print0 | xargs -0 yamllint -f parsable \
-c {toxinidir}/.yamllint"
[testenv:linters]
allowlist_externals = bash
commands =
{[testenv:yamllint]commands}
[testenv:docs]
basepython = python3
deps = -r{toxinidir}/doc/requirements.txt
commands =
rm -rf doc/build
@ -49,7 +51,6 @@ commands =
allowlist_externals = rm
[testenv:releasenotes]
basepython = python3
deps = -r{toxinidir}/doc/requirements.txt
commands =
rm -rf releasenotes/build
@ -59,22 +60,15 @@ allowlist_externals =
reno
[testenv:newnote]
basepython = python3
# Re-use the releasenotes venv
envdir = {toxworkdir}/releasenotes
deps = -r{toxinidir}/doc/requirements.txt
commands = reno new {posargs}
[testenv:api-ref]
basepython = python3
deps =
-r{toxinidir}/doc/requirements.txt
commands =
rm -rf api-ref/build
sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html
allowlist_externals = rm
[testenv:functional]
basepython = python3
allowlist_externals = cat
commands = cat /etc/fm/fm.conf