Ondřej Súkup 2019-11-15 07:49:54 +00:00 committed by Git OBS Bridge
parent 5360121d55
commit 1900883591
3 changed files with 43 additions and 1 deletions

39
imporlib.patch Normal file
View File

@ -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)

View File

@ -2,6 +2,7 @@
Mon Nov 11 12:47:57 UTC 2019 - Ondřej Súkup <mimi.vx@gmail.com>
- 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

View File

@ -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