Hi, I've attached four patches that address various problems on Fedora 24.
Patch 0052 enables proper error handling in sphinx-build. Right now sphinx-build only warns about errors but doesn't signal errors in its exit code. The -W turns warnings (such as a failed import) into a non-zero exit code. Patch 0053 addresses new packages such as Python 3.5 and pylint 1.5. Patch 0054 fixes a linter error in pki.cli.pkcs12. The last patch sets the sphinx theme to the old classic theme. Christian
From 4dfd22e23c88f1b38003e2ef5fdf710cf02b97b3 Mon Sep 17 00:00:00 2001 From: Christian Heimes <[email protected]> Date: Mon, 29 Feb 2016 09:10:54 +0100 Subject: [PATCH 52/55] Fail builds when sphinx-builder fails sphinx-builder just reports errors to stderr but doesn't signal build failures in its return code. The -W option turns any warning into a non-null exit code. Comment out html_static_path. It doesn't exist, is not used but emits a warning which is then turned into an error. --- base/common/python/CMakeLists.txt | 2 ++ base/common/python/conf.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/base/common/python/CMakeLists.txt b/base/common/python/CMakeLists.txt index 7c2fad86919a328ab4f507b610ffa26c087da49b..d667421bfb3d42577ee11a21d919a65ff6828633 100644 --- a/base/common/python/CMakeLists.txt +++ b/base/common/python/CMakeLists.txt @@ -19,6 +19,7 @@ add_custom_target(dogtag_python_client_docs ALL -c "${CMAKE_CURRENT_BINARY_DIR}" -w "${CMAKE_CURRENT_BINARY_DIR}/python-client-lib-html.log" -a + -W "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/html" COMMENT "Building Python Client Library HTML documentation") @@ -29,6 +30,7 @@ add_custom_target(dogtag_python_client_man_docs ALL -c "${CMAKE_CURRENT_BINARY_DIR}" -w "${CMAKE_CURRENT_BINARY_DIR}/python-client-lib-man.log" -a + -W "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/man" COMMENT "Building Python Client Library manual pages") diff --git a/base/common/python/conf.py b/base/common/python/conf.py index 0f81c95dccfec5e7ef5de13f9c4927c130718895..f076cf919b1c2718a439ca5aca56002bb4f74ccf 100644 --- a/base/common/python/conf.py +++ b/base/common/python/conf.py @@ -122,7 +122,7 @@ html_theme = 'default' # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] +#html_static_path = ['_static'] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. -- 2.5.0
From df3a4f4d3dc93c1fc56bc46c985c090ca21cd6a4 Mon Sep 17 00:00:00 2001 From: Christian Heimes <[email protected]> Date: Mon, 29 Feb 2016 09:19:18 +0100 Subject: [PATCH 53/55] Fedora 24 fixes for Python 3.5 and pylint 1.5 Fedora 24 has Python 3.5 instead of Python 3.4. tox.ini now uses python3 to use any Python 3 interpreter. Python 3.5 has unittest.mock in the stdlib. Tests must attempt to import mock from unittest first. Pylint 1.5 has deprecated a couple of old options. Dogtag doesn't use the options anyway. I just removed them from dogtag.pylintrc. --- scripts/dogtag.pylintrc | 18 ------------------ tests/python/test_authority.py | 5 ++++- tox.ini | 7 ++++--- 3 files changed, 8 insertions(+), 22 deletions(-) diff --git a/scripts/dogtag.pylintrc b/scripts/dogtag.pylintrc index 061bba8ce30f30f773dbfa173e6b028cb08efcc7..98b8a2d694cb232dbaf8fb9a9d1cd170f253e768 100644 --- a/scripts/dogtag.pylintrc +++ b/scripts/dogtag.pylintrc @@ -7,9 +7,6 @@ # pygtk.require(). #init-hook= -# Profiled execution. -profile=no - # Add files or directories to the blacklist. They should be base names, not # paths. ignore=CVS @@ -70,10 +67,6 @@ reports=yes # (RP0004). evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10) -# Add a comment according to your evaluation note. This is used by the global -# evaluation report (RP0004). -comment=no - [FORMAT] @@ -138,10 +131,6 @@ ignored-modules=ldap # (useful for classes with attributes dynamically set). ignored-classes=SQLObject -# When zope mode is activated, add a predefined set of Zope acquired attributes -# to generated-members. -zope=no - # List of members which are set dynamically and missed by pylint inference # system, and so shouldn't trigger E0201 when accessed. Python regular # expressions are accepted. @@ -150,9 +139,6 @@ generated-members=REQUEST,acl_users,aq_parent [BASIC] -# Required attributes for module, separated by a comma -required-attributes= - # List of builtins function names that should not be used, separated by a comma bad-functions=map,filter,apply,input @@ -231,10 +217,6 @@ max-public-methods=20 [CLASSES] -# List of interface methods to ignore, separated by a comma. This is used for -# instance to not check methods defines in Zope's Interface base class. -ignore-iface-methods=isImplementedBy,deferred,extends,names,namesAndDescriptions,queryDescriptionFor,getBases,getDescriptionFor,getDoc,getName,getTaggedValue,getTaggedValueTags,isEqualOrExtendedBy,setTaggedValue,isImplementedByInstancesOf,adaptWith,is_implemented_by - # List of method names used to declare (i.e. assign) instance attributes. defining-attr-methods=__init__,__new__,setUp diff --git a/tests/python/test_authority.py b/tests/python/test_authority.py index b25816c23c9d5fd943aad4e8f065ab75667db778..e55b9c82ddc53b3cc05455488952a9e80169864e 100644 --- a/tests/python/test_authority.py +++ b/tests/python/test_authority.py @@ -19,7 +19,10 @@ # All rights reserved. # -import mock +try: + from unittest import mock +except ImportError: + import mock import unittest import uuid diff --git a/tox.ini b/tox.ini index dc75a8b55a93d2f41731d3ffdcb4d712f2f72899..2430a95ee3ac13d1a4035081a4b2c1c08fc52d0d 100644 --- a/tox.ini +++ b/tox.ini @@ -19,7 +19,8 @@ # [tox] -envlist = py27,pep8,pep8py3,lint,lint3k,docs +envlist = py27,py35,pep8,pep8py3,lint,lint3k,docs +skip_missing_interpreters = true [testenv] # force installation of sphinx and lint in virtual env, otherwise @@ -51,7 +52,7 @@ commands = {envpython} {toxinidir}/scripts/pylint-build-scan.py tox -- --py3k [testenv:lint3] -basepython = python3.4 +basepython = python3 deps = pylint commands = @@ -68,7 +69,7 @@ commands = flake8 {posargs} [testenv:pep8py3] -basepython = python3.4 +basepython = python3 sitepackages = False deps = flake8 -- 2.5.0
From ad7a4faf922db61a7137acd54b161e1d69455d10 Mon Sep 17 00:00:00 2001 From: Christian Heimes <[email protected]> Date: Mon, 29 Feb 2016 09:21:54 +0100 Subject: [PATCH 54/55] Fix pylint 1.5 violation in new pki.cli.pkcs12 module ************* Module pki.cli.pkcs12 E:160,43: Value 'cert_info' doesn't support membership test (unsupported-membership-test) --- base/common/python/pki/cli/pkcs12.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/base/common/python/pki/cli/pkcs12.py b/base/common/python/pki/cli/pkcs12.py index a57dfd9bafe0827bcd3ddb9b5e1c447cf9d4e6cb..aa04582f73479df4110641e46fe096d96e93b87f 100644 --- a/base/common/python/pki/cli/pkcs12.py +++ b/base/common/python/pki/cli/pkcs12.py @@ -148,11 +148,9 @@ class PKCS12ImportCLI(pki.cli.CLI): # determine cert types with open(output_file, 'r') as f: + cert_info = {} - cert_info = None - - for line in f.readlines(): - + for line in f: match = re.match(r' Nickname: (.*)$', line) if match: # store previous cert -- 2.5.0
From 94661c778e528daccadf56eea767976237494713 Mon Sep 17 00:00:00 2001 From: Christian Heimes <[email protected]> Date: Mon, 29 Feb 2016 09:47:39 +0100 Subject: [PATCH 55/55] Sphinx 1.3 has renamed the default scheme Use html_theme = 'classic' to silence this warning: WARNING: 'default' html theme has been renamed to 'classic'. Please change your html_theme setting either to the new 'alabaster' default theme, or to 'classic' to keep using the old default. --- base/common/python/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/common/python/conf.py b/base/common/python/conf.py index f076cf919b1c2718a439ca5aca56002bb4f74ccf..e489276af24c09dd96bf8b923eb640603953241a 100644 --- a/base/common/python/conf.py +++ b/base/common/python/conf.py @@ -93,7 +93,7 @@ pygments_style = 'sphinx' # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. -html_theme = 'default' +html_theme = 'classic' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the -- 2.5.0
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Pki-devel mailing list [email protected] https://www.redhat.com/mailman/listinfo/pki-devel
