[packages/python-gevent] Build with system libev and c-ares

jajcus jajcus at pld-linux.org
Sat Feb 22 19:53:53 CET 2014


commit 282f7bb08b0638b2dcda02704033dae4bc9b9aaf
Author: Jacek Konieczny <jajcus at jajcus.net>
Date:   Sat Feb 22 19:50:42 2014 +0100

    Build with system libev and c-ares
    
    - description and BuildRequires updated – gevent uses now libev instead
      of libevent
    – bconds to disable embeded libev and c-ares (use system libraries by
      default)
    – two more failing tests added to known_failures-pld.txt, as those two
      test won't work when building with system libev
    – Release: 2

 known_failures-pld.txt | 21 +++++++++++++++++++++
 python-gevent.spec     | 39 ++++++++++++++++++++++++++-------------
 2 files changed, 47 insertions(+), 13 deletions(-)
---
diff --git a/python-gevent.spec b/python-gevent.spec
index 8c640a3..ccf52d3 100644
--- a/python-gevent.spec
+++ b/python-gevent.spec
@@ -5,42 +5,46 @@
 
 # Conditional build:
 %bcond_without	tests	# do not run tests
+%bcond_without	system_libev	# build with system libev (more tests will fail)
+%bcond_without	system_c_ares	# build with system c_ares
 
 %define     module  gevent
 Summary:	A coroutine-based Python networking library
 Name:		python-%{module}
 Version:	1.0
-Release:	1
+Release:	2
 License:	MIT
 Group:		Development/Languages
 URL:		http://www.gevent.org/
 Source0:	http://pypi.python.org/packages/source/g/gevent/%{module}-%{version}.tar.gz
 # Source0-md5:	33aef51a06268f5903fea378e1388e4d
 Source1:	known_failures-pld.txt
-BuildRequires:	libevent-devel >= 1.4.0
+%{?with_system_libev:BuildRequires:	c-ares-devel >= 1.10.0}
+%{?with_system_c_ares:BuildRequires:	libev-devel >= 4.11}
+#BuildRequires:	python-Cython
 BuildRequires:	python-devel
 %if %{with tests}
+BuildRequires:	python-devel-src
 BuildRequires:	python-greenlet >= 0.3.2
 BuildRequires:	python-test
-BuildRequires:	python-devel-src
-BuildRequires:	rpm-build-macros >= 1.688
+BuildRequires:	rpmbuild(macros) >= 1.688
 %endif
 BuildRequires:	rpm-pythonprov
 Requires:	python-greenlet >= 0.3.2
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
-gevent is a coroutine-based Python networking library that uses
-greenlet to provide a high-level synchronous API on top of libevent
-event loop.
+gevent is a coroutine-based Python networking library.
 
 Features include:
-  - convenient API around greenlets
-  - familiar synchronization primitives (gevent.event, gevent.queue)
-  - socket module that cooperates
-  - WSGI server on top of libevent-http
-  - DNS requests done through libevent-dns
-  - monkey patching utility to get pure Python modules to cooperate
+
+- 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 blo cking sockets
 
 %prep
 %setup -q -n %{module}-%{version}
@@ -48,8 +52,14 @@ Features include:
 cat known_failures.txt %{SOURCE1} > known_failures-merged.txt
 
 %build
+# when Cython-generated files are to be rebuilt
+# (BR: python-Cython must be enabled then too)
+# ln -s Makefile.ext Makefile
+
 CC="%{__cc}" \
 CFLAGS="%{rpmcflags}" \
+%{?with_system_libev:LIBEV_EMBED=false} \
+%{?with_system_c_ares:CARES_EMBED=false} \
 %{__python} setup.py build
 
 %if %{with tests}
@@ -60,6 +70,9 @@ cd ..
 
 %install
 rm -rf $RPM_BUILD_ROOT
+
+%{?with_system_libev:LIBEV_EMBED=false} \
+%{?with_system_c_ares:CARES_EMBED=false} \
 %{__python} setup.py install \
     --skip-build \
     --optimize=2 \
diff --git a/known_failures-pld.txt b/known_failures-pld.txt
index e69f248..4d174b4 100644
--- a/known_failures-pld.txt
+++ b/known_failures-pld.txt
@@ -13,6 +13,27 @@
 * * * -u test__pywsgi.py
 
 ######################################################
+# Tests which fail when building with system libev
+
+# When  building with system libev the 'fileno()' method of the
+# loop object is not implemented. It seems to be used only be the
+# test code, though.
+
+# | /usr/bin/python -u test__destroy.py
+#   Traceback (most recent call last):
+#     File "test__destroy.py", line 14, in <module>
+#       assert saved_loop.fileno() is None, saved_loop
+#   AttributeError: 'gevent.core.loop' object has no attribute 'fileno'
+* * * -u test__destroy.py
+
+# | /usr/bin/python -u test_close_backend_fd.py
+#   Traceback (most recent call last):
+#     File "test_close_backend_fd.py", line 11, in <module>
+#       fileno = hub.loop.fileno()
+#   AttributeError: 'gevent.core.loop' object has no attribute 'fileno'
+* * * -u test_close_backend_fd.py
+
+######################################################
 # Tests which may fail on our builders
 
 # attempts to bind to port 53
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python-gevent.git/commitdiff/282f7bb08b0638b2dcda02704033dae4bc9b9aaf



More information about the pld-cvs-commit mailing list