From 824241680182da3650499256b071ad0cdb87a1c8 Mon Sep 17 00:00:00 2001 From: Sean McGinnis Date: Tue, 12 May 2020 10:49:43 -0500 Subject: Raise hacking minimum to 3.0.1 This raises hacking to a newer version, fixes a few issues the newer version uncovered, and removes the cap for flake8 to allow that version to be controlled by the hacking constraints. Change-Id: Ie550119322bca3c217e4a74eca789f156cfa7e2c Signed-off-by: Sean McGinnis --- lower-constraints.txt | 1 - oslo_config/generator.py | 6 +++--- oslo_config/tests/test_generator.py | 12 ++++++------ test-requirements.txt | 3 +-- 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/lower-constraints.txt b/lower-constraints.txt index 7c453f2..788b173 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -11,7 +11,6 @@ fixtures==3.0.0 flake8==2.5.5 gitdb==0.6.4 GitPython==1.0.1 -hacking==2.0.0 imagesize==0.7.1 iso8601==0.1.11 Jinja2==2.10 diff --git a/oslo_config/generator.py b/oslo_config/generator.py index 1f509ef..8e8dcfe 100644 --- a/oslo_config/generator.py +++ b/oslo_config/generator.py @@ -356,12 +356,12 @@ class _OptFormatter(object): """ self.output_file.write(s) - def writelines(self, l): + def writelines(self, lines): """Write an arbitrary sequence of strings to the output file. - :param l: a list of arbitrary strings + :param lines: a list of arbitrary strings """ - self.output_file.writelines(l) + self.output_file.writelines(lines) def _cleanup_opts(read_opts): diff --git a/oslo_config/tests/test_generator.py b/oslo_config/tests/test_generator.py index becd49a..7db7c60 100644 --- a/oslo_config/tests/test_generator.py +++ b/oslo_config/tests/test_generator.py @@ -437,7 +437,7 @@ class GeneratorTestCase(base.BaseTestCase): ''')), ('choices_opt', dict(opts=[('test', [(None, [opts['choices_opt']])])], - expected='''[DEFAULT] + expected="""[DEFAULT] # # From test @@ -451,7 +451,7 @@ class GeneratorTestCase(base.BaseTestCase): # b - # c - #choices_opt = a -''')), +""")), ('deprecated opt without deprecated group', dict(opts=[('test', [(groups['foo'], @@ -852,13 +852,13 @@ class GeneratorTestCase(base.BaseTestCase): # string with bad default (string value) #string_type_with_bad_default = 4096 ''')), - ('str_opt_str_group', + ('str_opt_str_group', dict(opts=[('test', [('foo', [opts['str_opt']]), (groups['foo'], [opts['int_opt']])]), ('foo', [('foo', - [opts['bool_opt']])])], + [opts['bool_opt']])])], expected='''[DEFAULT] @@ -888,7 +888,7 @@ class GeneratorTestCase(base.BaseTestCase): # Maximum value: 20 #int_opt = 10 ''')), - ('opt_str_opt_group', + ('opt_str_opt_group', dict(opts=[('test', [(groups['foo'], [opts['int_opt']]), ('foo', @@ -924,7 +924,7 @@ class GeneratorTestCase(base.BaseTestCase): # a string (string value) #str_opt = foo bar ''')), - ('opt_with_DeprecatedOpt', + ('opt_with_DeprecatedOpt', dict(opts=[('test', [(None, [opts['opt_with_DeprecatedOpt']])])], expected='''[DEFAULT] diff --git a/test-requirements.txt b/test-requirements.txt index 33e80bd..8441e70 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -2,8 +2,7 @@ # of appearance. Changing the order has an impact on the overall integration # process, which may cause wedges in the gate later. -flake8>=3.6.0,<3.8.0 # MIT -hacking>=2.0.0,<2.1.0 # Apache-2.0 +hacking>=3.0.1,<3.1.0 # Apache-2.0 fixtures>=3.0.0 # Apache-2.0/BSD testscenarios>=0.4 # Apache-2.0/BSD -- cgit v1.2.1