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: Id4b5f045563640f4b9c73ecafd4ebf8d3ff2c269
changes/82/726882/2
jacky06 3 years ago
parent f6065ebeba
commit eaab8694d0

@ -779,8 +779,8 @@ def get_backup_args():
trickle_executable = distspawn.find_executable(
'trickle', path=":".join(sys.path))
if trickle_executable is None:
trickle_executable = distspawn.find_executable(
'trickle', path=":".join(os.environ.get('PATH')))
trickle_executable = distspawn.find_executable(
'trickle', path=":".join(os.environ.get('PATH')))
if trickle_executable:
LOG.info("Info: Starting trickle ...")

@ -48,10 +48,10 @@ def weakchecksum(data):
Generates a weak checksum from an iterable set of bytes.
"""
a = b = 0
l = len(data)
for i in range(l):
le = len(data)
for i in range(le):
a += data[i]
b += (l - i) * data[i]
b += (le - i) * data[i]
return (b << 16) | a, a, b

@ -184,7 +184,7 @@ class BackupJob(Job):
self.conf.hostname, self.conf.mode, self.conf.storage,
self.conf.compression))
try:
if self.conf.mode is 'fs' and self.conf.sync:
if self.conf.mode == 'fs' and self.conf.sync:
LOG.info('Executing sync to flush the file system buffer.')
(out, err) = utils.create_subprocess('sync')
if err:

@ -275,5 +275,6 @@ def main():
LOG.critical("Run freezer agent process unsuccessfully")
return fail(1, err, quiet)
if __name__ == '__main__':
sys.exit(main())

@ -47,8 +47,8 @@ class CommandFailed(Exception):
def dict_to_args(d):
l = [['--' + k.replace('_', '-'), v] for k, v in d.items()]
return list(itertools.chain.from_iterable(l))
ll = [['--' + k.replace('_', '-'), v] for k, v in d.items()]
return list(itertools.chain.from_iterable(ll))
def execute_freezerc(dict, must_fail=False, merge_stderr=False):

@ -161,7 +161,7 @@ class TestUtils(commons.FreezerBaseTestCase):
def test_walk_path_file(self, mock_isfile):
mock_isfile.return_value = True
count = utils.walk_path('root', '', False, self.callback)
assert count is 1
assert count == 1
def callback(self, filepath='', files=[]):
files.append(filepath)

@ -26,10 +26,8 @@ eventlet==0.20.0
extras==1.0.0
fasteners==0.14.1
fixtures==3.0.0
flake8==2.5.4
future==0.16.0
greenlet==0.4.13
hacking==0.12.0
idna==2.6
imagesize==1.0.0
iso8601==0.1.12
@ -42,7 +40,6 @@ keystoneauth1==3.4.0
linecache2==1.0.0
logilab-common==1.4.1
MarkupSafe==1.0
mccabe==0.4.0
monotonic==1.4
msgpack==0.5.6
munch==2.2.0
@ -69,12 +66,10 @@ paramiko==2.0.0
Paste==2.0.3
PasteDeploy==1.5.2
pbr==2.0.0
pep8==1.7.1
prettytable==0.7.2
psutil==3.2.2
pyasn1==0.4.2
pycparser==2.18
pyflakes==1.0.0
Pygments==2.2.0
pyinotify==0.9.6
pylint==1.4.5

@ -1,8 +1,8 @@
# The order of packages is significant, because pip processes them in the order
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.
flake8<2.6.0,>=2.5.4 # MIT
hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0
hacking>=3.0,<3.1.0 # Apache-2.0
coverage>=4.5.1 # Apache-2.0
ddt>=1.0.1 # MIT
#pylint==1.9.2 # GPLv2

@ -72,7 +72,10 @@ commands =
commands = pylint --rcfile .pylintrc freezer
[flake8]
ignore = H405,H404,H403,H401
# W504 line break after binary operator
# W605 invalid escape sequence
ignore = H405,H404,H403,H401,W504,W605
show-source = True
enable-extensions = H203,H106
exclude = .venv,.tox,dist,doc,test,*egg,releasenotes

Loading…
Cancel
Save