c052d40277
This PS delivers focal version of Pegleg image and has the following updates: - removed release-notes-jobs-python3 gate job because of incompartibility with Sphinx from current requirements - added focal gate node and switched gates to use it - added bindep.txt file into project root - added bindep role into gate jobs - added ubuntu_focal dockerfile for building focal pegleg image - switched tox profiles to py38 - uplifted references to shipyard_client, promenade and deckhand projects - resolved required dependencies conflicts by weakening constraints in Pipfile - updated tox profile update-requirements for generate requirements.txt and test-requirements.txt - generated new Pipfile.lock, requirements.txt and test-requirements.txt from Pipfile - switched tox profiles to use requirements.txt and test-requirements.txt instead of pipenv because of upstream zuul nodes Pypi mirrorring issue - updated reference to seaworthy site certificates in treasuremap repo - fixed unit tests issues caused by pytest/mock updates and new openssl version - fixed focal docker image publishing issue - added multiprocessing into coverage tests running process - made unit and coveraget tests more verbosive Change-Id: I5c4c519dc725cfb8c7b4e14756347c9336028aff
134 lines
3.2 KiB
INI
134 lines
3.2 KiB
INI
[tox]
|
|
envlist = py38,pep8,docs,cover
|
|
minversion = 2.38.0
|
|
skipsdist = True
|
|
|
|
[testenv]
|
|
usedevelop = True
|
|
setenv =
|
|
VIRTUAL_ENV={envdir}
|
|
LANGUAGE=en_US
|
|
LC_ALL=en_US.utf-8
|
|
PIPENV_VERBOSITY=-1
|
|
PIPENV_IGNORE_PIPFILE=1
|
|
deps=
|
|
-r{toxinidir}/requirements.txt
|
|
-r{toxinidir}/test-requirements.txt
|
|
passenv =
|
|
http_proxy
|
|
https_proxy
|
|
HTTP_PROXY
|
|
HTTPS_PROXY
|
|
no_proxy
|
|
NO_PROXY
|
|
PBR_VERSION
|
|
allowlist_externals =
|
|
bash
|
|
find
|
|
commands =
|
|
find . -type f -name "*.pyc" -delete
|
|
bash -c "{toxinidir}/tools/install-cfssl.sh"
|
|
bash -c "{toxinidir}/tools/gate/run-unit-tests.sh '{posargs}'"
|
|
|
|
[testenv:fmt]
|
|
basepython = python3
|
|
commands =
|
|
yapf -ir {toxinidir}/pegleg {toxinidir}/tests
|
|
allowlist_externals =
|
|
yapf
|
|
|
|
[testenv:pep8]
|
|
basepython = python3
|
|
command =
|
|
bash -c "{toxinidir}/tools/gate/whitespace-linter.sh"
|
|
bandit --skip B105 -r pegleg -n 5
|
|
flake8 {toxinidir}/pegleg
|
|
yapf -dr {toxinidir}/pegleg {toxinidir}/tests
|
|
allowlist_externals =
|
|
bash
|
|
bandit
|
|
flake8
|
|
yapf
|
|
find
|
|
|
|
|
|
[testenv:docs]
|
|
basepython = python3
|
|
deps=
|
|
-r{toxinidir}/requirements.txt
|
|
-r{toxinidir}/test-requirements.txt
|
|
-r{toxinidir}/doc/requirements.txt
|
|
commands =
|
|
bash -c "{toxinidir}/tools/gate/build-docs.sh"
|
|
allowlist_externals =
|
|
bash
|
|
|
|
[testenv:bandit]
|
|
basepython = python3
|
|
commands = bandit --skip B105 -r pegleg -n 5
|
|
|
|
[testenv:safety]
|
|
basepython = python3
|
|
deps =
|
|
safety
|
|
commands =
|
|
safety check -r {toxinidir}/requirements.txt -r {toxinidir}/doc/requirements.txt --full-report
|
|
|
|
[testenv:cover]
|
|
basepython = python3
|
|
commands =
|
|
bash -c {toxinidir}/tools/install-cfssl.sh
|
|
bash -c {toxinidir}/tools/gate/run-cover-tests.sh
|
|
allowlist_externals =
|
|
bash
|
|
|
|
[testenv:update-requirements]
|
|
deps =
|
|
pipenv
|
|
setuptools < 58.0.0
|
|
commands =
|
|
rm -f Pipfile.lock
|
|
rm -f requirements.txt
|
|
rm -f test-requirements.txt
|
|
pipenv lock --clear
|
|
sh -c "PIPENV_VERBOSITY=-1 pipenv requirements > requirements.txt"
|
|
pipenv install --dev
|
|
sh -c "pip freeze --all | grep -vE 'pegleg|pyinotify|pkg-resources==0.0.0' > test-requirements.txt"
|
|
allowlist_externals =
|
|
rm
|
|
sh
|
|
|
|
[testenv:releasenotes]
|
|
basepython = python3
|
|
deps=
|
|
-r{toxinidir}/requirements.txt
|
|
-r{toxinidir}/test-requirements.txt
|
|
-r{toxinidir}/doc/requirements.txt
|
|
commands =
|
|
rm -rf releasenotes/build
|
|
sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
|
|
allowlist_externals =
|
|
rm
|
|
|
|
[testenv:venv]
|
|
commands = {posargs}
|
|
|
|
[flake8]
|
|
filename = *.py
|
|
show-source = true
|
|
# [H106] Don't put vim configuration in source files.
|
|
# [H201] No 'except:' at least use 'except Exception:'
|
|
# [H904] Delay string interpolations at logging calls.
|
|
enable-extensions = H106,H201,H904
|
|
# TODO(lamt) Clean up these docstring violations if possible
|
|
# [H403] multi line docstrings should end on a new line
|
|
# [H404] multi line docstring should start without a leading new line
|
|
# [H405] multi line docstring summary not separated with an empty line
|
|
# [W503] line break before binary operator
|
|
ignore = H403,H404,H405,W503
|
|
exclude=.venv,.git,.tox,build,dist,*lib/python*,*egg,tools,*.ini,*.po,*.pot
|
|
max-complexity = 24
|
|
application-import-names = pegleg
|
|
application-package-names = deckhand,promenade,shipyard
|
|
import-order-style = pep8
|