3 %bcond_without tests # unit tests
4 %bcond_without python2 # CPython 2.x module
5 %bcond_without python3 # CPython 3.x module
7 %define module blessings
8 %define egg_name blessings
9 %define pypi_name blessings
10 Summary: Python library for terminal coloring, styling, and positioning
11 Name: python-%{module}
15 Group: Libraries/Python
16 Source0: https://files.pythonhosted.org/packages/source/b/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
17 # Source0-md5: 38555a2bba0ace706aec58444368e022
18 Patch1: 0001-fix-tests-when-run-without-a-tty-fixes-25.patch
19 Patch2: 0002-more-fixes-for-tests-without-a-tty.patch
20 URL: https://github.com/erikrose/blessings
22 BuildRequires: python-modules >= 1:2.5
23 BuildRequires: python-nose
24 BuildRequires: python-setuptools
25 BuildRequires: python-six
28 BuildRequires: python3-modules >= 1:3.2
29 BuildRequires: python3-nose
30 BuildRequires: python3-setuptools
31 BuildRequires: python3-six
34 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
37 Blessings is a thin, practical wrapper around terminal coloring,
38 styling, and positioning in Python.
40 %package -n python3-%{module}
41 Summary: Python 3 library for terminal coloring, styling, and positioning
42 Group: Libraries/Python
44 %description -n python3-%{module}
45 Blessings is a thin, practical wrapper around terminal coloring,
46 styling, and positioning in Python.
49 %setup -q -n %{pypi_name}-%{version}
52 rm -r blessings.egg-info
58 nosetests-%{py_ver} build-2/lib
64 nosetests-%{py3_ver} build-3/lib
69 rm -rf $RPM_BUILD_ROOT
79 rm -rf $RPM_BUILD_ROOT
83 %defattr(644,root,root,755)
84 %doc README.rst LICENSE
85 %{py_sitescriptdir}/%{module}
86 %{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
90 %files -n python3-%{module}
91 %defattr(644,root,root,755)
92 %doc README.rst LICENSE
93 %{py3_sitescriptdir}/%{module}
94 %{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info