diff --git a/asciimatics-1.10.0-py2.py3-none-any.whl b/asciimatics-1.10.0-py2.py3-none-any.whl deleted file mode 100644 index 86dbc3c..0000000 --- a/asciimatics-1.10.0-py2.py3-none-any.whl +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ccfc28a04ae39fa6f73bbf8a45cef99476df3fefafb451f67598453921c1d4ce -size 92636 diff --git a/asciimatics-1.10.0.tar.gz b/asciimatics-1.10.0.tar.gz new file mode 100644 index 0000000..ed2a814 --- /dev/null +++ b/asciimatics-1.10.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9101b0b6885542f324980bbe13a772475cd6a12678f601228eaaea412db919ab +size 1534144 diff --git a/pr_200.patch b/pr_200.patch new file mode 100644 index 0000000..b02a73b --- /dev/null +++ b/pr_200.patch @@ -0,0 +1,75 @@ +From 44bb07b4c2f582b486c060b5bb4c6fad05198827 Mon Sep 17 00:00:00 2001 +From: Peter Brittain +Date: Mon, 28 Jan 2019 09:50:50 +0000 +Subject: [PATCH] Skip tests that require a TTY when none is available - for + #199 + +--- + tests/test_effects.py | 2 ++ + tests/test_renderers.py | 12 ++++++++++-- + tests/test_screen.py | 2 ++ + 3 files changed, 14 insertions(+), 2 deletions(-) + +diff --git a/tests/test_effects.py b/tests/test_effects.py +index bc5e37b..ce9ca3c 100644 +--- a/tests/test_effects.py ++++ b/tests/test_effects.py +@@ -45,6 +45,8 @@ def test_text_effects(self): + # This typically means we're running inside a non-standard termina;. + # For example, thi happens when embedded in PyCharm. + if sys.platform != "win32": ++ if not sys.stdout.isatty(): ++ self.skipTest("Not a valid TTY") + curses.initscr() + if curses.tigetstr("ri") is None: + self.skipTest("No valid terminal definition") +diff --git a/tests/test_renderers.py b/tests/test_renderers.py +index 9af6adf..97568f0 100644 +--- a/tests/test_renderers.py ++++ b/tests/test_renderers.py +@@ -185,6 +185,8 @@ def test_colour_image_file(self): + # This typically means we're running inside a non-standard terminal. + # For example, this happens when embedded in PyCharm. + if sys.platform != "win32": ++ if not sys.stdout.isatty(): ++ self.skipTest("Not a valid TTY") + curses.initscr() + if curses.tigetstr("ri") is None: + self.skipTest("No valid terminal definition") +@@ -254,6 +256,8 @@ def test_uni_image_files(self): + # This typically means we're running inside a non-standard terminal. + # For example, this happens when embedded in PyCharm. + if sys.platform != "win32": ++ if not sys.stdout.isatty(): ++ self.skipTest("Not a valid TTY") + curses.initscr() + if curses.tigetstr("ri") is None: + self.skipTest("No valid terminal definition") +@@ -298,8 +302,12 @@ def test_rainbow(self): + # Skip for non-Windows if the terminal definition is incomplete. + # This typically means we're running inside a non-standard terminal. + # For example, this happens when embedded in PyCharm. +- if sys.platform != "win32" and curses.tigetstr("ri") is None: +- self.skipTest("No valid terminal definition") ++ if sys.platform != "win32": ++ if not sys.stdout.isatty(): ++ self.skipTest("Not a valid TTY") ++ curses.initscr() ++ if curses.tigetstr("ri") is None: ++ self.skipTest("No valid terminal definition") + + def internal_checks(screen): + # Create a base renderer +diff --git a/tests/test_screen.py b/tests/test_screen.py +index c30fe79..d669102 100644 +--- a/tests/test_screen.py ++++ b/tests/test_screen.py +@@ -46,6 +46,8 @@ def setUp(self): + # This typically means we're running inside a non-standard terminal. + # For example, this happens when embedded in PyCharm. + if sys.platform != "win32": ++ if not sys.stdout.isatty(): ++ self.skipTest("Not a valid TTY") + curses.initscr() + if curses.tigetstr("ri") is None: + self.skipTest("No valid terminal definition") diff --git a/python-asciimatics.changes b/python-asciimatics.changes index 5786c33..5ae486b 100644 --- a/python-asciimatics.changes +++ b/python-asciimatics.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Thu May 9 01:33:20 UTC 2019 - John Vandenberg + +- Activate test suite +- Add missing runtime dependency python-curses +- Add CHANGES.rst, README.rst and doc/*.rst to %doc + ------------------------------------------------------------------- Mon Mar 5 20:50:10 UTC 2018 - toddrme2178@gmail.com diff --git a/python-asciimatics.spec b/python-asciimatics.spec index 61808e1..8181cf8 100644 --- a/python-asciimatics.spec +++ b/python-asciimatics.spec @@ -1,7 +1,7 @@ # # spec file for package python-asciimatics # -# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. +# 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 @@ -24,19 +24,27 @@ Summary: Package to replace curses and create ASCII animations License: Apache-2.0 Group: Development/Languages/Python URL: https://github.com/peterbrittain/asciimatics -Source0: https://files.pythonhosted.org/packages/py2.py3/a/asciimatics/asciimatics-%{version}-py2.py3-none-any.whl -BuildRequires: %{python_module Pillow >= 2.7.0} -BuildRequires: %{python_module future} -BuildRequires: %{python_module pip} -BuildRequires: %{python_module pyfiglet >= 0.7.2} -BuildRequires: %{python_module wcwidth} +Source: https://files.pythonhosted.org/packages/source/a/asciimatics/asciimatics-%{version}.tar.gz +# isatty test skips see https://github.com/peterbrittain/asciimatics/issues/216 +Patch0: pr_200.patch +BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-Pillow >= 2.7.0 +Requires: python-curses Requires: python-future Requires: python-pyfiglet >= 0.7.2 Requires: python-wcwidth BuildArch: noarch +# SECTION test requirements +BuildRequires: %{python_module Pillow >= 2.7.0} +BuildRequires: %{python_module curses} +BuildRequires: %{python_module future} +BuildRequires: %{python_module mock} +BuildRequires: %{python_module nose} +BuildRequires: %{python_module pyfiglet >= 0.7.2} +BuildRequires: %{python_module wcwidth} +# /SECTION %python_subpackages %description @@ -44,18 +52,24 @@ Asciimatics is a package to help people create full-screen text UIs (from interactive forms to ASCII animations) on any platform. %prep -%setup -q -c -T +%setup -q -n asciimatics-%{version} +%patch0 -p1 +sed -i '/setup_requires/d' setup.py %build -# Not Needed +%python_build %install -%python_expand pip%{$python_bin_suffix} install --root=%{buildroot} %{SOURCE0} +%python_install %python_expand %fdupes %{buildroot}%{$python_sitelib} +%check +# test_image_files requires specific version of Pillow +%python_exec -m nose -v -e test_image_files + %files %{python_files} -%doc %{python_sitelib}/asciimatics-*.dist-info/DESCRIPTION.rst -%license %{python_sitelib}/asciimatics-*.dist-info/LICENSE.txt +%doc CHANGES.rst README.rst doc/source/*.rst doc/source/*.png +%license LICENSE %{python_sitelib}/* %changelog