From 19008835914a1df1e77843fd0cdd4fe9dd32b029223123f7875574801cf9d649 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20S=C3=BAkup?= Date: Fri, 15 Nov 2019 07:49:54 +0000 Subject: [PATCH] - add importlib.patch OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-setuptools?expand=0&rev=186 --- imporlib.patch | 39 +++++++++++++++++++++++++++++++++++++++ python-setuptools.changes | 1 + python-setuptools.spec | 4 +++- 3 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 imporlib.patch diff --git a/imporlib.patch b/imporlib.patch new file mode 100644 index 0000000..0264fa3 --- /dev/null +++ b/imporlib.patch @@ -0,0 +1,39 @@ +Index: setuptools-41.6.0/setuptools/_imp.py +=================================================================== +--- setuptools-41.6.0.orig/setuptools/_imp.py ++++ setuptools-41.6.0/setuptools/_imp.py +@@ -19,7 +19,10 @@ PY_FROZEN = 7 + + def find_module(module, paths=None): + """Just like 'imp.find_module()', but with package support""" +- spec = importlib.util.find_spec(module, paths) ++ if isinstance(paths, list): ++ spec = importlib.machinery.PathFinder().find_spec(module, paths) ++ else: ++ spec = importlib.util.find_spec(module, paths) + if spec is None: + raise ImportError("Can't find %s" % module) + if not spec.has_location and hasattr(spec, 'submodule_search_locations'): +@@ -60,14 +63,20 @@ def find_module(module, paths=None): + + + def get_frozen_object(module, paths=None): +- spec = importlib.util.find_spec(module, paths) ++ if isinstance(paths, list): ++ spec = importlib.machinery.PathFinder().find_spec(module, paths) ++ else: ++ spec = importlib.util.find_spec(module, paths) + if not spec: + raise ImportError("Can't find %s" % module) + return spec.loader.get_code(module) + + + def get_module(module, paths, info): +- spec = importlib.util.find_spec(module, paths) ++ if isinstance(paths, list): ++ spec = importlib.machinery.PathFinder().find_spec(module, paths) ++ else: ++ spec = importlib.util.find_spec(module, paths) + if not spec: + raise ImportError("Can't find %s" % module) + return module_from_spec(spec) diff --git a/python-setuptools.changes b/python-setuptools.changes index b91c565..5b3df73 100644 --- a/python-setuptools.changes +++ b/python-setuptools.changes @@ -2,6 +2,7 @@ Mon Nov 11 12:47:57 UTC 2019 - Ondřej Súkup - update to 41.6.0 +- add importlib.patch * Replace usage of deprecated imp module with local re-implementation in setuptools._imp * Fix pkg_resources.Requirement hash/equality implementation diff --git a/python-setuptools.spec b/python-setuptools.spec index 9c3b963..6bde333 100644 --- a/python-setuptools.spec +++ b/python-setuptools.spec @@ -1,7 +1,7 @@ # # spec file for package python-setuptools # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2019 SUSE LLC. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -36,6 +36,7 @@ Source: https://files.pythonhosted.org/packages/source/s/setuptools/setu Source1: psfl.txt Source2: zpl.txt Patch0: sort-for-reproducibility.patch +Patch1: imporlib.patch BuildRequires: %{python_module appdirs} BuildRequires: %{python_module ordered-set} BuildRequires: %{python_module packaging} @@ -87,6 +88,7 @@ especially ones that have dependencies on other packages. %prep %setup -q -n setuptools-%{version} %patch0 -p1 +%patch1 -p1 find . -type f -name "*.orig" -delete # fix rpmlint spurious-executable-perm