From 67ddca50431793445b0a4d5fa40f35e2b751bed6 Mon Sep 17 00:00:00 2001
From: jacky06 <zhang.min@99cloud.net>
Date: Fri, 4 Jan 2019 23:26:19 +0800
Subject: [PATCH] Update hacking version

Use latest release 1.1.0 and compatible changes w.r.t pep8

Change-Id: I168ff6f7d491e4439863473a2bf23ba290e0c23b
---
 doc/source/conf.py      |  5 ++---
 test-requirements.txt   |  2 +-
 tox.ini                 |  3 +++
 zun_ui/test/settings.py | 10 +++++-----
 4 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/doc/source/conf.py b/doc/source/conf.py
index 1d54b22..e723a9a 100644
--- a/doc/source/conf.py
+++ b/doc/source/conf.py
@@ -29,6 +29,8 @@ import sys
 
 import django
 
+from zun_ui import version as zunui_ver
+
 BASE_DIR = os.path.dirname(os.path.abspath(__file__))
 ROOT = os.path.abspath(os.path.join(BASE_DIR, "..", ".."))
 
@@ -43,9 +45,6 @@ os.environ.setdefault('DJANGO_SETTINGS_MODULE',
 # https://docs.djangoproject.com/en/1.8/releases/1.7/#standalone-scripts
 django.setup()
 
-from zun_ui import version as zunui_ver
-
-
 # If extensions (or modules to document with autodoc) are in another directory,
 # add these directories to sys.path here. If the directory is relative to the
 # documentation root, use os.path.abspath to make it absolute, like shown here.
diff --git a/test-requirements.txt b/test-requirements.txt
index 80d4b90..161ebe0 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -7,7 +7,7 @@
 # be installed in a specific order.
 #
 # Hacking should appear first in case something else depends on pep8
-hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0
+hacking>=1.1.0,<1.2.0 # Apache-2.0
 
 coverage!=4.4,>=4.0 # Apache-2.0
 mock>=2.0.0 # BSD
diff --git a/tox.ini b/tox.ini
index f4a6e0c..aa3a13c 100644
--- a/tox.ini
+++ b/tox.ini
@@ -34,6 +34,9 @@ basepython = python3
 commands = flake8 {posargs}
 
 [flake8]
+# F405 TEMPLATES may be undefined, or defined from star imports
+# (because it is not easy to avoid this in openstack_dashboard.test.settings)
+ignore = F405
 exclude = .venv,.git,.tox,dist,*egg,build,node_modules
 max-complexity = 20
 
diff --git a/zun_ui/test/settings.py b/zun_ui/test/settings.py
index b02ee16..8efc037 100644
--- a/zun_ui/test/settings.py
+++ b/zun_ui/test/settings.py
@@ -14,16 +14,16 @@
 from horizon.test.settings import *  # noqa: F403,H303
 from openstack_dashboard.test.settings import *  # noqa: F403,H303
 
-# pop these keys to avoid log warnings about deprecation
-# update_dashboards will populate them anyway
-HORIZON_CONFIG.pop('dashboards', None)
-HORIZON_CONFIG.pop('default_dashboard', None)
-
 # Update the dashboards with zun_ui
 import openstack_dashboard.enabled
 from openstack_dashboard.utils import settings
 import zun_ui.enabled
 
+# pop these keys to avoid log warnings about deprecation
+# update_dashboards will populate them anyway
+HORIZON_CONFIG.pop('dashboards', None)
+HORIZON_CONFIG.pop('default_dashboard', None)
+
 settings.update_dashboards(
     [
         zun_ui.enabled,