Zuul: Fix test-requirements and satisfy pep8 requirements

Fixes:
- Missing comma in test-requirements.txt
- pep8 requires base classes to inherit from 'object'

Test Plan:
pass - run tox

Closes-Bug: 2070937

Change-Id: Ibe659bd0a02a7ca047d4406b9555a2419fdb915f
Signed-off-by: Leonardo Fagundes Luz Serrano <Leonardo.FagundesLuzSerrano@windriver.com>
This commit is contained in:
Leonardo Fagundes Luz Serrano 2024-06-26 17:21:55 -03:00
parent 5d79fdc996
commit e5972742ce
13 changed files with 19 additions and 27 deletions

View File

@ -38,7 +38,7 @@ def require_env(var):
return value
class Config:
class Config(object):
"""Configuration interface.
This class provides a read-only interface to project

View File

@ -22,7 +22,7 @@ logger = logging.getLogger('STX-k8s')
utils.set_logger(logger)
class KubeHelper:
class KubeHelper(object):
"""Common k8s commands"""
"""Constructor:

View File

@ -25,7 +25,7 @@ STX_BUILD_TYPES = ['rt', 'std']
STX_LAYERS = ['distro', 'flock']
class HandleBuildTask:
class HandleBuildTask(object):
'''Handle the task for the build sub-command'''
def __init__(self, config):

View File

@ -22,7 +22,7 @@ logger = logging.getLogger('STX-Cleanup')
utils.set_logger(logger)
class HandleCleanupTask:
class HandleCleanupTask(object):
def __init__(self, config, shell):
self.config = config

View File

@ -27,7 +27,7 @@ logger = logging.getLogger('STX-Config-Parser')
utils.set_logger(logger)
class STXConfigParser:
class STXConfigParser(object):
def __init__(self, filepath=None):
if filepath:
@ -263,7 +263,7 @@ class STXConfigParser:
logger.warning("These changes will take effect after you restart your builder containers")
class HandleConfigTask:
class HandleConfigTask(object):
'''Handle the task for the config sub-command'''
def __init__(self, config):

View File

@ -30,7 +30,7 @@ from stx import utils # pylint: disable=E0611
helmchartdir = 'stx/stx-build-tools-chart/stx-builder'
class HandleControlTask:
class HandleControlTask(object):
'''Handle the task for the control sub-command'''
def __init__(self, config):

View File

@ -32,7 +32,7 @@ class STXMainException(Exception):
pass
class CommandLine:
class CommandLine(object):
'''Handles parsing the commandline parameters for stx tool'''
def __init__(self):

View File

@ -22,7 +22,7 @@ logger = logging.getLogger('STX-Repomgr')
utils.set_logger(logger)
class HandleRepomgrTask:
class HandleRepomgrTask(object):
def __init__(self, config):
self.config = config

View File

@ -32,7 +32,7 @@ def quote(wordlist):
return shlex.quote(wordlist)
class HandleShellTask:
class HandleShellTask(object):
def __init__(self, config):
self.config = config

View File

@ -36,7 +36,7 @@ def check_request(request_form, needed_form):
return response
class Debbuilder:
class Debbuilder(object):
"""
Debbuilder querys/creates/saves/restores the schroot for sbuild
The default name of schroot is '<Debian DIST>-amd64-<USER>'

View File

@ -18,7 +18,7 @@ import subprocess
SCHROOTS_CONFIG = '/etc/schroot/chroot.d/'
class Schroot:
class Schroot(object):
def __init__(self, name, state='idle'):
self.name = name
self.state = state
@ -35,7 +35,7 @@ class Schroot:
return self.name
class SchrootsPool:
class SchrootsPool(object):
"""
schrootsPool manages all the schroots in current container
The schroots listed by schroot -l will be registered

View File

@ -1,5 +1,5 @@
bashate >= 0.2
PyYAML>=3.1.0
yamllint>=0.5.2
hacking>=2.0<2.1
astroid <= 2.2.5
astroid <=2.2.5
bashate >=0.2
hacking >=2.0, <2.1
PyYAML >=3.1.0
yamllint >=0.5.2

10
tox.ini
View File

@ -4,6 +4,7 @@ minversion = 2.3
skipsdist = True
[testenv]
basepython = python3
install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/upper-constraints.txt} {opts} {packages}
setenv = VIRTUAL_ENV={envdir}
OS_STDOUT_CAPTURE=1
@ -13,7 +14,6 @@ deps = -r{toxinidir}/test-requirements.txt
allowlist_externals = reno
[testenv:linters]
basepython = python3
# bashate ignore:
# E006 - accept long lines
# E040 - false positive on |& syntax (new in bash 4)
@ -33,18 +33,14 @@ commands =
-print0 | xargs -0 bashate -v -iE006,E040"
[testenv:pep8]
basepython = python3
usedevelop = False
description =
Run style checks.
commands =
flake8 stx
[testenv:pylint]
basepython = python3
sitepackages = False
deps = {[testenv]deps}
ruamel.yaml
pylint<2.5.0
@ -64,11 +60,9 @@ ignore = E123,E125,E265,E266,E501,H404,H405,W504,F401
exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build,release-tag-*
[testenv:venv]
basepython = python3
commands = {posargs}
[testenv:docs]
basepython = python3
deps = -r{toxinidir}/doc/requirements.txt
commands =
rm -rf doc/build
@ -76,7 +70,6 @@ commands =
allowlist_externals = rm
[testenv:releasenotes]
basepython = python3
deps = -r{toxinidir}/doc/requirements.txt
commands =
rm -rf releasenotes/build
@ -84,7 +77,6 @@ commands =
allowlist_externals = rm
[testenv:newnote]
basepython = python3
# Re-use the releasenotes venv
envdir = {toxworkdir}/releasenotes
deps = -r{toxinidir}/doc/requirements.txt