File python-gevent.spec of Package python-gevent

#
# spec file for package python-gevent
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# 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/
#


# Tests require network connection
%bcond_with tests

%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name:           python-gevent
Version:        1.2.2
Release:        0
Summary:        Python network library that uses greenlet and libevent
License:        MIT
Group:          Development/Languages/Python
Url:            http://www.gevent.org/
Source:         https://files.pythonhosted.org/packages/source/g/gevent/gevent-%{version}.tar.gz
Source100:      %{name}-rpmlintrc
BuildRequires:  %{python_module cffi}
BuildRequires:  %{python_module devel}
BuildRequires:  %{python_module greenlet}
BuildRequires:  %{python_module setuptools}
BuildRequires:  fdupes
BuildRequires:  python-rpm-macros
%if %{with tests}
BuildRequires:  %{python_module nose}
%endif
Requires:       python-cffi
Requires:       python-greenlet
Recommends:     python-psutil
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%python_subpackages

%description
Gevent is a Python networking library that uses greenlet to provide synchronous
API on top of a libevent event loop. Features include:

  * Fast event loop based on libevent.
  * 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 libevent-dns.
  * Ability to use standard library and 3rd party modules written for standard
    blocking sockets
  * Fast WSGI server based on libevent-http.

gevent is inspired by eventlet but features more consistent API, simpler
implementation and better performance. Read why others use gevent and check
out the list of the open source projects based on gevent.

%package -n python-gevent-doc
Summary:        Documentation for %{name}
Group:          Documentation/Other
Provides:       %{python_module gevent-doc = %{version}}

%description -n python-gevent-doc
Documentation and examples for %{name}.

%prep
%setup -q -n gevent-%{version}

%build
%python_build
#cd doc && make html && rm _build/html/.buildinfo # Build HTML documentation

%install
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitearch}

%if %{with tests}
%check
pushd src/greentest
export GEVENT_RESOLVER=thread
%python_exec testrunner.py --config known_failures.py
popd
%endif

%files %{python_files}
%defattr(-,root,root,-)
%doc AUTHORS LICENSE* README.rst TODO CHANGES.rst CONTRIBUTING.rst
%{python_sitearch}/gevent-%{version}-py*.egg-info
%{python_sitearch}/gevent/

%files -n python-gevent-doc
%defattr(-,root,root,-)
%doc examples/

%changelog