Blame SOURCES/0002-Patch-and-integrate-vendored-configparser.patch

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