From 813accbae83d666175189acd9f0befd65fcd830de0fe5ab5924d3592900ccc18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Wed, 23 Oct 2019 07:12:16 +0000 Subject: [PATCH] Accepting request 741316 from home:jayvdb:i3 dependency of https://build.opensuse.org/package/show/home:jayvdb:i3/powerline ; factory package doesnt declare the dependency OBS-URL: https://build.opensuse.org/request/show/741316 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pyuv?expand=0&rev=1 --- .gitattributes | 23 ++++++++++++ .gitignore | 1 + python-pyuv.changes | 11 ++++++ python-pyuv.spec | 74 +++++++++++++++++++++++++++++++++++++++ pyuv-1.4.0.tar.gz | 3 ++ tests_async_keyword.patch | 65 ++++++++++++++++++++++++++++++++++ tests_py3.patch | 14 ++++++++ 7 files changed, 191 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 python-pyuv.changes create mode 100644 python-pyuv.spec create mode 100644 pyuv-1.4.0.tar.gz create mode 100644 tests_async_keyword.patch create mode 100644 tests_py3.patch diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/python-pyuv.changes b/python-pyuv.changes new file mode 100644 index 0000000..7f77413 --- /dev/null +++ b/python-pyuv.changes @@ -0,0 +1,11 @@ +------------------------------------------------------------------- +Sun Oct 20 13:09:52 UTC 2019 - John Vandenberg + +- Activate test suite with two patches for Python 3 + * tests_py3.patch + * tests_async_keyword.patch + +------------------------------------------------------------------- +Tue Sep 10 01:32:43 PM UTC 2019 - John Vandenberg + +- Initial spec for v1.4.0 diff --git a/python-pyuv.spec b/python-pyuv.spec new file mode 100644 index 0000000..cea1547 --- /dev/null +++ b/python-pyuv.spec @@ -0,0 +1,74 @@ +# +# spec file for package python-pyuv +# +# Copyright (c) 2019 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 https://bugs.opensuse.org/ +# + + +%{?!python_module:%define python_module() python-%{**} python3-%{**}} +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 +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 +%setup -q -n pyuv-%{version} +%patch0 -p1 +%patch1 -p1 +# 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}" +%python_build + +%install +%python_install +%python_expand %fdupes %{buildroot}%{$python_sitearch} + +%check +mv pyuv .pyuv +%pytest_arch -k 'not (test_tty or test_getaddrinfo_service or test_getaddrinfo_service_bytes or UDPBroadcastTest or UDPTestMulticast)' +mv .pyuv pyuv + +%files %{python_files} +%doc AUTHORS ChangeLog README.rst +%license LICENSE +%{python_sitearch}/* + +%changelog diff --git a/pyuv-1.4.0.tar.gz b/pyuv-1.4.0.tar.gz new file mode 100644 index 0000000..1e47a04 --- /dev/null +++ b/pyuv-1.4.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:caea2004d1125fe17cbde3c211c8abc72844e9b8dd7dfa007711e98fbc96fbc2 +size 400526 diff --git a/tests_async_keyword.patch b/tests_async_keyword.patch new file mode 100644 index 0000000..cd57f0e --- /dev/null +++ b/tests_async_keyword.patch @@ -0,0 +1,65 @@ +diff -ur pyuv-1.4.0-orig/tests/test_async.py pyuv-1.4.0/tests/test_async.py +--- pyuv-1.4.0-orig/tests/test_async.py 2014-12-02 03:59:46.000000000 +0700 ++++ pyuv-1.4.0/tests/test_async.py 2019-10-20 19:47:32.605757346 +0700 +@@ -12,12 +12,12 @@ + def test_async1(self): + self.async_cb_called = 0 + self.prepare_cb_called = 0 +- def async_cb(async): ++ def async_cb(async_): + with self.lock: + self.async_cb_called += 1 + n = self.async_cb_called + if n == 3: +- self.async.close() ++ self.async_.close() + self.prepare.close() + def prepare_cb(prepare): + if self.prepare_cb_called: +@@ -31,8 +31,8 @@ + n = self.async_cb_called + if n == 3: + break +- self.async.send() +- self.async = pyuv.Async(self.loop, async_cb) ++ self.async_.send() ++ self.async_ = pyuv.Async(self.loop, async_cb) + self.prepare = pyuv.Prepare(self.loop) + self.prepare.start(prepare_cb) + self.lock = threading.Lock() +@@ -52,8 +52,8 @@ + self.loop.stop() + def thread_cb(): + time.sleep(0.01) +- self.async.send() +- self.async = pyuv.Async(self.loop) ++ self.async_.send() ++ self.async_ = pyuv.Async(self.loop) + self.prepare = pyuv.Prepare(self.loop) + self.prepare.start(prepare_cb) + self.check = pyuv.Check(self.loop) +diff -ur pyuv-1.4.0-orig/tests/test_signal.py pyuv-1.4.0/tests/test_signal.py +--- pyuv-1.4.0-orig/tests/test_signal.py 2014-12-02 03:59:46.000000000 +0700 ++++ pyuv-1.4.0/tests/test_signal.py 2019-10-20 20:00:39.561701185 +0700 +@@ -15,17 +15,17 @@ + def signal_cb(self, handle, signum): + self.assertEqual(signum, signal.SIGUSR1) + self.signal_cb_called += 1 +- self.async.send() ++ self.async_.send() + +- def async_cb(self, async): ++ def async_cb(self, async_): + self.async_cb_called += 1 +- self.async.close() ++ self.async_.close() + self.signal_h.close() + + def test_signal1(self): + self.async_cb_called = 0 + self.signal_cb_called = 0 +- self.async = pyuv.Async(self.loop, self.async_cb) ++ self.async_ = pyuv.Async(self.loop, self.async_cb) + self.signal_h = pyuv.Signal(self.loop) + self.signal_h.start(self.signal_cb, signal.SIGUSR1) + thread = threading.Thread(target=self.loop.run) diff --git a/tests_py3.patch b/tests_py3.patch new file mode 100644 index 0000000..f58b6bc --- /dev/null +++ b/tests_py3.patch @@ -0,0 +1,14 @@ +--- pyuv-1.4.0-orig/tests/test_fs.py 2015-12-15 15:46:33.000000000 +0700 ++++ pyuv-1.4.0/tests/test_fs.py 2019-10-20 20:01:57.978490880 +0700 +@@ -9,7 +9,10 @@ + + + # Make stat return integers +-os.stat_float_times(False) ++try: ++ os.stat_float_times(False) ++except AttributeError: ++ pass + pyuv.fs.stat_float_times(False) + +