From b248f85a1e4559dff8c608cb6d71bcb5b4f339b8 Mon Sep 17 00:00:00 2001 From: jacky06 Date: Mon, 11 May 2020 23:41:01 +0800 Subject: [PATCH] Update to hacking 3.0 Update to newest hacking version, it has only minimal changes and full support for Python 3. Python modules related to coding style checks (listed in blacklist.txt in openstack/requirements repo) are dropped from lower-constraints.txt as they are not actually used in tests (other than pep8). Change-Id: I67f390e6d7b6fb9eeb7522728ba293d3337b3327 --- disaster_recovery/backups/views.py | 4 ++-- lower-constraints.txt | 7 ------- test-requirements.txt | 2 +- tox.ini | 3 ++- 4 files changed, 5 insertions(+), 11 deletions(-) diff --git a/disaster_recovery/backups/views.py b/disaster_recovery/backups/views.py index 1bca8cd..6fe3eb8 100644 --- a/disaster_recovery/backups/views.py +++ b/disaster_recovery/backups/views.py @@ -61,8 +61,8 @@ class RestoreView(workflows.WorkflowView): @shield('Unable to get backup.', redirect='backups:index') def get_workflow_name(self): backup = freezer_api.Backup(self.request).get(self.kwargs['backup_id']) - backup_date_str = datetime.datetime.fromtimestamp(int(backup.time_stamp))\ - .strftime("%Y/%m/%d %H:%M") + backup_date_str = datetime.datetime.fromtimestamp( + int(backup.time_stamp)).strftime("%Y/%m/%d %H:%M") return "Restore '{}' from {}".format(backup.backup_name, backup_date_str) diff --git a/lower-constraints.txt b/lower-constraints.txt index 2c71468..bb60eeb 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -1,5 +1,4 @@ alabaster==0.7.10 -astroid==1.6.5 Babel==2.5.3 certifi==2018.1.18 chardet==3.0.4 @@ -14,8 +13,6 @@ django-compressor==2.0 docutils==0.14 extras==1.0.0 fixtures==3.0.0 -flake8==2.5.5 -hacking==0.12.0 horizon==17.1.0 idna==2.6 imagesize==1.0.0 @@ -25,17 +22,13 @@ keystoneauth1==3.18.0 linecache2==1.0.0 logilab-common==1.4.1 MarkupSafe==1.0 -mccabe==0.2.1 netaddr==0.7.19 oslo.config==5.2.0 oslo.i18n==3.20.0 oslo.log==3.36.0 pbr==3.1.1 -pep8==1.5.7 prettytable==0.7.2 -pyflakes==0.8.1 Pygments==2.2.0 -pylint==1.9.2 pyparsing==2.2.0 pyperclip==1.6.0 python-freezerclient==2.0.0 diff --git a/test-requirements.txt b/test-requirements.txt index cec434c..a60f20e 100644 --- a/test-requirements.txt +++ b/test-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. -hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0 +hacking>=3.0.1,<3.1.0 # Apache-2.0 coverage!=4.4,>=4.0 # Apache-2.0 oslo.config>=5.2.0 # Apache-2.0 diff --git a/tox.ini b/tox.ini index d8409a9..a616aae 100644 --- a/tox.ini +++ b/tox.ini @@ -42,9 +42,10 @@ commands = python setup.py build_sphinx commands = pylint --rcfile .pylintrc disaster_recovery [flake8] +# W504 line break after binary operator exclude = .venv,.git,.tox,dist,*lib/python*,*egg,build,panel_template,dash_template,local_settings.py,*/local/*,*/test/test_plugins/*,.ropeproject,tools,doc max-complexity = 20 -ignore = H405,H404,H403,H401,H238,H306,H701 +ignore = H405,H404,H403,H401,H238,H306,H701,W504 [testenv:lower-constraints] deps =