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