From cd956ce134458f7976b1524e2b3d7a7cd3b61d53 Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Sat, 28 Mar 2020 19:41:13 +0100 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. Change-Id: I881f5d020d0ea95afb0eab6828928bc386afc263 --- bin/docstheme-lang-display-name.py | 4 ++-- openstackdocstheme/ext.py | 4 ++-- openstackdocstheme/page_context.py | 2 +- test-requirements.txt | 2 +- tox.ini | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/bin/docstheme-lang-display-name.py b/bin/docstheme-lang-display-name.py index 79301f63..e62acca6 100755 --- a/bin/docstheme-lang-display-name.py +++ b/bin/docstheme-lang-display-name.py @@ -22,7 +22,7 @@ import babel lang_code = sys.argv[1] try: - l = babel.Locale.parse(lang_code) - print(l.get_display_name()) + lo = babel.Locale.parse(lang_code) + print(lo.get_display_name()) except Exception: print(lang_code) diff --git a/openstackdocstheme/ext.py b/openstackdocstheme/ext.py index c7849d16..d9d65776 100644 --- a/openstackdocstheme/ext.py +++ b/openstackdocstheme/ext.py @@ -312,8 +312,8 @@ def _builder_inited(app): 'figure_align': 'H', 'classoptions': ',openany', 'preamble': r""" -\usepackage{""" + pdf_theme_path + """} -\\newcommand{\openstacklogo}{""" + theme_logo + """} +\usepackage{""" + pdf_theme_path + r"""} +\newcommand{\openstacklogo}{""" + theme_logo + """} """} diff --git a/openstackdocstheme/page_context.py b/openstackdocstheme/page_context.py index 75092967..d9983edc 100644 --- a/openstackdocstheme/page_context.py +++ b/openstackdocstheme/page_context.py @@ -48,7 +48,7 @@ def _get_last_updated_file(src_file): try: return datetime.datetime.strptime(last_updated_t, '%Y-%m-%d %H:%M:%S') - except ValueError as err: + except ValueError: LOG.info( '[openstackdocstheme] ' 'Could not parse modification time of %s: %r', diff --git a/test-requirements.txt b/test-requirements.txt index 30aed8b3..dacd5ea9 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>=1.1.0,<1.2.0 # Apache-2.0 +hacking>=3.0,<3.1.0 # Apache-2.0 # this is required for the docs build jobs sphinx!=1.6.6,!=1.6.7,>=1.6.2 # BSD diff --git a/tox.ini b/tox.ini index 2806179f..6c1e3334 100644 --- a/tox.ini +++ b/tox.ini @@ -83,6 +83,6 @@ deps = bindep commands = bindep test [flake8] -exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,tools +exclude=.venv,.git,.tox,dist,doc,api-ref,*lib/python*,*egg,tools show-source = True enable-extensions = H203,H106