14
0

Accepting request 486454 from home:alois:branches:devel:languages:python

OBS-URL: https://build.opensuse.org/request/show/486454
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-testtools?expand=0&rev=42
This commit is contained in:
Jan Matejek
2017-04-07 16:25:47 +00:00
committed by Git OBS Bridge
parent af9b2bda90
commit 0a6d99f274
2 changed files with 39 additions and 18 deletions

View File

@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Sun Apr 2 09:48:51 UTC 2017 - aloisio@gmx.com
- Converted to single-spec
- Added doc subpackage
-------------------------------------------------------------------
Mon Feb 27 07:31:26 UTC 2017 - shshyukriev@suse.com

View File

@@ -20,6 +20,7 @@
# enable testing with a build conditional (off by default):
%bcond_with tests
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-testtools
Version: 2.2.0
Release: 0
@@ -28,23 +29,25 @@ License: MIT
Group: Development/Languages/Python
Url: https://launchpad.net/testtools
Source: https://pypi.io/packages/source/t/testtools/testtools-%{version}.tar.gz
BuildRequires: python-devel
BuildRequires: python-extras >= 1.0.0
BuildRequires: python-python-mimeparse
BuildRequires: python-unittest2 >= 0.8.0
BuildRequires: %{python_module devel}
BuildRequires: %{python_module extras >= 1.0.0}
# Test requirement
BuildRequires: %{python_module testscenarios}
BuildRequires: %{python_module unittest2 >= 0.8.0}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
# Documentation requirements:
BuildRequires: python-Sphinx
BuildRequires: python3-Sphinx
Requires: python-extras >= 1.0.0
Requires: python-fixtures >= 1.3.0
Requires: python-pbr >= 0.11
Requires: python-python-mimeparse
Requires: python-six >= 1.4.0
Requires: python-traceback2
Requires: python-unittest2 >= 1.0.0
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%else
BuildArch: noarch
%endif
%python_subpackages
%description
testtools is a set of extensions to the Python standard library's unit tests
@@ -52,27 +55,39 @@ framework. These extensions have been derived from many years of experience
with unit tests in Python and come from many different sources. testtools
also ports recent unittest changes all the way back to Python 2.4.
%package doc
Summary: Documentation for %{name}
Group: Documentation/HTML
Requires: %{name} = %{version}
%description doc
Documentation and help files for python3-testtools.
%prep
%setup -q -n testtools-%{version}
%build
python setup.py build
python setup.py build_sphinx
# Remove unwanted hidden file
rm build/sphinx/html/.buildinfo
%python_build
%{_python_use_flavor python3}
%__python3 setup.py build_sphinx && rm build/sphinx/html/.buildinfo
%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
%python_install
%python_expand %fdupes -s %{buildroot}%{$python_sitelib}
%if %{with tests}
%check
python setup.py test
%python_exec -m testtools.run testtools.tests.test_suite
%endif
%files
%files %{python_files}
%defattr(-,root,root,-)
%doc LICENSE NEWS README.rst build/sphinx/html
%doc LICENSE NEWS README.rst
%{python_sitelib}/testtools
%{python_sitelib}/testtools-%{version}-py%{py_ver}.egg-info
%{python_sitelib}/testtools-%{version}-py%{python_version}.egg-info
%files %{python_files doc}
%defattr(-,root,root,-)
%doc build/sphinx/html
%changelog