From 4f53d0c02d317fdbaa7d54d19a27d1a5eb24a65c Mon Sep 17 00:00:00 2001 From: Jakub Bogusz Date: Thu, 16 Mar 2017 22:04:52 +0100 Subject: [PATCH] - updated to 1.2.1 - adjusted known_failures_pld patch (disable also socket_dns6 test) - added tests patch (fix test with newer coreutils, avoid failure on python3.6) --- known_failures-pld.patch | 10 ++- python-gevent-tests.patch | 25 ++++++ python-gevent.spec | 173 ++++++++++++++++++++++++-------------- 3 files changed, 139 insertions(+), 69 deletions(-) create mode 100644 python-gevent-tests.patch diff --git a/known_failures-pld.patch b/known_failures-pld.patch index f21f85b..1eced2c 100644 --- a/known_failures-pld.patch +++ b/known_failures-pld.patch @@ -1,7 +1,6 @@ -diff -dur gevent-1.1.0.orig/known_failures.py gevent-1.1.0/known_failures.py ---- gevent-1.1.0.orig/known_failures.py 2016-03-05 14:10:58.000000000 +0100 -+++ gevent-1.1.0/known_failures.py 2016-03-14 13:24:11.000000000 +0100 -@@ -33,8 +33,232 @@ +--- gevent-1.1.0.orig/src/greentest/known_failures.py 2016-03-05 14:10:58.000000000 +0100 ++++ gevent-1.1.0/src/greentest/known_failures.py 2016-03-14 13:24:11.000000000 +0100 +@@ -33,8 +33,235 @@ # we don't have that option without a new commit---and sometimes we really need a build # to succeed in order to get a release wheel 'FLAKY test__issue6.py', @@ -223,6 +222,9 @@ diff -dur gevent-1.1.0.orig/known_failures.py gevent-1.1.0/known_failures.py + # DNS + 'FLAKY test__socket_dns.py', + ++ # DNS, non-deterministic order ++ 'FLAKY test__socket_dns6.py', ++ + # DNS + 'FLAKY test__getaddrinfo_import.py', + diff --git a/python-gevent-tests.patch b/python-gevent-tests.patch new file mode 100644 index 0000000..82910fe --- /dev/null +++ b/python-gevent-tests.patch @@ -0,0 +1,25 @@ +--- gevent-1.2.1/src/greentest/test__doctests.py.orig 2017-01-12 14:15:25.000000000 +0100 ++++ gevent-1.2.1/src/greentest/test__doctests.py 2017-03-14 22:18:48.660258016 +0100 +@@ -68,9 +68,12 @@ + # 'cannot access' + (re.compile('cannot access non_existent_file: No such file or directory'), + 'non_existent_file: No such file or directory'), ++ (re.compile("cannot access 'non_existent_file': No such file or directory"), ++ 'non_existent_file: No such file or directory'), + # Python 3 bytes add a "b". + (re.compile(r'b(".*?")'), r"\1"), + (re.compile(r"b('.*?')"), r"\1"), ++ (re.compile(r'^"(.*?)"$'), r"'\1'"), + )) + + tests_count = 0 +--- gevent-1.2.1/src/greentest/test__signal.py.orig 2017-01-12 14:15:25.000000000 +0100 ++++ gevent-1.2.1/src/greentest/test__signal.py 2017-03-15 15:48:49.582871992 +0100 +@@ -71,7 +71,6 @@ + reload_module(site) + except TypeError: + assert greentest.PY36 +- assert greentest.RUNNING_ON_CI + import sys + for m in set(sys.modules.values()): + try: diff --git a/python-gevent.spec b/python-gevent.spec index ab03125..55657a1 100644 --- a/python-gevent.spec +++ b/python-gevent.spec @@ -7,70 +7,90 @@ # (now excluded via known_failures-pld.patch) # Conditional build: -%bcond_without tests # do not run tests -%bcond_with system_libev # build with system libev (more tests will fail) +%bcond_without tests # do not run tests +%bcond_with system_libev # build with system libev [test__core_stat.py test fails] %bcond_without system_c_ares # build with system c_ares -%bcond_without python2 # CPython 2.x module -%bcond_without python3 # CPython 3.x module +%bcond_without python2 # CPython 2.x module +%bcond_without python3 # CPython 3.x module -%define module gevent -Summary: A coroutine-based Python networking library +%define module gevent +Summary: A coroutine-based Python 2 networking library +Summary(pl.UTF-8): Biblioteka sieciowa dla Pythona 2 oparta na korutynach Name: python-%{module} -Version: 1.1.0 -Release: 2 +Version: 1.2.1 +Release: 1 Epoch: 1 License: MIT Group: Development/Languages -Source0: http://pypi.python.org/packages/source/g/gevent/%{module}-%{version}.tar.gz -# Source0-md5: 24b3e44134fbff250526f3b949763f99 +#Source0Download: https://pypi.python.org/simple/gevent +Source0: http://files.pythonhosted.org/packages/source/g/gevent/%{module}-%{version}.tar.gz +# Source0-md5: 6700a2433c8e0635425e6798760efc81 Patch0: known_failures-pld.patch +Patch1: %{name}-tests.patch URL: http://www.gevent.org/ %{?with_system_c_ares:BuildRequires: c-ares-devel >= 1.10.0} -%{?with_system_libev:BuildRequires: libev-devel >= 4.11} -#BuildRequires: python-Cython +%{?with_system_libev:BuildRequires: libev-devel >= 4.23} +# if cpython generated files need rebuild +#BuildRequires: python-Cython >= 0.25.1 %if %{with python2} -BuildRequires: python-devel +BuildRequires: python-cffi >= 1.3.0 +BuildRequires: python-devel >= 1:2.7 %if %{with tests} -BuildRequires: python-devel-src -BuildRequires: python-greenlet >= 0.3.2 +BuildRequires: python-coverage >= 4.0 +BuildRequires: python-devel-src >= 1:2.7 +BuildRequires: python-greenlet >= 0.4.10 +BuildRequires: python-setuptools BuildRequires: python-test %endif %endif %if %{with python3} -BuildRequires: python3-devel +BuildRequires: python3-cffi >= 1.3.0 +BuildRequires: python3-devel >= 1:3.3 %if %{with tests} -BuildRequires: python3-greenlet >= 0.3.2 +BuildRequires: python3-coverage >= 4.0 +BuildRequires: python3-greenlet >= 0.4.10 +BuildRequires: python3-setuptools BuildRequires: python3-test %endif %endif BuildRequires: rpm-pythonprov -BuildRequires: rpmbuild(macros) >= 1.710 -Requires: python-greenlet >= 0.3.2 +BuildRequires: rpmbuild(macros) >= 1.714 +%{?with_system_libev:Requires: libev >= 4.23} +Requires: python-greenlet >= 0.4.10 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) %description -gevent is a coroutine-based Python networking library. - -Features include: - +gevent is a coroutine-based Python networking library. Features +include: - Fast event loop based on libev. - Lightweight execution units based on greenlet. - Familiar API that re-uses concepts from the Python standard library. - Cooperative sockets with SSL support. - DNS queries performed through c-ares or a threadpool. - Ability to use standard library and 3rd party modules written for - standard blocking sockets + standard blocking sockets. + +%description -l pl.UTF-8 +gevent to biblioteka sieciowa dla Pythona oparta na korutynach. Jej +możliwości to m.in. +- szybka pętla zdarzeń oparta na libev +- lekkie jednostki wykonywania oparte na bibliotece greenlet +- znajome API wykorzystujące koncepty biblioteki standardowej Pythona +- gniazda kooperatywne z obsługą SSL +- zapytania DNS wykonywane przez bibliotekę c-ares lub pulę wątków +- możliwość wykorzystania biblioteki standardowej lub modułów innych + producentów napisanych dla standardowych gniazd blokujących %package -n python3-%{module} -Summary: A coroutine-based Python networking library +Summary: A coroutine-based Python 3 networking library +Summary(pl.UTF-8): Biblioteka sieciowa dla Pythona 3 oparta na korutynach Group: Libraries/Python -Requires: python-greenlet >= 0.3.2 +%{?with_system_libev:Requires: libev >= 4.23} +Requires: python-greenlet >= 0.4.10 %description -n python3-%{module} -gevent is a coroutine-based Python networking library. - -Features include: - +gevent is a coroutine-based Python networking library. Features +include: - Fast event loop based on libev. - Lightweight execution units based on greenlet. - Familiar API that re-uses concepts from the Python standard library. @@ -79,58 +99,72 @@ Features include: - Ability to use standard library and 3rd party modules written for standard blocking sockets +%description -n python3-%{module} -l pl.UTF-8 +gevent to biblioteka sieciowa dla Pythona oparta na korutynach. Jej +możliwości to m.in. +- szybka pętla zdarzeń oparta na libev +- lekkie jednostki wykonywania oparte na bibliotece greenlet +- znajome API wykorzystujące koncepty biblioteki standardowej Pythona +- gniazda kooperatywne z obsługą SSL +- zapytania DNS wykonywane przez bibliotekę c-ares lub pulę wątków +- możliwość wykorzystania biblioteki standardowej lub modułów innych + producentów napisanych dla standardowych gniazd blokujących + %prep %setup -q -n %{module}-%{version} %patch0 -p1 +%patch1 -p1 -b .orig %build # when Cython-generated files are to be rebuilt # (BR: python-Cython must be enabled then too) # ln -s Makefile.ext Makefile +# must be exported to work (py*_build macro is not single invocation) +%{?with_system_libev:export LIBEV_EMBED=false} +%{?with_system_c_ares:export CARES_EMBED=false} + %if %{with python2} -CC="%{__cc}" \ -CFLAGS="%{rpmcflags}" \ -%{?with_system_libev:LIBEV_EMBED=false} \ -%{?with_system_c_ares:CARES_EMBED=false} \ %py_build %if %{with tests} -cd greentest -PYTHONPATH=$PWD/$(ls -1d ../build-2/lib.*) %{__python} testrunner.py --config ../known_failures.py -cd .. +PKGDIR=$(echo $PWD/build-2/lib.*) +cd src/greentest +PYTHONPATH=$PKGDIR %{__python} testrunner.py --config known_failures.py +cd ../.. %endif %endif %if %{with python3} -CC="%{__cc}" \ -CFLAGS="%{rpmcflags}" \ -%{?with_system_libev:LIBEV_EMBED=false} \ -%{?with_system_c_ares:CARES_EMBED=false} \ %py3_build %if %{with tests} -cd greentest -PYTHONPATH=$PWD/$(ls -1d ../build-3/lib.*) %{__python3} testrunner.py --config ../known_failures.py -cd .. +PKGDIR=$(echo $PWD/build-3/lib.*) +cd src/greentest +PYTHONPATH=$PKGDIR %{__python3} testrunner.py --config known_failures.py +cd ../.. %endif %endif %install rm -rf $RPM_BUILD_ROOT +%{?with_system_libev:export LIBEV_EMBED=false} +%{?with_system_c_ares:export CARES_EMBED=false} + %if %{with python2} -%{?with_system_libev:LIBEV_EMBED=false} \ -%{?with_system_c_ares:CARES_EMBED=false} \ %py_install %py_postclean +%{__rm} $RPM_BUILD_ROOT%{py_sitedir}/gevent/*.{c,h,pyx} +%{__rm} $RPM_BUILD_ROOT%{py_sitedir}/gevent/libev/*.{c,h,pyx,ppyx} %endif %if %{with python3} -%{?with_system_libev:LIBEV_EMBED=false} \ -%{?with_system_c_ares:CARES_EMBED=false} \ %py3_install + +%{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/gevent/*.{c,h,pyx} +%{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/gevent/libev/*.{c,h,pyx,ppyx} %endif %clean @@ -139,26 +173,35 @@ rm -rf $RPM_BUILD_ROOT %if %{with python2} %files %defattr(644,root,root,755) -%doc LICENSE README.rst -%dir %{py_sitedir}/%{module} -%{py_sitedir}/%{module}/*.py[co] -%attr(755,root,root) %{py_sitedir}/%{module}/_semaphore.so -%attr(755,root,root) %{py_sitedir}/%{module}/ares.so -%attr(755,root,root) %{py_sitedir}/%{module}/corecext.so -%if "%{py_ver}" > "2.4" -%{py_sitedir}/%{module}-%{version}-py%{py_ver}.egg-info -%endif +%doc AUTHORS LICENSE NOTICE README.rst TODO +%dir %{py_sitedir}/gevent +%attr(755,root,root) %{py_sitedir}/gevent/_semaphore.so +%attr(755,root,root) %{py_sitedir}/gevent/ares.so +%{py_sitedir}/gevent/*.pxd +%{py_sitedir}/gevent/*.py[co] +%dir %{py_sitedir}/gevent/libev +%attr(755,root,root) %{py_sitedir}/gevent/libev/_corecffi.so +%attr(755,root,root) %{py_sitedir}/gevent/libev/corecext.so +%{py_sitedir}/gevent/libev/libev.pxd +%{py_sitedir}/gevent/libev/*.py[co] +%{py_sitedir}/gevent-%{version}-py%{py_ver}.egg-info %endif %if %{with python3} %files -n python3-%{module} %defattr(644,root,root,755) -%doc LICENSE README.rst -%dir %{py3_sitedir}/%{module} -%{py3_sitedir}/%{module}/__pycache__ -%{py3_sitedir}/%{module}/*.py* -%attr(755,root,root) %{py3_sitedir}/%{module}/_semaphore*.so -%attr(755,root,root) %{py3_sitedir}/%{module}/ares*.so -%attr(755,root,root) %{py3_sitedir}/%{module}/corecext*.so -%{py3_sitedir}/%{module}-%{version}-py*.egg-info +%doc AUTHORS LICENSE NOTICE README.rst TODO +%dir %{py3_sitedir}/gevent +%attr(755,root,root) %{py3_sitedir}/gevent/_semaphore.cpython-*.so +%attr(755,root,root) %{py3_sitedir}/gevent/ares.cpython-*.so +%{py3_sitedir}/gevent/__pycache__ +%{py3_sitedir}/gevent/*.pxd +%{py3_sitedir}/gevent/*.py +%dir %{py3_sitedir}/gevent/libev +%attr(755,root,root) %{py3_sitedir}/gevent/libev/_corecffi.cpython-*.so +%attr(755,root,root) %{py3_sitedir}/gevent/libev/corecext.cpython-*.so +%{py3_sitedir}/gevent/libev/__pycache__ +%{py3_sitedir}/gevent/libev/libev.pxd +%{py3_sitedir}/gevent/libev/*.py +%{py3_sitedir}/gevent-%{version}-py*.egg-info %endif -- 2.43.0