From 5fb81faee08cbf9a9a1c72503886e94d25ef5f10 Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Sun, 29 Mar 2020 15:37:12 +0200 Subject: [PATCH] Update hacking for Python3 The repo is Python 3 now, so update hacking to version 3.0.1 which supports Python 3. Fix problems found. Update local hacking checks for new flake8. Switch to dnspython in requirements. See also https://review.opendev.org/726353. Co-Authored-By: Sean McGinnis Depends-On: https://review.opendev.org/715682 Change-Id: I49a0ba49133f9592089d3829405847bf2ff8b425 --- designate_tempest_plugin/hacking/__init__.py | 0 designate_tempest_plugin/hacking/checks.py | 31 -------------------- requirements.txt | 2 +- test-requirements.txt | 2 +- tox.ini | 22 ++++++++++---- 5 files changed, 18 insertions(+), 39 deletions(-) delete mode 100644 designate_tempest_plugin/hacking/__init__.py delete mode 100644 designate_tempest_plugin/hacking/checks.py diff --git a/designate_tempest_plugin/hacking/__init__.py b/designate_tempest_plugin/hacking/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/designate_tempest_plugin/hacking/checks.py b/designate_tempest_plugin/hacking/checks.py deleted file mode 100644 index 366aca38..00000000 --- a/designate_tempest_plugin/hacking/checks.py +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright 2016 Hewlett Packard Enterprise Development Company, L.P. -# -# 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. - -from tempest.hacking import checks - - -def factory(register): - # Imported from Tempest - register(checks.import_no_clients_in_api_and_scenario_tests) - register(checks.scenario_tests_need_service_tags) - register(checks.no_setup_teardown_class_for_tests) - register(checks.no_vi_headers) - register(checks.service_tags_not_in_module_path) - register(checks.no_hyphen_at_end_of_rand_name) - register(checks.no_mutable_default_args) - register(checks.no_testtools_skip_decorator) - register(checks.get_resources_on_service_clients) - register(checks.delete_resources_on_service_clients) - register(checks.dont_use_config_in_tempest_lib) - register(checks.use_rand_uuid_instead_of_uuid4) diff --git a/requirements.txt b/requirements.txt index 8d0dc5f0..3a1f2f30 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,7 +2,7 @@ # of appearance. Changing the order has an impact on the overall integration # process, which may cause wedges in the gate later. -dnspython3!=1.13.0,!=1.14.0,>=1.12.0 # http://www.dnspython.org/LICENSE +dnspython>=1.16.0 # http://www.dnspython.org/LICENSE ddt>=1.0.1 # MIT testtools>=2.2.0 # MIT tempest>=17.1.0 # Apache-2.0 diff --git a/test-requirements.txt b/test-requirements.txt index 6e6ab007..94bee3ce 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -3,6 +3,6 @@ # process, which may cause wedges in the gate later. # Hacking already pins down pep8/pycodestyle pyflakes and flake8 -hacking>=1.1.0,<1.2.0 # Apache-2.0 +hacking>=3.0.1,<3.1.0 # Apache-2.0 openstackdocstheme>=1.18.1 # Apache-2.0 sphinx!=1.6.6,!=1.6.7,>=1.6.2 # BSD diff --git a/tox.ini b/tox.ini index 6211c660..b7f30986 100644 --- a/tox.ini +++ b/tox.ini @@ -79,11 +79,21 @@ commands = {posargs} # H904 Wrap long lines in parentheses instead of a backslash # E126 continuation line over-indented for hanging indent # E128 continuation line under-indented for visual indent - -ignore = H302,H306,H402,H404,H405,H904,E126,E128 +# W504 line break after binary operator +ignore = H302,H306,H402,H404,H405,H904,E126,E128,W504 exclude = .venv,.git,.tox,dist,doc,*openstack/common*,*openstack/deprecated*,*lib/python*,*egg,build,tools,.ropeproject - -[hacking] -local-check-factory = designate_tempest_plugin.hacking.checks.factory - +[flake8:local-plugins] +extension = + T102 = tempest.hacking.checks:import_no_clients_in_api_and_scenario_tests + T104 = tempest.hacking.checks:scenario_tests_need_service_tags + T105 = tempest.hacking.checks:no_setup_teardown_class_for_tests + T107 = tempest.hacking.checks:service_tags_not_in_module_path + T108 = tempest.hacking.checks:no_hyphen_at_end_of_rand_name + N322 = tempest.hacking.checks:no_mutable_default_args + T109 = tempest.hacking.checks:no_testtools_skip_decorator + T110 = tempest.hacking.checks:get_resources_on_service_clients + T111 = tempest.hacking.checks:delete_resources_on_service_clients + T112 = tempest.hacking.checks:dont_import_local_tempest_into_lib + T113 = tempest.hacking.checks:dont_use_config_in_tempest_lib + T114 = tempest.hacking.checks:use_rand_uuid_instead_of_uuid4