Blob Blame History Raw
%global modname uvloop

Name:           python-%{modname}
Version:        0.17.0
Release:        %autorelease
Summary:        Ultra fast implementation of asyncio event loop on top of libuv

License:        MIT or ASL 2.0
Source0:        %{url}/archive/v%{version}/%{modname}-%{version}.tar.gz

BuildRequires:  gcc
BuildRequires:  libuv-devel

%global _description \
uvloop is a fast, drop-in replacement of the built-in asyncio event loop.\
uvloop is implemented in Cython and uses libuv under the hood.

%description %{_description}

%package -n python3-%{modname}
Summary:        %{summary}
BuildRequires:  python3-devel
BuildRequires:  python3-setuptools
BuildRequires:  python3-Cython
BuildRequires:  python3-aiohttp
BuildRequires:  python3-psutil
BuildRequires:  python3-pyOpenSSL

%description -n python3-%{modname} %{_description}

%autosetup -p1 -n %{modname}-%{version}
# always use cython to generate code
sed -i -e "/self.cython_always/s/False/True/"
# use system libuv
sed -i -e "/self.use_system_libuv/s/False/True/"
# To be sure, no 3rd-party stuff
rm -vrf vendor/


rm -vf %{buildroot}%{python3_sitearch}/%{modname}/
rm -vf %{buildroot}%{python3_sitearch}/%{modname}/__pycache__/_testbase.*

# fix path for
sed -i "s:import sys:import sys\nsys.path.append\(os.path.abspath\(os.path.dirname\(__file__\)\)\)\n:" tests/

# test_write_buffer_full (tests.test_pipes.Test_AIO_Pipes.test_write_buffer_full) ... FAIL
# test_write_buffer_full (tests.test_pipes.Test_UV_Pipes.test_write_buffer_full) ... FAIL
%ifnarch ppc64le
%{__python3} test

%files -n python3-%{modname}
%doc README.rst