diff --git a/.zuul.yaml b/.zuul.yaml index cc3b0a91..6053a47d 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -13,19 +13,17 @@ - project: check: jobs: + - openstack-tox-pep8 - airship-pegleg-linter - airship-pegleg-doc-build - - airship-pegleg-lint-pep8 - airship-pegleg-unit-py35 - - airship-pegleg-security-bandit - airship-pegleg-docker-build-gate gate: jobs: + - openstack-tox-pep8 - airship-pegleg-linter - airship-pegleg-doc-build - - airship-pegleg-lint-pep8 - airship-pegleg-unit-py35 - - airship-pegleg-security-bandit - airship-pegleg-docker-build-gate post: jobs: @@ -44,20 +42,6 @@ run: tools/gate/playbooks/zuul-linter.yaml nodeset: airship-pegleg-single-node -- job: - name: airship-pegleg-lint-pep8 - description: | - Lints Python files against the PEP8 standard - run: tools/gate/playbooks/pep8-linter.yaml - timeout: 300 - nodeset: airship-pegleg-single-node - irrelevant-files: - - ^.*\.rst$ - - ^doc/.*$ - - ^etc/.*$ - - ^releasenotes/.*$ - - ^setup.cfg$ - - job: name: airship-pegleg-unit-py35 description: | @@ -72,20 +56,6 @@ - ^releasenotes/.*$ - ^setup.cfg$ -- job: - name: airship-pegleg-security-bandit - description: | - Executes the Bandit security scanner against Python files - run: tools/gate/playbooks/security-bandit.yaml - timeout: 300 - nodeset: airship-pegleg-single-node - irrelevant-files: - - ^.*\.rst$ - - ^doc/.*$ - - ^etc/.*$ - - ^releasenotes/.*$ - - ^setup.cfg$ - - job: name: airship-pegleg-doc-build description: | diff --git a/src/bin/pegleg/test-requirements.txt b/src/bin/pegleg/test-requirements.txt index 57fee1ec..010aa6db 100644 --- a/src/bin/pegleg/test-requirements.txt +++ b/src/bin/pegleg/test-requirements.txt @@ -3,8 +3,11 @@ pytest==3.2.1 pytest-cov==2.5.1 mock==2.0.0 +# Formatting +yapf==0.20.0 + # Linting flake8==3.3.0 # Security -bandit==1.4.0 +bandit>=1.5.0 diff --git a/src/bin/pegleg/tox.ini b/src/bin/pegleg/tox.ini index 9c012686..e4e135a6 100644 --- a/src/bin/pegleg/tox.ini +++ b/src/bin/pegleg/tox.ini @@ -15,19 +15,22 @@ commands = {posargs} [testenv:fmt] -deps = yapf==0.20.0 +basepython=python3 +deps = + -r{toxinidir}/test-requirements.txt commands = yapf --style=pep8 -ir {toxinidir}/pegleg {toxinidir}/tests [testenv:pep8] +basepython=python3 deps = - yapf==0.20.0 - flake8==3.5.0 + -r{toxinidir}/test-requirements.txt commands = - yapf -rd {toxinidir}/pegleg {toxinidir}/tests flake8 {toxinidir}/pegleg + bandit -r pegleg -n 5 [testenv:bandit] +basepython=python3 commands = bandit -r pegleg -n 5 [flake8] diff --git a/tools/gate/playbooks/pep8-linter.yaml b/tools/gate/playbooks/pep8-linter.yaml deleted file mode 100644 index 43bd7855..00000000 --- a/tools/gate/playbooks/pep8-linter.yaml +++ /dev/null @@ -1,20 +0,0 @@ -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -- hosts: primary - tasks: - - name: Execute the make target for PEP8 linting - make: - chdir: "{{ zuul.project.src_dir }}" - target: py_lint - register: result - failed_when: result.failed diff --git a/tools/gate/playbooks/security-bandit.yaml b/tools/gate/playbooks/security-bandit.yaml deleted file mode 100644 index 927ea05f..00000000 --- a/tools/gate/playbooks/security-bandit.yaml +++ /dev/null @@ -1,20 +0,0 @@ -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -- hosts: primary - tasks: - - name: Execute the make target for security scanning - make: - chdir: "{{ zuul.project.src_dir }}" - target: security - register: result - failed_when: result.failed