forked from pool/python-wcwidth
- Add patch remove-pkg_resources.patch:
* Use importlib.metadata rather than pkg_resources. - Since importlib.metadata is not as a stickler as pkg_resources is, remove multibuild. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-wcwidth?expand=0&rev=35
This commit is contained in:
51
remove-pkg_resources.patch
Normal file
51
remove-pkg_resources.patch
Normal file
@@ -0,0 +1,51 @@
|
||||
Index: wcwidth-0.2.5/tests/test_core.py
|
||||
===================================================================
|
||||
--- wcwidth-0.2.5.orig/tests/test_core.py
|
||||
+++ wcwidth-0.2.5/tests/test_core.py
|
||||
@@ -1,7 +1,10 @@
|
||||
# coding: utf-8
|
||||
"""Core tests for wcwidth module."""
|
||||
# 3rd party
|
||||
-import pkg_resources
|
||||
+try:
|
||||
+ import importlib.metadata as importmeta
|
||||
+except ImportError:
|
||||
+ import importlib_metadata as importmeta
|
||||
|
||||
# local
|
||||
import wcwidth
|
||||
@@ -10,7 +13,7 @@ import wcwidth
|
||||
def test_package_version():
|
||||
"""wcwidth.__version__ is expected value."""
|
||||
# given,
|
||||
- expected = pkg_resources.get_distribution('wcwidth').version
|
||||
+ expected = importmeta.version('wcwidth')
|
||||
|
||||
# exercise,
|
||||
result = wcwidth.__version__
|
||||
Index: wcwidth-0.2.5/tests/test_ucslevel.py
|
||||
===================================================================
|
||||
--- wcwidth-0.2.5.orig/tests/test_ucslevel.py
|
||||
+++ wcwidth-0.2.5/tests/test_ucslevel.py
|
||||
@@ -6,7 +6,6 @@ import warnings
|
||||
|
||||
# 3rd party
|
||||
import pytest
|
||||
-import pkg_resources
|
||||
|
||||
# local
|
||||
import wcwidth
|
||||
Index: wcwidth-0.2.5/setup.py
|
||||
===================================================================
|
||||
--- wcwidth-0.2.5.orig/setup.py
|
||||
+++ wcwidth-0.2.5/setup.py
|
||||
@@ -52,7 +52,8 @@ def main():
|
||||
author='Jeff Quast',
|
||||
author_email='contact@jeffquast.com',
|
||||
install_requires=('backports.functools-lru-cache>=1.2.1;'
|
||||
- 'python_version < "3.2"'),
|
||||
+ 'python_version < "3.2"',
|
||||
+ 'importlib_metadata;python_version < "3.8"'),
|
||||
license='MIT',
|
||||
packages=['wcwidth'],
|
||||
url='https://github.com/jquast/wcwidth',
|
||||
Reference in New Issue
Block a user