Merge "Cleanup tox and zuul"

This commit is contained in:
Zuul 2023-03-01 17:42:34 +00:00 committed by Gerrit Code Review
commit 4c765c3550
5 changed files with 36 additions and 64 deletions

View File

@ -5,7 +5,6 @@
check: check:
jobs: jobs:
- openstack-tox-linters - openstack-tox-linters
- k8sapp-platform-tox-py27
- k8sapp-platform-tox-py39 - k8sapp-platform-tox-py39
- k8sapp-platform-tox-flake8 - k8sapp-platform-tox-flake8
- k8sapp-platform-tox-pylint - k8sapp-platform-tox-pylint
@ -13,7 +12,6 @@
gate: gate:
jobs: jobs:
- openstack-tox-linters - openstack-tox-linters
- k8sapp-platform-tox-py27
- k8sapp-platform-tox-py39 - k8sapp-platform-tox-py39
- k8sapp-platform-tox-flake8 - k8sapp-platform-tox-flake8
- k8sapp-platform-tox-pylint - k8sapp-platform-tox-pylint
@ -22,26 +20,9 @@
jobs: jobs:
- stx-platform-armada-app-upload-git-mirror - stx-platform-armada-app-upload-git-mirror
- job:
name: k8sapp-platform-tox-py27
parent: tox
description: |
Run py27 test for k8sapp_platform
nodeset: ubuntu-xenial
required-projects:
- starlingx/config
- starlingx/fault
- starlingx/update
- starlingx/utilities
files:
- python-k8sapp-platform/*
vars:
tox_envlist: py27
tox_extra_args: -c python-k8sapp-platform/k8sapp_platform/tox.ini
- job: - job:
name: k8sapp-platform-tox-py39 name: k8sapp-platform-tox-py39
parent: tox-py39 parent: openstack-tox-py39
description: | description: |
Run py39 test for k8sapp_platform Run py39 test for k8sapp_platform
nodeset: debian-bullseye nodeset: debian-bullseye
@ -50,19 +31,19 @@
- starlingx/fault - starlingx/fault
- starlingx/update - starlingx/update
- starlingx/utilities - starlingx/utilities
- starlingx/root
files: files:
- python-k8sapp-platform/* - python-k8sapp-platform/*
vars: vars:
tox_envlist: py39
python_version: 3.9
tox_extra_args: -c python-k8sapp-platform/k8sapp_platform/tox.ini tox_extra_args: -c python-k8sapp-platform/k8sapp_platform/tox.ini
tox_constraints_file: '{{ ansible_user_dir }}/src/opendev.org/starlingx/root/build-tools/requirements/debian/upper-constraints.txt'
- job: - job:
name: k8sapp-platform-tox-flake8 name: k8sapp-platform-tox-flake8
parent: tox parent: tox
description: | description: |
Run flake8 test for k8sapp_platform Run flake8 test for k8sapp_platform
nodeset: ubuntu-focal nodeset: debian-bullseye
files: files:
- python-k8sapp-platform/* - python-k8sapp-platform/*
vars: vars:
@ -74,24 +55,26 @@
parent: tox parent: tox
description: | description: |
Run pylint test for k8sapp_platform Run pylint test for k8sapp_platform
nodeset: ubuntu-xenial nodeset: debian-bullseye
required-projects: required-projects:
- starlingx/config - starlingx/config
- starlingx/fault - starlingx/fault
- starlingx/update - starlingx/update
- starlingx/utilities - starlingx/utilities
- starlingx/root
files: files:
- python-k8sapp-platform/* - python-k8sapp-platform/*
vars: vars:
tox_envlist: pylint tox_envlist: pylint
tox_extra_args: -c python-k8sapp-platform/k8sapp_platform/tox.ini tox_extra_args: -c python-k8sapp-platform/k8sapp_platform/tox.ini
tox_constraints_file: '{{ ansible_user_dir }}/src/opendev.org/starlingx/root/build-tools/requirements/debian/upper-constraints.txt'
- job: - job:
name: k8sapp-platform-tox-bandit name: k8sapp-platform-tox-bandit
parent: tox parent: tox
description: | description: |
Run bandit test for k8sapp_platform Run bandit test for k8sapp_platform
nodeset: ubuntu-focal nodeset: debian-bullseye
files: files:
- python-k8sapp-platform/* - python-k8sapp-platform/*
vars: vars:

View File

@ -147,6 +147,7 @@ enable=E1603,E1609,E1610,E1602,E1606,E1608,E1607,E1605,E1604,E1601,E1611,W1652,
# W0402: deprecated-module # W0402: deprecated-module
# W0403: relative-import # W0403: relative-import
# W0404: reimported # W0404: reimported
# W0602: global-variable-not-assigned
# W0603: global-statement # W0603: global-statement
# W0612: unused-variable # W0612: unused-variable
# W0613: unused-argument # W0613: unused-argument
@ -154,28 +155,38 @@ enable=E1603,E1609,E1610,E1602,E1606,E1608,E1607,E1605,E1604,E1601,E1611,W1652,
# W0622: redefined-builtin # W0622: redefined-builtin
# W0631: undefined-loop-variable # W0631: undefined-loop-variable
# W0632: unbalanced-tuple-unpacking # W0632: unbalanced-tuple-unpacking
# W0701: bad-except-order # W0701: bad-except-order
# W0703: broad-except # W0706: The except handler raises immediately (try-except-raise)
# W0707: raise-missing-from
# W0719: broad-exception-raised
# W1113: keyword-arg-before-vararg # W1113: keyword-arg-before-vararg
# W1201: logging-not-lazy # W1201: logging-not-lazy
# W1401: anomalous-backslash-in-string # W1401: anomalous-backslash-in-string
# W1505: deprecated-method # 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
# All these errors should be fixed: # All these errors should be fixed:
# E0012: pylint for python3 does not support inline deprecation
# E0213: no-self-argument # E0213: no-self-argument
# E0401: import-error # E0401: import-error
# E0604: invalid-all-object # E0604: invalid-all-object
# E0633: unpacking-non-sequence # E0633: unpacking-non-sequence
# E0701: bad-except-order # E0701: bad-except-order
# E1101: no-member
# E1102: not-callable # E1102: not-callable
# E1111: assignment-from-no-return
# E1120: no-value-for-parameter # E1120: no-value-for-parameter
# E1121: too-many-function-args # E1121: too-many-function-args
# Disable Python3 checkers:
# W1618: no-absolute-import
disable=C, R, fixme, W0101, W0105, W0106, W0107, W0108, W0110, W0123, W0150, disable=C, R, fixme, W0101, W0105, W0106, W0107, W0108, W0110, W0123, W0150,
W0201, W0211, W0212, W0221, W0223, W0231, W0235, W0311, W0402, W0403, W0201, W0211, W0212, W0221, W0223, W0231, W0235, W0311, W0402, W0403,
W0404, W0603, W0612, W0613, W0621, W0622, W0631, W0632, W0701, W0703, W0404, W0602, W0603, W0612, W0613, W0621, W0622, W0631, W0632, W0701,
W1113, W1201, W1401, W1505, W1618, W0706, W0707, W0719, W1113, W1201, W1401, W1406, W1505, W1514, W1618,
E0213, E0401, E0604, E0633, E0701, E1102, E1120, E1121 W0237, W4904, W4905, E0012, E0213, E0401, E0604, E0633, E0701, E1101,
E1102, E1111, E1120, E1121
[REPORTS] [REPORTS]
# Set the output format. Available formats are text, parseable, colorized, msvs # Set the output format. Available formats are text, parseable, colorized, msvs

View File

@ -14,8 +14,6 @@ classifier =
License :: OSI Approved :: Apache Software License License :: OSI Approved :: Apache Software License
Operating System :: POSIX :: Linux Operating System :: POSIX :: Linux
Programming Language :: Python Programming Language :: Python
Programming Language :: Python :: 2
Programming Language :: Python :: 2.7
Programming Language :: Python :: 3 Programming Language :: Python :: 3
Programming Language :: Python :: 3.4 Programming Language :: Python :: 3.4
Programming Language :: Python :: 3.5 Programming Language :: Python :: 3.5

View File

@ -1,5 +1,5 @@
[tox] [tox]
envlist = flake8,py27,py36,py39,pylint,bandit envlist = flake8,py39,pylint,bandit
minversion = 1.6 minversion = 1.6
# skipsdist = True # skipsdist = True
#,pip-missing-reqs #,pip-missing-reqs
@ -10,6 +10,8 @@ stxdir = {toxinidir}/../../..
distshare={toxworkdir}/.tox/distshare distshare={toxworkdir}/.tox/distshare
[testenv] [testenv]
basepython = python3
# enabling usedevelop results in py27 develop-inst: # enabling usedevelop results in py27 develop-inst:
# Exception: Versioning for this project requires either an sdist tarball, # Exception: Versioning for this project requires either an sdist tarball,
# or access to an upstream git repository. # or access to an upstream git repository.
@ -24,7 +26,7 @@ allowlist_externals = bash
install_command = pip install --use-deprecated legacy-resolver \ install_command = pip install --use-deprecated legacy-resolver \
-v -v -v \ -v -v -v \
-c{toxinidir}/upper-constraints.txt \ -c{toxinidir}/upper-constraints.txt \
-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} {opts} {packages}
# Note the hash seed is set to 0 until can be tested with a # Note the hash seed is set to 0 until can be tested with a
@ -105,27 +107,8 @@ deps = -r{toxinidir}/test-requirements.txt
commands = commands =
flake8 {posargs} . flake8 {posargs} .
[testenv:py27]
basepython = python2.7
commands =
{[testenv]commands}
stestr run {posargs}
stestr slowest
[testenv:py36]
basepython = python3.6
commands =
{[testenv]commands}
stestr run {posargs}
stestr slowest
[testenv:py39] [testenv:py39]
basepython = python3.9 basepython = python3.9
install_command = pip install --use-deprecated legacy-resolver \
-v -v -v \
-c{toxinidir}/upper-constraints.txt \
-c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/starlingx/root/raw/branch/master/build-tools/requirements/debian/upper-constraints.txt} \
{opts} {packages}
commands = commands =
{[testenv]commands} {[testenv]commands}
stestr run {posargs} stestr run {posargs}
@ -173,21 +156,18 @@ skips = B101,B103,B104,B105,B108,B110,B303,B307,B310,B311,B314,B318,B320,B404,B4
exclude = tests exclude = tests
[testenv:bandit] [testenv:bandit]
basepython = python3
deps = -r{toxinidir}/test-requirements.txt deps = -r{toxinidir}/test-requirements.txt
bandit bandit
commands = bandit --ini tox.ini -n 5 -r k8sapp_platform commands = bandit --ini tox.ini -n 5 -r k8sapp_platform
[testenv:pylint] [testenv:pylint]
basepython = python2.7
deps = {[testenv]deps} deps = {[testenv]deps}
pylint pylint
commands = commands =
pylint {posargs} k8sapp_platform --rcfile=./pylint.rc pylint {posargs} k8sapp_platform --rcfile=./pylint.rc
[testenv:cover] [testenv:cover]
basepython = python2.7
deps = {[testenv]deps} deps = {[testenv]deps}
setenv = {[testenv]setenv} setenv = {[testenv]setenv}
PYTHON=coverage run --parallel-mode PYTHON=coverage run --parallel-mode

10
tox.ini
View File

@ -1,11 +1,14 @@
[tox] [tox]
envlist = linters envlist = linters
minversion = 2.3 minversion = 2.9
skipsdist = True skipsdist = True
sitepackages=False sitepackages=False
[testenv] [testenv]
install_command = pip install -U {opts} {packages} basepython = python3
install_command = pip install -U \
{opts} {packages} \
-c{env:TOX_CONSTRAINTS_FILE:https://opendev.org/starlingx/root/raw/branch/master/build-tools/requirements/debian/upper-constraints.txt}
setenv = setenv =
VIRTUAL_ENV={envdir} VIRTUAL_ENV={envdir}
OS_STDOUT_CAPTURE=1 OS_STDOUT_CAPTURE=1
@ -35,13 +38,10 @@ commands =
{[testenv:bashate]commands} {[testenv:bashate]commands}
[testenv:flake8] [testenv:flake8]
basepython = python3
description = Dummy environment to allow flake8 to be run in subdir tox description = Dummy environment to allow flake8 to be run in subdir tox
[testenv:pylint] [testenv:pylint]
basepython = python3
description = Dummy environment to allow pylint to be run in subdir tox description = Dummy environment to allow pylint to be run in subdir tox
[testenv:bandit] [testenv:bandit]
basepython = python3
description = Dummy environment to allow bandit to be run in subdir tox description = Dummy environment to allow bandit to be run in subdir tox