From 26d7a8d3765de07b083e7d175fe60e88910c5c1e443d13ba14b9c5d3d4d007cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Thu, 6 Dec 2018 11:56:31 +0000 Subject: [PATCH] osc copypac from project:home:mcepl:work package:python-typing_extensions revision:3 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-typing_extensions?expand=0&rev=2 --- fix_tests.patch | 29 +++++++++++++++++++++++++++++ python-typing_extensions.spec | 32 ++++++++++++++++++++++---------- test_modules.tar.gz | 3 +++ 3 files changed, 54 insertions(+), 10 deletions(-) create mode 100644 fix_tests.patch create mode 100644 test_modules.tar.gz diff --git a/fix_tests.patch b/fix_tests.patch new file mode 100644 index 0000000..2cfff67 --- /dev/null +++ b/fix_tests.patch @@ -0,0 +1,29 @@ +--- a/src_py3/test_typing_extensions.py ++++ b/src_py3/test_typing_extensions.py +@@ -31,7 +31,7 @@ except ImportError: + + # We assume Python versions *below* 3.5.0 will have the most + # up-to-date version of the typing module installed. Since +-# the typing module isn't a part of the standard library in older ++# the typing module isn't a part of the standard library in older + # versions of Python, those users are likely to have a reasonably + # modern version of `typing` installed from PyPi. + TYPING_LATEST = sys.version_info[:3] < (3, 5, 0) +@@ -288,7 +288,7 @@ else: + AwaitableWrapper = AsyncIteratorWrapper = ACM = object + + PY36_TESTS = """ +-from test import ann_module, ann_module2, ann_module3 ++import ann_module, ann_module2, ann_module3 + from typing_extensions import AsyncContextManager + from typing import NamedTuple + +@@ -1313,7 +1313,7 @@ class AllTests(BaseTestCase): + file_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), + 'typing_extensions.py') + try: +- subprocess.check_output('python -OO {}'.format(file_path), ++ subprocess.check_output('python3 -OO {}'.format(file_path), + stderr=subprocess.STDOUT, + shell=True) + except subprocess.CalledProcessError: diff --git a/python-typing_extensions.spec b/python-typing_extensions.spec index f762fca..e024360 100644 --- a/python-typing_extensions.spec +++ b/python-typing_extensions.spec @@ -1,5 +1,5 @@ # -# spec file for package python-typing-extensions +# spec file for package python-typing_extensions # # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # @@ -12,7 +12,9 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + %define skip_python2 1 %define modname typing_extensions @@ -20,16 +22,23 @@ Name: python-typing_extensions Version: 3.6.6 Release: 0 -License: Python-2.0 Summary: Backported and Experimental Type Hints for Python 35+ -Url: https://github.com/python/typing/ +License: Python-2.0 Group: Development/Languages/Python -Source: https://files.pythonhosted.org/packages/source/t/%{modname}/%{modname}-%{version}.tar.gz -BuildRequires: python-rpm-macros +URL: https://github.com/python/typing/ +Source0: https://files.pythonhosted.org/packages/source/t/typing_extensions/%{modname}-%{version}.tar.gz +Source1: test_modules.tar.gz +Patch0: fix_tests.patch +BuildRequires: %{python_module flake8-bugbear} +BuildRequires: %{python_module flake8-pyi} +BuildRequires: %{python_module flake8} +BuildRequires: %{python_module pytest >= 3.0} +BuildRequires: %{python_module pytest-cov >= 2.4.0} +BuildRequires: %{python_module pytest-xdist >= 1.18} BuildRequires: %{python_module setuptools} BuildRequires: fdupes +BuildRequires: python-rpm-macros BuildArch: noarch - %python_subpackages %description @@ -49,9 +58,9 @@ the ``typing`` module from PyPi instead of using this one unless specifically writing code that must be compatible with multiple Python versions or requires experimental types. - %prep %setup -q -n %{modname}-%{version} +%autopatch -p1 %build %python_build @@ -61,10 +70,13 @@ Python versions or requires experimental types. %fdupes %{buildroot}%{python3_sitelib} %check -%python_exec setup.py test +cd src_py3 +tar xvf %{SOURCE1} +%__python3 test_typing_extensions.py %files %{python_files} -%doc LICENSE README.rst +%license LICENSE +%doc README.rst %{python3_sitelib}/* %changelog diff --git a/test_modules.tar.gz b/test_modules.tar.gz new file mode 100644 index 0000000..71509f2 --- /dev/null +++ b/test_modules.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:197b3c64106db87f9f11522e24307125038bd38b0acd7ad7b3b64c1423d48e03 +size 17042