forked from pool/python-urwid
Accepting request 501843 from home:alois:branches:devel:languages:python
Should work this time. OBS-URL: https://build.opensuse.org/request/show/501843 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-urwid?expand=0&rev=32
This commit is contained in:
34
python-urwid-fix_py3_test.patch
Normal file
34
python-urwid-fix_py3_test.patch
Normal file
@@ -0,0 +1,34 @@
|
||||
From 4b0ed8b6030450e6d99909a7c683e9642e546387 Mon Sep 17 00:00:00 2001
|
||||
From: Michael Hudson-Doyle <michael.hudson@canonical.com>
|
||||
Date: Wed, 7 Jun 2017 13:52:17 -0700
|
||||
Subject: [PATCH] fix test_remove_watch_file flakiness
|
||||
|
||||
pass a known-good file descriptor to watch_file rather than hard-coding 5
|
||||
|
||||
Fixes #164
|
||||
---
|
||||
urwid/tests/test_event_loops.py | 11 ++++++++---
|
||||
1 file changed, 8 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/urwid/tests/test_event_loops.py b/urwid/tests/test_event_loops.py
|
||||
index c85bbed..b01212d 100644
|
||||
--- a/urwid/tests/test_event_loops.py
|
||||
+++ b/urwid/tests/test_event_loops.py
|
||||
@@ -30,9 +30,14 @@ def test_remove_alarm(self):
|
||||
|
||||
def test_remove_watch_file(self):
|
||||
evl = self.evl
|
||||
- handle = evl.watch_file(5, lambda: None)
|
||||
- self.assertTrue(evl.remove_watch_file(handle))
|
||||
- self.assertFalse(evl.remove_watch_file(handle))
|
||||
+ fd_r, fd_w = os.pipe()
|
||||
+ try:
|
||||
+ handle = evl.watch_file(fd_r, lambda: None)
|
||||
+ self.assertTrue(evl.remove_watch_file(handle))
|
||||
+ self.assertFalse(evl.remove_watch_file(handle))
|
||||
+ finally:
|
||||
+ os.close(fd_r)
|
||||
+ os.close(fd_w)
|
||||
|
||||
_expected_idle_handle = 1
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
-------------------------------------------------------------------
|
||||
Tue May 23 07:37:03 UTC 2017 - aloisio@gmx.com
|
||||
|
||||
- Converted to single-spec
|
||||
- Updated source and homepage URLs
|
||||
- Added python-urwid-fix_py3_test.patch to address a failing
|
||||
test with python 3.6.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Mar 8 20:13:34 UTC 2016 - freitag@opensuse.org
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package python-urwid
|
||||
#
|
||||
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
|
||||
# Copyright (c) 2017 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
|
||||
@@ -16,23 +16,24 @@
|
||||
#
|
||||
|
||||
|
||||
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
||||
Name: python-urwid
|
||||
Version: 1.3.1
|
||||
Release: 0
|
||||
Url: http://excess.org/urwid/
|
||||
Summary: A full-featured console (xterm et al.) user interface library
|
||||
License: LGPL-2.1+
|
||||
Group: Development/Languages/Python
|
||||
Source: https://pypi.python.org/packages/source/u/urwid/urwid-%{version}.tar.gz
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
BuildRequires: python-devel
|
||||
BuildRequires: python-setuptools
|
||||
%if 0%{?suse_version}
|
||||
Url: http://urwid.org
|
||||
Source: https://files.pythonhosted.org/packages/source/u/urwid/urwid-%{version}.tar.gz
|
||||
# PATCH-FIX-UPSTREAM python-urwid-fix_py3_test.patch -- fixes py3 test, backported commit#4b0ed8b
|
||||
Patch0: python-urwid-fix_py3_test.patch
|
||||
BuildRequires: %{python_module devel}
|
||||
BuildRequires: %{python_module setuptools}
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: python-rpm-macros
|
||||
Requires: python-curses
|
||||
%endif
|
||||
%if 0%{?suse_version} <= 1110
|
||||
%{!?python_sitearch: %global python_sitearch %(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
|
||||
%endif
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
%python_subpackages
|
||||
|
||||
%description
|
||||
Urwid is a console user interface library. It includes many features
|
||||
@@ -50,22 +51,26 @@ useful for text console application developers including:
|
||||
|
||||
%prep
|
||||
%setup -q -n "urwid-%{version}"
|
||||
%patch0 -p1
|
||||
# remove unwanted shebang
|
||||
find urwid -name "*.py" | xargs sed -i '1 { /^#!/ d }'
|
||||
|
||||
%build
|
||||
python setup.py build
|
||||
%python_build
|
||||
|
||||
%install
|
||||
python setup.py install --prefix="%{_prefix}" --root="%{buildroot}"
|
||||
%python_install
|
||||
%python_expand %fdupes -s %{buildroot}%{$python_sitearch}
|
||||
|
||||
%check
|
||||
python setup.py -q test
|
||||
# this test won't work on OBS
|
||||
rm -f urwid/tests/test_vterm.py
|
||||
%python_exec setup.py -q test
|
||||
|
||||
%files
|
||||
%files %{python_files}
|
||||
%defattr(-,root,root,-)
|
||||
%doc COPYING README.rst
|
||||
%{python_sitearch}/urwid/
|
||||
%{python_sitearch}/urwid-%{version}-py%{py_ver}.egg-info
|
||||
%{python_sitearch}/urwid-%{version}-py%{python_version}.egg-info
|
||||
|
||||
%changelog
|
||||
|
||||
Reference in New Issue
Block a user