From 25415b0e46190a900cf673114d57226dd0a9637f Mon Sep 17 00:00:00 2001 From: jacky06 Date: Fri, 4 Jan 2019 23:23:26 +0800 Subject: [PATCH] Update hacking version Use latest release 1.1.0 and compatible changes w.r.t pep8 Change-Id: I45befc03377d96c27db8b1d8d78dd7b5bec5ec14 --- heat_dashboard/api/heat.py | 3 +-- .../enabled/_1650_project_template_generator_panel.py | 2 +- heat_dashboard/test/test_data/nova_data.py | 2 +- lower-constraints.txt | 2 +- test-requirements.txt | 2 +- tox.ini | 6 ++++++ 6 files changed, 11 insertions(+), 6 deletions(-) diff --git a/heat_dashboard/api/heat.py b/heat_dashboard/api/heat.py index ca61523e..86c44fab 100644 --- a/heat_dashboard/api/heat.py +++ b/heat_dashboard/api/heat.py @@ -105,8 +105,7 @@ def _ignore_if(key, value): return True if not isinstance(value, six.string_types): return True - if (key == 'type' and - not value.endswith(('.yaml', '.template'))): + if (key == 'type' and not value.endswith(('.yaml', '.template'))): return True return False diff --git a/heat_dashboard/enabled/_1650_project_template_generator_panel.py b/heat_dashboard/enabled/_1650_project_template_generator_panel.py index cab7fb63..66c74874 100644 --- a/heat_dashboard/enabled/_1650_project_template_generator_panel.py +++ b/heat_dashboard/enabled/_1650_project_template_generator_panel.py @@ -56,7 +56,7 @@ ADD_SCSS_FILES = [ 'horizon/lib/bootstrap_scss/scss/_bootstrap.scss', 'horizon/lib/font_awesome/scss/font-awesome.scss', '%s/hotgen-main.scss' % CSS_BASE - ] +] HEAT_DASHBOARD_ROOT = heat_dashboard.__path__[0] diff --git a/heat_dashboard/test/test_data/nova_data.py b/heat_dashboard/test/test_data/nova_data.py index d6c2e872..7ce09b3e 100644 --- a/heat_dashboard/test/test_data/nova_data.py +++ b/heat_dashboard/test/test_data/nova_data.py @@ -181,7 +181,7 @@ def data(TEST): "server_id": "4"}) server_4 = servers.Server(servers.ServerManager(None), json.loads(SERVER_DATA % vals)['server']) - TEST.servers.add(server_1, server_2, server_4) + TEST.servers.add(server_1, server_2, server_4) # Availability Zones TEST.availability_zones.add(availability_zones.AvailabilityZone( diff --git a/lower-constraints.txt b/lower-constraints.txt index b1e095ec..fe304f47 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -30,7 +30,7 @@ flake8==2.5.5 flake8-import-order==0.12 futurist==1.2.0 greenlet==0.4.10 -hacking==0.12.0 +hacking==1.1.0 horizon==14.0.0.0b3 idna==2.6 iso8601==0.1.11 diff --git a/test-requirements.txt b/test-requirements.txt index 6b198dad..5043ae31 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 doc8>=0.6.0 # Apache-2.0 diff --git a/tox.ini b/tox.ini index ea5f33e2..4a7a499f 100644 --- a/tox.ini +++ b/tox.ini @@ -79,6 +79,12 @@ local-check-factory = horizon.hacking.checks.factory [flake8] exclude = .venv,.git,.tox,dist,*lib/python*,*egg,build,panel_template,dash_template,local_settings.py,*/local/*,*/test/test_plugins/*,.ropeproject,node_modules,.tmp +# F405 TEMPLATES may be undefined, or defined from star imports +# (because it is not easy to avoid this in openstack_dashboard.test.settings) +# W504 line break after binary operator +# (W503 and W504 are incompatible and we need to choose one of them. +# Existing codes follows W503, so we disable W504.) +ignore = F405,W504 max-complexity = 20 import-order-style = pep8