2019-10-23 07:12:16 +00:00
#
# spec file for package python-pyuv
#
2023-02-21 09:15:36 +00:00
# Copyright (c) 2023 SUSE LLC
2019-10-23 07:12:16 +00:00
#
# 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 https://bugs.opensuse.org/
#
Name : python-pyuv
Version : 1.4.0
Release : 0
Summary : Python interface for libuv
License : MIT
Group : Development/Languages/Python
URL : https://github.com/saghul/pyuv
Source : https://files.pythonhosted.org/packages/source/p/pyuv/pyuv-%{version} .tar.gz
# Both patches in https://github.com/saghul/pyuv/pull/262
Patch0 : tests_async_keyword.patch
Patch1 : tests_py3.patch
2023-06-20 10:41:02 +00:00
Patch2 : fix_building_for_Python311.patch
2023-08-30 08:34:51 +00:00
# PATCH-FIX-OPENSUSE mmachova@suse.com https://github.com/saghul/pyuv/issues/279
Patch3 : loop.patch
2019-10-23 07:12:16 +00:00
BuildRequires : %{python_module devel}
BuildRequires : %{python_module pytest}
BuildRequires : %{python_module setuptools}
BuildRequires : fdupes
BuildRequires : pkgconfig
BuildRequires : python-rpm-macros
BuildRequires : pkgconfig(libuv)
%python_subpackages
%description
Python interface for libuv.
%prep
2023-08-30 08:34:51 +00:00
%autosetup -p1 -n pyuv-%{version}
2019-10-23 07:12:16 +00:00
# Force system libuv
rm -r deps/libuv
rmdir deps
sed -i 's/self.use_system_libuv = 0/self.use_system_libuv = 1/' setup_libuv.py
sed -i 's/"python"/sys.executable/' tests/test_process.py
# Allow tests to be invoked at parent directory, and proc_*.py found in subdirectory
sed -i 's:"proc_:"tests/proc_:' tests/test_process.py
%build
export CFLAGS=" %{optflags} "
2022-06-22 22:45:38 +00:00
sed -i 's/Py_REFCNT(self) = refcnt/Py_SET_REFCNT(self, refcnt)/' src/handle.c
2023-08-30 08:34:51 +00:00
%python_build
2019-10-23 07:12:16 +00:00
%install
%python_install
%python_expand %fdupes %{buildroot} %{$python_sitearch}
%check
mv pyuv .pyuv
2021-01-25 14:05:45 +00:00
# test_sendfile_offset OOM on Python 3.6
%pytest_arch -k 'not (test_tty or test_getaddrinfo_service or test_getaddrinfo_service_bytes or UDPBroadcastTest or UDPTestMulticast or test_sendfile_offset)'
2019-10-23 07:12:16 +00:00
mv .pyuv pyuv
%files %{python_files}
%doc AUTHORS ChangeLog README.rst
%license LICENSE
2023-02-21 09:15:36 +00:00
%{python_sitearch} /pyuv
%{python_sitearch} /pyuv-%{version} *-info
2019-10-23 07:12:16 +00:00
%changelog