Rick Bartra d38078cce3 fix: Gate fix for Shipyard docs and pep8 gates
Now that the Shipyard gates are running on Focal(20.04), flake8, grpcio,
and pyflakes need to use a version compatible with python3.8 and Ubuntu
20.04 which is the default python version in Ubuntu focal. Also unpinning
setuptools so that it is compatible with python3.8.

Additionally, address pep8 violations that arise from using a newer
version of flake8

Change-Id: Idc3c5d66b48fc9e4497a71d1b640bcd2872c22eb
2020-09-15 18:16:45 +00:00

85 lines
2.3 KiB
INI

[tox]
envlist = py35, py36, pep8, bandit
[testenv]
setenv=
PYTHONWARNING=all
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
[testenv:py35]
skipsdist=True
setenv=
SLUGIFY_USES_TEXT_UNIDECODE=yes
commands =
pytest \
{posargs} \
--cov-branch \
--cov-report=term-missing:skip-covered \
--cov-config=.coveragerc \
--cov=shipyard_airflow \
--cov-report=html
[testenv:py36]
skipsdist=True
setenv=
SLUGIFY_USES_TEXT_UNIDECODE=yes
commands =
pytest \
{posargs} \
--cov-branch \
--cov-report=term-missing:skip-covered \
--cov-config=.coveragerc \
--cov=shipyard_airflow \
--cov-report=html
[testenv:pep8]
basepython=python3
deps=
flake8>=3.3.0
bandit>=1.5.0
commands =
flake8 {toxinidir}/shipyard_airflow
bandit -r shipyard_airflow
[testenv:bandit]
basepython=python3
skipsdist= True
commands =
bandit -r shipyard_airflow -n 5
[testenv:genconfig]
setenv=
SLUGIFY_USES_TEXT_UNIDECODE=yes
commands = oslo-config-generator --config-file=generator/config-generator.conf
[testenv:genpolicy]
setenv=
SLUGIFY_USES_TEXT_UNIDECODE=yes
commands = oslopolicy-sample-generator --config-file=generator/policy-generator.conf
[testenv:gen_all]
# Combined to make these run together instead of setting up separately
basepython=python3
setenv=
SLUGIFY_USES_TEXT_UNIDECODE=yes
commands =
oslo-config-generator --config-file=generator/config-generator.conf
oslopolicy-sample-generator --config-file=generator/policy-generator.conf
[flake8]
filename = *.py
# NOTE(Bryan Strassner) ignoring F841 because of the airflow example pattern
# of naming variables even if they aren't used for DAGs and Operators.
# Doing so adds readability and context in this case.
# TODO(Bryan Strassner) The hacking rules defined as ignored below in many
# cases need to be un-ignored and fixed up. These are ignored because of
# the method in which test requirements bring in the hacking rules from
# other projects.
# W504 line break after binary operator
# TODO(rb560u): Address E722 violations
ignore = F841, H101, H201, H210, H238, H301, H304, H306, H401, H403, H404, H405, W504, E722
# NOTE(Bryan Strassner) excluding 3rd party and generated code that is brought into the
# codebase.
exclude = .venv,.git,.tox,build,dist,*lib/python*,*egg,alembic/env.py,docs