]> git.pld-linux.org Git - packages/python-gevent.git/blobdiff - python-gevent.spec
- disable also test_urllib2net.py
[packages/python-gevent.git] / python-gevent.spec
index b03436920a24ed1a440aae613db614f80dd5d60d..98d3b5f2af4952a4c748158890b0b87a51a73217 100644 (file)
 
 # TODO:
-#      - investigate some of the failing tests
-#        (now excluded via known_failures-pld.txt)
+#      - test__core_stat.py fails on 32-bit builds with system libev
+#        investigate/fix that and enable system libev
+#
+#      - investigate some other failing tests
+#        (now excluded via known_failures-pld.patch)
 
 # Conditional build:
-%bcond_without tests   # do not run tests
+%bcond_without doc             # Sphinx documentation
+%bcond_without tests           # testing
+%bcond_with    system_libev    # system libev [test__core_stat.py test fails]
+%bcond_without system_c_ares   # system c_ares
+%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.0
+Version:       1.4.0
 Release:       1
+Epoch:         1
 License:       MIT
 Group:         Development/Languages
+#Source0Download: https://pypi.org/simple/gevent/
+Source0:       https://files.pythonhosted.org/packages/source/g/gevent/%{module}-%{version}.tar.gz
+# Source0-md5: 6b9dd98917061803d9158e5258b8f412
+Patch0:                known_failures-pld.patch
+Patch1:                %{name}-py3.8.patch
 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
-BuildRequires: python-devel
-%{?with_tests:BuildRequires: python-greenlet >= 0.3.2}
-%{?with_tests:BuildRequires: python-test}
+%{?with_system_c_ares:BuildRequires:   c-ares-devel >= 1.10.0}
+%{?with_system_libev:BuildRequires:    libev-devel >= 4.23}
+%if %{with python2}
+BuildRequires: python-Cython >= 0.29
+BuildRequires: python-cffi >= 1.11.5
+BuildRequires: python-devel >= 1:2.7
+BuildRequires: python-greenlet-devel >= 0.4.15
+%if %{with tests}
+BuildRequires: python-coverage >= 4.0
+BuildRequires: python-devel-src >= 1:2.7
+BuildRequires: python-dns
+BuildRequires: python-futures
+BuildRequires: python-greenlet >= 0.4.15
+BuildRequires:  python-mock
+BuildRequires:  python-objgraph
+BuildRequires:  python-psutil
+BuildRequires:  python-requests
+BuildRequires: python-setuptools >= 1:24.2.0
+BuildRequires: python-test
+BuildRequires: python-zope.event
+BuildRequires: python-zope.interface
+%endif
+%endif
+%if %{with python3}
+BuildRequires: python3-Cython >= 0.29
+BuildRequires: python3-cffi >= 1.11.5
+BuildRequires: python3-devel >= 1:3.4
+BuildRequires: python3-greenlet-devel >= 0.4.15
+%if %{with tests}
+BuildRequires: python3-coverage >= 4.0
+BuildRequires: python3-dns
+BuildRequires: python3-greenlet >= 0.4.15
+BuildRequires:  python3-objgraph
+BuildRequires:  python3-psutil
+BuildRequires:  python3-requests
+BuildRequires: python3-setuptools >= 1:24.2.0
+BuildRequires: python3-test
+BuildRequires: python3-zope.event
+BuildRequires: python3-zope.interface
+%endif
+%endif
 BuildRequires: rpm-pythonprov
-Requires:      python-greenlet >= 0.3.2
+BuildRequires: rpmbuild(macros) >= 1.714
+%if %{with doc}
+BuildRequires: python3-repoze.sphinx.autointerface
+BuildRequires: sphinx-pdg
+%endif
+%{?with_system_libev:Requires: libev >= 4.23}
+Requires:      python-greenlet >= 0.4.15
 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.
-
-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
+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.
+
+%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 3 networking library
+Summary(pl.UTF-8):     Biblioteka sieciowa dla Pythona 3 oparta na korutynach
+Group:         Libraries/Python
+%{?with_system_libev:Requires: libev >= 4.23}
+Requires:      python-greenlet >= 0.4.15
+
+%description -n python3-%{module}
+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
+
+%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
+
+%package apidocs
+Summary:       API documentation for Python gevent module
+Summary(pl.UTF-8):     Dokumentacja API modułu Pythona gevent
+Group:         Documentation
+
+%description apidocs
+API documentation for Python gevent module.
+
+%description apidocs -l pl.UTF-8
+Dokumentacja API modułu Pythona gevent.
 
 %prep
 %setup -q -n %{module}-%{version}
+%patch0 -p1
+%patch1 -p1
 
-cat known_failures.txt %{SOURCE1} > known_failures-merged.txt
+find . -type f -name '*.orig' | xargs -r %{__rm}
+
+# force rebuild of Cython-generated files
+# they depend on specific deps (e.g. greenlet) versions
+%{__rm} src/gevent/{*.c,resolver/cares.c}
 
 %build
-CC="%{__cc}" \
-CFLAGS="%{rpmcflags}" \
-%{__python} setup.py build
+# 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}
+%py_build
+
+%if %{with tests}
+PYTHONPATH=$(echo $PWD/build-2/lib.*) \
+%{__python} -m gevent.tests
+%endif
+%endif
+
+%if %{with python3}
+%py3_build
 
 %if %{with tests}
-cd greentest
-PYTHONPATH=.. python testrunner.py --expected ../known_failures-merged.txt
-cd ..
+PYTHONPATH=$(echo $PWD/build-3/lib.*) \
+%{__python3} -m gevent.tests
+%endif
+%endif
+
+%if %{with doc}
+PYTHONPATH=$(echo $PWD/build-2/lib.*) \
+%{__make} -C doc html \
+       SPHINXBUILD=sphinx-build-2
 %endif
 
 %install
 rm -rf $RPM_BUILD_ROOT
-%{__python} setup.py install \
-    --skip-build \
-    --optimize=2 \
-    --root=$RPM_BUILD_ROOT
+
+%{?with_system_libev:export LIBEV_EMBED=false}
+%{?with_system_c_ares:export CARES_EMBED=false}
+
+%if %{with python2}
+%py_install
 
 %py_postclean
+%{__rm} $RPM_BUILD_ROOT%{py_sitedir}/gevent/*.{c,html}
+%{__rm} $RPM_BUILD_ROOT%{py_sitedir}/gevent/*/*.{c,h,html,pyx}
+%{__rm} -r $RPM_BUILD_ROOT%{py_sitedir}/gevent/{testing,tests}
+%endif
+
+%if %{with python3}
+%py3_install
+
+%{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/gevent/*.{c,html}
+%{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/gevent/*/*.{c,h,html,pyx}
+%{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/gevent/{testing,tests}
+%endif
 
 %clean
 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}/_util.so
-%attr(755,root,root) %{py_sitedir}/%{module}/ares.so
-%attr(755,root,root) %{py_sitedir}/%{module}/core.so
-%if "%{py_ver}" > "2.4"
-%{py_sitedir}/%{module}-%{version}-py%{py_ver}.egg-info
+%doc AUTHORS CHANGES.rst LICENSE NOTICE README.rst TODO
+%dir %{py_sitedir}/gevent
+%attr(755,root,root) %{py_sitedir}/gevent/*.so
+%{py_sitedir}/gevent/*.pxd
+%{py_sitedir}/gevent/*.py[co]
+%dir %{py_sitedir}/gevent/_ffi
+%{py_sitedir}/gevent/_ffi/*.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]
+%dir %{py_sitedir}/gevent/libuv
+%{py_sitedir}/gevent/libuv/*.py[co]
+%attr(755,root,root) %{py_sitedir}/gevent/libuv/_corecffi.so
+%dir %{py_sitedir}/gevent/resolver
+%{py_sitedir}/gevent/resolver/libcares.pxd
+%{py_sitedir}/gevent/resolver/*.py[co]
+%attr(755,root,root) %{py_sitedir}/gevent/resolver/cares.so
+%{py_sitedir}/gevent-%{version}-py%{py_ver}.egg-info
+%endif
+
+%if %{with python3}
+%files -n python3-%{module}
+%defattr(644,root,root,755)
+%doc AUTHORS CHANGES.rst LICENSE NOTICE README.rst TODO
+%dir %{py3_sitedir}/gevent
+%attr(755,root,root) %{py3_sitedir}/gevent/*.cpython-*.so
+%{py3_sitedir}/gevent/__pycache__
+%{py3_sitedir}/gevent/*.pxd
+%{py3_sitedir}/gevent/*.py
+%dir %{py3_sitedir}/gevent/_ffi
+%{py3_sitedir}/gevent/_ffi/__pycache__
+%{py3_sitedir}/gevent/_ffi/*.py
+%dir %{py3_sitedir}/gevent/libuv
+%{py3_sitedir}/gevent/libuv/__pycache__
+%{py3_sitedir}/gevent/libuv/*.py
+%attr(755,root,root) %{py3_sitedir}/gevent/libuv/_corecffi.*.so
+%dir %{py3_sitedir}/gevent/libev
+%attr(755,root,root) %{py3_sitedir}/gevent/libev/_corecffi.abi3.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
+%dir %{py3_sitedir}/gevent/resolver
+%{py3_sitedir}/gevent/resolver/__pycache__
+%{py3_sitedir}/gevent/resolver/*.py
+%{py3_sitedir}/gevent/resolver/libcares.pxd
+%attr(755,root,root) %{py3_sitedir}/gevent/resolver/cares.*.so
+%{py3_sitedir}/gevent-%{version}-py*.egg-info
+%endif
+
+%if %{with doc}
+%files apidocs
+%defattr(644,root,root,755)
+%doc doc/_build/html/{_modules,_static,api,examples,*.html,*.js}
 %endif
This page took 0.123514 seconds and 4 git commands to generate.