66fe91
From fbb766bb81f37fb89fe4eb63aa7e356306994a5c Mon Sep 17 00:00:00 2001
66fe91
From: Christian Heimes <cheimes@redhat.com>
66fe91
Date: Tue, 28 Mar 2017 17:51:23 +0200
66fe91
Subject: [PATCH 2/4] Patch and integrate vendored configparser
66fe91
66fe91
---
66fe91
 custodia/compat.py                                 |  2 +-
66fe91
 custodia/vendor/__init__.py                        |  2 ++
66fe91
 custodia/vendor/backports/configparser/__init__.py |  7 ++++---
66fe91
 custodia/vendor/backports/configparser/helpers.py  |  1 +
66fe91
 custodia/vendor/configparser.py                    |  3 ++-
66fe91
 setup.py                                           | 13 +++++++------
66fe91
 tox.ini                                            |  2 +-
66fe91
 7 files changed, 18 insertions(+), 12 deletions(-)
66fe91
 create mode 100644 custodia/vendor/__init__.py
66fe91
66fe91
diff --git a/custodia/compat.py b/custodia/compat.py
66fe91
index 87626e1..5434b93 100644
66fe91
--- a/custodia/compat.py
66fe91
+++ b/custodia/compat.py
66fe91
@@ -7,7 +7,7 @@ import six
66fe91
 
66fe91
 if six.PY2:
66fe91
     # use https://pypi.python.org/pypi/configparser/ on Python 2
66fe91
-    from backports import configparser
66fe91
+    from custodia.vendor.backports import configparser
66fe91
     from urllib import quote as url_escape
66fe91
     from urllib import quote_plus, unquote
66fe91
     from urlparse import parse_qs, urlparse
66fe91
diff --git a/custodia/vendor/__init__.py b/custodia/vendor/__init__.py
66fe91
new file mode 100644
66fe91
index 0000000..3ad9513
66fe91
--- /dev/null
66fe91
+++ b/custodia/vendor/__init__.py
66fe91
@@ -0,0 +1,2 @@
66fe91
+from pkgutil import extend_path
66fe91
+__path__ = extend_path(__path__, __name__)
66fe91
diff --git a/custodia/vendor/backports/configparser/__init__.py b/custodia/vendor/backports/configparser/__init__.py
66fe91
index 06d7a08..16c0c80 100644
66fe91
--- a/custodia/vendor/backports/configparser/__init__.py
66fe91
+++ b/custodia/vendor/backports/configparser/__init__.py
66fe91
@@ -1,5 +1,6 @@
66fe91
 #!/usr/bin/env python
66fe91
 # -*- coding: utf-8 -*-
66fe91
+# pylint: disable-all
66fe91
 
66fe91
 """Configuration file parser.
66fe91
 
66fe91
@@ -135,9 +136,9 @@ import re
66fe91
 import sys
66fe91
 import warnings
66fe91
 
66fe91
-from backports.configparser.helpers import OrderedDict as _default_dict
66fe91
-from backports.configparser.helpers import ChainMap as _ChainMap
66fe91
-from backports.configparser.helpers import from_none, open, str, PY2
66fe91
+from .helpers import OrderedDict as _default_dict
66fe91
+from .helpers import ChainMap as _ChainMap
66fe91
+from .helpers import from_none, open, str, PY2
66fe91
 
66fe91
 __all__ = ["NoSectionError", "DuplicateOptionError", "DuplicateSectionError",
66fe91
            "NoOptionError", "InterpolationError", "InterpolationDepthError",
66fe91
diff --git a/custodia/vendor/backports/configparser/helpers.py b/custodia/vendor/backports/configparser/helpers.py
66fe91
index c47662f..64f8c33 100644
66fe91
--- a/custodia/vendor/backports/configparser/helpers.py
66fe91
+++ b/custodia/vendor/backports/configparser/helpers.py
66fe91
@@ -1,5 +1,6 @@
66fe91
 #!/usr/bin/env python
66fe91
 # -*- coding: utf-8 -*-
66fe91
+# pylint: disable-all
66fe91
 
66fe91
 from __future__ import absolute_import
66fe91
 from __future__ import division
66fe91
diff --git a/custodia/vendor/configparser.py b/custodia/vendor/configparser.py
66fe91
index b899f9e..6379d87 100644
66fe91
--- a/custodia/vendor/configparser.py
66fe91
+++ b/custodia/vendor/configparser.py
66fe91
@@ -1,5 +1,6 @@
66fe91
 #!/usr/bin/env python
66fe91
 # -*- coding: utf-8 -*-
66fe91
+# pylint: disable-all
66fe91
 
66fe91
 """Convenience module importing everything from backports.configparser."""
66fe91
 
66fe91
@@ -9,7 +10,7 @@ from __future__ import print_function
66fe91
 from __future__ import unicode_literals
66fe91
 
66fe91
 
66fe91
-from backports.configparser import (
66fe91
+from .backports.configparser import (
66fe91
     RawConfigParser,
66fe91
     ConfigParser,
66fe91
     SafeConfigParser,
66fe91
diff --git a/setup.py b/setup.py
66fe91
index 96c14c7..a7c398a 100755
66fe91
--- a/setup.py
66fe91
+++ b/setup.py
66fe91
@@ -2,8 +2,6 @@
66fe91
 #
66fe91
 # Copyright (C) 2015  Custodia project Contributors, for licensee see COPYING
66fe91
 
66fe91
-import sys
66fe91
-
66fe91
 import setuptools
66fe91
 from setuptools import setup
66fe91
 
66fe91
@@ -33,10 +31,10 @@ extras_require = {
66fe91
 
66fe91
 # backwards compatibility with old setuptools
66fe91
 # extended interpolation is provided by stdlib in Python 3.4+
66fe91
-if SETUPTOOLS_VERSION < (18, 0, 0) and sys.version_info < (3, 4):
66fe91
-    requirements.append('configparser')
66fe91
-else:
66fe91
-    extras_require[':python_version<"3.4"'] = ['configparser']
66fe91
+# if SETUPTOOLS_VERSION < (18, 0, 0) and sys.version_info < (3, 4):
66fe91
+#     requirements.append('configparser')
66fe91
+# else:
66fe91
+#     extras_require[':python_version<"3.4"'] = ['configparser']
66fe91
 
66fe91
 
66fe91
 with open('README') as f:
66fe91
@@ -94,6 +92,9 @@ setup(
66fe91
         'custodia.message',
66fe91
         'custodia.server',
66fe91
         'custodia.store',
66fe91
+        'custodia.vendor',
66fe91
+        'custodia.vendor.backports',
66fe91
+        'custodia.vendor.backports.configparser',
66fe91
     ],
66fe91
     entry_points={
66fe91
         'console_scripts': [
66fe91
diff --git a/tox.ini b/tox.ini
66fe91
index 8db1c8b..d90359d 100644
66fe91
--- a/tox.ini
66fe91
+++ b/tox.ini
66fe91
@@ -76,7 +76,7 @@ markers =
66fe91
     servertest: Integration tests start a local Custodia server
66fe91
 
66fe91
 [flake8]
66fe91
-exclude = .tox,*.egg,dist,build,docs/source
66fe91
+exclude = .tox,*.egg,dist,build,docs/source,custodia/vendor
66fe91
 show-source = true
66fe91
 max-line-length = 79
66fe91
 ignore = N802
66fe91
-- 
66fe91
2.9.3
66fe91