From 55ebdd45b4d6a65c9d5f22f3af961c3e9541e98a Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Tue, 31 Mar 2020 21:46:20 +0200 Subject: [PATCH] Update hacking for Python3 The repo is Python 3 now, so update hacking to version 3.0 which supports Python 3. Fix problems found by updated hacking version. Remove hacking and friends from lower-constraints, they are not needed there. Change-Id: I013b73347ed56c8c64a8aff73ec60ea738bc0c76 --- doc/source/conf.py | 4 ++-- lower-constraints.txt | 4 ---- test-requirements.txt | 2 +- tests/test_monascastatsd.py | 4 +++- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 9468074..3e2e53a 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -172,9 +172,9 @@ html_static_path = ['_static'] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. -#html_last_updated_fmt = '%b %d, %Y' +# html_last_updated_fmt = '%b %d, %Y' git_cmd = ["git", "log", "--pretty=format:'%ad, commit %h'", "--date=local", - "-n1"] + "-n1"] try: html_last_updated_fmt = subprocess.check_output(git_cmd).decode('utf-8') except Exception: diff --git a/lower-constraints.txt b/lower-constraints.txt index a1c3ff9..d185a87 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -7,11 +7,9 @@ docutils==0.11 dulwich==0.15.0 extras==1.0.0 fixtures==3.0.0 -flake8==2.5.5 future==0.16.0 gitdb==0.6.4 GitPython==1.0.1 -hacking==0.12.0 imagesize==0.7.1 iso8601==0.1.11 Jinja2==2.10 @@ -27,8 +25,6 @@ os-testr==1.0.0 oslosphinx==4.7.0 oslotest==3.2.0 pbr==2.0.0 -pep8==1.5.7 -pyflakes==0.8.1 Pygments==2.2.0 python-mimeparse==1.6.0 python-subunit==1.0.0 diff --git a/test-requirements.txt b/test-requirements.txt index 67fa8e7..25e59f6 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,7 +1,7 @@ # 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. -hacking>=1.1.0,<1.2.0 # Apache-2.0 +hacking>=3.0,<3.1.0 # Apache-2.0 bandit>=1.1.0 # Apache-2.0 coverage!=4.4,>=4.0 # Apache-2.0 mock>=2.0.0 # BSD diff --git a/tests/test_monascastatsd.py b/tests/test_monascastatsd.py index cf9ea3a..e8989be 100644 --- a/tests/test_monascastatsd.py +++ b/tests/test_monascastatsd.py @@ -274,7 +274,8 @@ class TestMonascaStatsd(unittest.TestCase): timer.timing('timer', 123) self.client.connection.close_buffer() - self.assertEqual(six.b("site.views:123|g|#{'env': 'test'}\nsite.timer:123|g|#{'env': 'test'}"), + self.assertEqual(six.b("site.views:123|g|#{'env': 'test'}\n" + "site.timer:123|g|#{'env': 'test'}"), self.recv(gauge)) def test_context_manager(self): @@ -307,5 +308,6 @@ class TestMonascaStatsd(unittest.TestCase): b, delta) + if __name__ == '__main__': unittest.main()