14
0
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:
2017-06-30 12:40:26 +00:00
committed by Git OBS Bridge
parent a6adda6d84
commit 109f892076
3 changed files with 63 additions and 16 deletions

View 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

View File

@@ -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 Tue Mar 8 20:13:34 UTC 2016 - freitag@opensuse.org

View File

@@ -1,7 +1,7 @@
# #
# spec file for package python-urwid # 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 # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@@ -16,23 +16,24 @@
# #
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-urwid Name: python-urwid
Version: 1.3.1 Version: 1.3.1
Release: 0 Release: 0
Url: http://excess.org/urwid/
Summary: A full-featured console (xterm et al.) user interface library Summary: A full-featured console (xterm et al.) user interface library
License: LGPL-2.1+ License: LGPL-2.1+
Group: Development/Languages/Python Group: Development/Languages/Python
Source: https://pypi.python.org/packages/source/u/urwid/urwid-%{version}.tar.gz Url: http://urwid.org
BuildRoot: %{_tmppath}/%{name}-%{version}-build Source: https://files.pythonhosted.org/packages/source/u/urwid/urwid-%{version}.tar.gz
BuildRequires: python-devel # PATCH-FIX-UPSTREAM python-urwid-fix_py3_test.patch -- fixes py3 test, backported commit#4b0ed8b
BuildRequires: python-setuptools Patch0: python-urwid-fix_py3_test.patch
%if 0%{?suse_version} BuildRequires: %{python_module devel}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-curses Requires: python-curses
%endif BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} <= 1110 %python_subpackages
%{!?python_sitearch: %global python_sitearch %(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
%endif
%description %description
Urwid is a console user interface library. It includes many features Urwid is a console user interface library. It includes many features
@@ -50,22 +51,26 @@ useful for text console application developers including:
%prep %prep
%setup -q -n "urwid-%{version}" %setup -q -n "urwid-%{version}"
%patch0 -p1
# remove unwanted shebang # remove unwanted shebang
find urwid -name "*.py" | xargs sed -i '1 { /^#!/ d }' find urwid -name "*.py" | xargs sed -i '1 { /^#!/ d }'
%build %build
python setup.py build %python_build
%install %install
python setup.py install --prefix="%{_prefix}" --root="%{buildroot}" %python_install
%python_expand %fdupes -s %{buildroot}%{$python_sitearch}
%check %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,-) %defattr(-,root,root,-)
%doc COPYING README.rst %doc COPYING README.rst
%{python_sitearch}/urwid/ %{python_sitearch}/urwid/
%{python_sitearch}/urwid-%{version}-py%{py_ver}.egg-info %{python_sitearch}/urwid-%{version}-py%{python_version}.egg-info
%changelog %changelog