6fb8eaa
%if 0%{?fedora} || 0%{?rhel} > 7
815572e
%global with_python3 1
0282c82
%endif
0282c82
Michel Alexandre Salim cd750e1
Name:           python-testtools
d3872c6
Version:        2.3.0
fcbf817
Release:        9%{?dist}
Michel Alexandre Salim cd750e1
Summary:        Extensions to the Python unit testing framework
Michel Alexandre Salim cd750e1
2303662
%if 0%{?rhel}
Michel Alexandre Salim cd750e1
Group:          Development/Tools
2303662
%endif
Michel Alexandre Salim cd750e1
License:        MIT
Michel Alexandre Salim cd750e1
URL:            https://launchpad.net/testtools
d3872c6
Source0:        https://pypi.io/packages/source/t/testtools/testtools-%{version}.tar.gz
2d23576
Patch0:         testtools-1.8.0-py3.patch
Michel Alexandre Salim cd750e1
39c6166
# https://github.com/testing-cabal/testtools/pull/271
39c6166
Patch1:         testtools-2.3.0-py37.patch
39c6166
Michel Alexandre Salim cd750e1
BuildArch:      noarch
Michel Alexandre Salim cd750e1
BuildRequires:  python2-devel
557d2ac
BuildRequires:  python2-extras
557d2ac
BuildRequires:  python2-mimeparse >= 0.1.4
557d2ac
BuildRequires:  python2-pbr
557d2ac
BuildRequires:  python2-setuptools
557d2ac
BuildRequires:  python2-unittest2 >= 1.0.0
557d2ac
BuildREquires:  python2-traceback2
557d2ac
BuildRequires:  python2-testscenarios
0282c82
%if 0%{?with_python3}
0282c82
BuildRequires:  python3-devel
Jerry James 0f1a7fb
BuildRequires:  python3-extras
b1d5f0c
BuildRequires:  python3-mimeparse
607a52b
BuildRequires:  python3-pbr
50efbbf
BuildRequires:  python3-setuptools
755097f
BuildRequires:  python3-unittest2
2d23576
BuildRequires:  python3-traceback2
d3872c6
BuildRequires:  python3-testscenarios
0282c82
%endif
557d2ac
BuildRequires:  python2-sphinx
Michel Alexandre Salim cd750e1
e952ad5
%global _description\
e952ad5
testtools is a set of extensions to the Python standard library's unit testing\
e952ad5
framework.\
e952ad5
e952ad5
e952ad5
%description %_description
e952ad5
e952ad5
%package -n python2-testtools
e952ad5
Summary: %summary
557d2ac
Requires:       python2-extras
557d2ac
Requires:       python2-mimeparse
557d2ac
Requires:       python2-pbr
557d2ac
Requires:       python2-unittest2 >= 1.0.0
557d2ac
Requires:       python2-traceback2
e952ad5
%{?python_provide:%python_provide python2-testtools}
b1d5f0c
e952ad5
%description -n python2-testtools %_description
0282c82
0282c82
%if 0%{?with_python3}
0282c82
%package -n python3-testtools
0282c82
Summary:        Extensions to the Python unit testing framework
0282c82
748cd6d
Requires:       python3-extras
b1d5f0c
Requires:       python3-mimeparse
2d23576
Requires:       python3-pbr
b623fc2
Requires:       python3-unittest2 >= 1.0.0
b623fc2
Requires:       python3-traceback2
b1d5f0c
0282c82
%description -n python3-testtools
0282c82
testtools is a set of extensions to the Python standard library's unit testing
0282c82
framework.
0282c82
0282c82
%endif # with_python3
0282c82
0282c82
ae2856e
%package        doc
ae2856e
Summary:        Documentation for %{name}
ae2856e
Group:          Documentation
ae2856e
557d2ac
Requires:       python2-testtools = %{version}-%{release}
ae2856e
Jerry James 0f1a7fb
# https://fedoraproject.org/wiki/Packaging:No_Bundled_Libraries#Packages_granted_temporary_exceptions
Jerry James 0f1a7fb
Provides:       bundled(jquery)
Jerry James 0f1a7fb
ae2856e
%description doc
50efbbf
This package contains HTML documentation for %{name}.
ae2856e
Michel Alexandre Salim cd750e1
Michel Alexandre Salim cd750e1
%prep
Michel Alexandre Salim cd750e1
%setup -q -n testtools-%{version}
39c6166
%patch1 -p1 -b .py37
Michel Alexandre Salim cd750e1
0282c82
%if 0%{?with_python3}
0282c82
rm -rf %{py3dir}
0282c82
cp -a . %{py3dir}
0282c82
0282c82
# make the Python 3 build load the Python 3.x compatibility library directly
0282c82
pushd %{py3dir}
2d23576
%patch0 -p1 -b .py3
0282c82
popd
0282c82
0282c82
find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
0282c82
rm %{py3dir}/testtools/_compat2x.py
0282c82
rm testtools/_compat3x.py
0282c82
%endif # with_python3
0282c82
Michel Alexandre Salim cd750e1
Michel Alexandre Salim cd750e1
%build
d3872c6
%{__python2} setup.py build
0282c82
0282c82
%if 0%{?with_python3}
0282c82
pushd %{py3dir}
0282c82
%{__python3} setup.py build
0282c82
popd
0282c82
%endif # with_python3
0282c82
Jerry James 0f1a7fb
PYTHONPATH=$PWD make -C doc html
Michel Alexandre Salim cd750e1
Michel Alexandre Salim cd750e1
Michel Alexandre Salim cd750e1
%install
0282c82
# do python3 install first in case python-testtools ever install scripts in
0282c82
# _bindir -- the one installed last should be Python 2.x's as that's the
0282c82
# current default
0282c82
%if 0%{?with_python3}
0282c82
pushd %{py3dir}
0282c82
%{__python3} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
0282c82
popd
0282c82
%endif # with_python3
0282c82
d3872c6
%{__python2} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
Michel Alexandre Salim cd750e1
Michel Alexandre Salim cd750e1
0282c82
0707c41
%check
39c6166
make PYTHON=%{__python2} check
0707c41
0282c82
%if 0%{?with_python3}
0282c82
pushd %{py3dir}
50efbbf
make PYTHON=%{__python3} check
0282c82
popd
0282c82
%endif # with_python3
0707c41
Michel Alexandre Salim cd750e1
e952ad5
%files -n python2-testtools
Jerry James 0f1a7fb
%doc NEWS README.rst
Jerry James 0f1a7fb
%license LICENSE
d3872c6
%{python2_sitelib}/*
Michel Alexandre Salim cd750e1
0282c82
%if 0%{?with_python3}
0282c82
%files -n python3-testtools
Jerry James 0f1a7fb
%doc NEWS README.rst
Jerry James 0f1a7fb
%license LICENSE
0282c82
%{python3_sitelib}/*
0282c82
%endif
0282c82
ae2856e
%files doc
ae2856e
%doc doc/_build/html/*
ae2856e
Michel Alexandre Salim cd750e1
Michel Alexandre Salim cd750e1
%changelog
fcbf817
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.3.0-9
fcbf817
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
fcbf817
dcfaddc
* Mon Jun 18 2018 Miro Hrončok <mhroncok@redhat.com> - 2.3.0-8
dcfaddc
- Rebuilt for Python 3.7
dcfaddc
39c6166
* Tue Jun 05 2018 Miro Hrončok <mhroncok@redhat.com> - 2.3.0-7
39c6166
- Backport upstream patch for Python 3.7 support (#1577621)
39c6166
- Use python2 explicitly
39c6166
557d2ac
* Fri Mar 09 2018 Iryna Shcherbina <ishcherb@redhat.com> - 2.3.0-6
557d2ac
- Update Python 2 dependency declarations to new packaging standards
557d2ac
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
557d2ac
532e946
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.3.0-5
532e946
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
532e946
6fb8eaa
* Fri Sep 29 2017 Troy Dawson <tdawson@redhat.com> - 2.3.0-4
6fb8eaa
- Cleanup spec file conditionals
6fb8eaa
e952ad5
* Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 2.3.0-3
e952ad5
- Python 2 binary package renamed to python2-testtools
e952ad5
  See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3
e952ad5
2a7467c
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.3.0-2
2a7467c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
2a7467c
d3872c6
* Wed Jun 14 2017 Haïkel Guémar <hguemar@fedoraproject.org> - 2.3.0-1
d3872c6
- Upstream 2.3.0
d3872c6
- Refresh spec
d3872c6
19aae7c
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.8.0-8
19aae7c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
19aae7c
c80ba23
* Fri Dec 09 2016 Charalampos Stratakis <cstratak@redhat.com> - 1.8.0-7
c80ba23
- Rebuild for Python 3.6
c80ba23
ed11b9b
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.8.0-6
ed11b9b
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
ed11b9b
b623fc2
* Fri Jun  3 2016 Michel Alexandre Salim <salimma@fedoraproject.org> - 1.8.0-5
b623fc2
- Add runtime dependency on traceback2 (bz#1251568)
b623fc2
- Bump required version of unittest2 (bz#1304326)
b623fc2
7ce0e65
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.8.0-4
7ce0e65
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
7ce0e65
3a53431
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.8.0-3
3a53431
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
3a53431
ced5a7f
* Tue Jul 28 2015 Michel Alexandre Salim <salimma@fedoraproject.org> - 1.8.0-2
ced5a7f
- Provide python2-testtools per updated guidelines
ced5a7f
2d23576
* Tue Jul 28 2015 Michel Alexandre Salim <salimma@fedoraproject.org> - 1.8.0-1
2d23576
- Update to 1.8.0
2d23576
ff01cf8
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.0-2
ff01cf8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
ff01cf8
755097f
* Thu Nov 27 2014 Michel Alexandre Salim <salimma@fedoraproject.org> - 1.5.0-1
755097f
- Update to 1.5.0
755097f
Jerry James 0f1a7fb
* Fri Sep 19 2014 Jerry James <loganjerry@gmail.com> - 1.1.0-1
Jerry James 0f1a7fb
- Update to 1.1.0 (bz 1132881)
Jerry James 0f1a7fb
- Fix license handling
Jerry James 0f1a7fb
- Note bundling exception for jquery in -doc
Jerry James 0f1a7fb
0fcad90
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.35-4
0fcad90
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
0fcad90
757a4da
* Wed May 14 2014 Bohuslav Kabrda <bkabrda@redhat.com> - 0.9.35-3
757a4da
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4
757a4da
815572e
* Fri Feb 28 2014 Matthias Runge <mrunge@redhat.com> - 0.9.35-2
815572e
- re-enable building the python3-subpackage
815572e
bbc8b71
* Mon Feb  3 2014 Michel Salim <salimma@fedoraproject.org> - 0.9.35-1
bbc8b71
- Update to 0.9.35
bbc8b71
ced7db8
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.32-3
ced7db8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
ced7db8
748cd6d
* Thu Jul  4 2013 Michel Salim <salimma@fedoraproject.org> - 0.9.32-2
748cd6d
- Add new runtime dep on -extras to Python3 variant as well
748cd6d
c37d78e
* Thu Jul  4 2013 Michel Salim <salimma@fedoraproject.org> - 0.9.32-1
c37d78e
- Update to 0.9.32
c37d78e
- Switch to using split-off extras package
c37d78e
b1d5f0c
* Sat May 18 2013 Pádraig Brady <pbrady@redhat.com> - 0.9.30-1
b1d5f0c
- Update to 0.9.30
b1d5f0c
50efbbf
* Thu Feb 07 2013 Pádraig Brady <pbrady@redhat.com> - 0.9.29-1
50efbbf
- Update to 0.9.29
50efbbf
73bf407
* Sat Oct 27 2012 Michel Alexandre Salim <michel@sojourner> - 0.9.21-1
73bf407
- Update to 0.9.21
73bf407
0282c82
* Sat Oct 20 2012 Michel Salim <salimma@fedoraproject.org> - 0.9.19-1
0282c82
- Update to 0.9.19
0282c82
- On Fedora, also build for Python 3.x
0282c82
470e9bd
* Wed Sep  5 2012 Michel Salim <salimma@fedoraproject.org> - 0.9.16-1
470e9bd
- Update to 0.9.16
470e9bd
- Remove deprecated sections
470e9bd
cf636f6
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.15-2
cf636f6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
cf636f6
2303662
* Fri May 11 2012 Michel Salim <salimma@fedoraproject.org> - 0.9.15-1
2303662
- Update to 0.9.15
2303662
0707c41
* Thu Apr  5 2012 Michel Salim <salimma@fedoraproject.org> - 0.9.14-1
0707c41
- Update to 0.9.14
0707c41
- Enable unit tests
0707c41
da38fcb
* Tue Feb  7 2012 Michel Salim <salimma@fedoraproject.org> - 0.9.13-1
da38fcb
- Update to 0.9.13
da38fcb
009fc17
* Tue Jan 31 2012 Michel Salim <salimma@fedoraproject.org> - 0.9.12-1
009fc17
- Update to 0.9.12
009fc17
36b8fb4
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.11-2
36b8fb4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
36b8fb4
ae2856e
* Fri Jul 15 2011 Michel Salim <salimma@fedoraproject.org> - 0.9.11-1
ae2856e
- Update to 0.9.11
ae2856e
- Enable documentation generation
ae2856e
Michel Alexandre Salim cd750e1
* Thu Apr  7 2011 Michel Salim <salimma@fedoraproject.org> - 0.9.8-2
Michel Alexandre Salim cd750e1
- Add definitions needed by older RPM versions
Michel Alexandre Salim cd750e1
Michel Alexandre Salim cd750e1
* Thu Apr  7 2011 Michel Salim <salimma@fedoraproject.org> - 0.9.8-1
Michel Alexandre Salim cd750e1
- Initial package