346076f
%global pypi_name stestr
346076f
%global with_doc 1
346076f
f91e861
# Note(hguemar): PyYAML provide is scheduled to be removed
86a4ca9
%{?el7: %global pyyaml_pkg PyYAML}
86a4ca9
%{!?el7: %global pyyaml_pkg python2-pyyaml}
86a4ca9
86a4ca9
%if 0%{?fedora} || 0%{?rhel} > 7
86a4ca9
%bcond_with    python2
86a4ca9
%bcond_without python3
86a4ca9
%else
86a4ca9
%bcond_without python2
86a4ca9
%bcond_with    python3
346076f
%endif
346076f
346076f
%global common_desc \
346076f
stestr is a fork of the testrepository that concentrates on being a \
346076f
dedicated test runner for python projects. The generic abstraction layers \
346076f
which enabled testr to work with any subunit emitting runner are gone. \
346076f
stestr hard codes python-subunit-isms into how it works.
346076f
346076f
Name:   python-%{pypi_name}
618d512
Version:    2.4.0
86a4ca9
Release:    1%{?dist}
346076f
Summary:    A test runner runner similar to testrepository
346076f
346076f
License:    ASL 2.0
346076f
URL:    https://pypi.python.org/pypi/stestr
346076f
Source0:    https://files.pythonhosted.org/packages/source/s/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
346076f
BuildArch:  noarch
346076f
f5efbf3
BuildRequires:    git
f5efbf3
346076f
%description
346076f
%{common_desc}
346076f
86a4ca9
%if %{with python2}
86a4ca9
%package -n    python2-%{pypi_name}
86a4ca9
Summary:    A test runner runner similar to testrepository
86a4ca9
%{?python_provide:%python_provide python2-%{pypi_name}}
86a4ca9
86a4ca9
BuildRequires:    python2-devel
86a4ca9
BuildRequires:    python2-setuptools
86a4ca9
BuildRequires:    python2-pbr
86a4ca9
86a4ca9
# Test Requirements
86a4ca9
BuildRequires:   python2-mock
86a4ca9
BuildRequires:   python2-future
86a4ca9
BuildRequires:   python2-subunit
86a4ca9
BuildRequires:   python2-fixtures
86a4ca9
BuildRequires:   python2-six
86a4ca9
BuildRequires:   python2-testtools
86a4ca9
BuildRequires:   %{pyyaml_pkg}
86a4ca9
BuildRequires:   python2-ddt
86a4ca9
BuildRequires:   python2-cliff
86a4ca9
BuildRequires:   python2-voluptuous
86a4ca9
86a4ca9
Requires:   python2-pbr
86a4ca9
Requires:   python2-future
86a4ca9
Requires:   python2-subunit
86a4ca9
Requires:   python2-fixtures
86a4ca9
Requires:   python2-six
86a4ca9
Requires:   python2-testtools
86a4ca9
Requires:   %{pyyaml_pkg}
86a4ca9
Requires:   python2-cliff
86a4ca9
Requires:   python2-voluptuous
86a4ca9
86a4ca9
%description -n python2-%{pypi_name}
86a4ca9
%{common_desc}
86a4ca9
86a4ca9
%package -n     python2-%{pypi_name}-sql
86a4ca9
Summary:    sql plugin for stestr
86a4ca9
86a4ca9
Requires:       python2-%{pypi_name} = %{version}-%{release}
86a4ca9
Requires:       python2-subunit2sql
86a4ca9
86a4ca9
%description    -n python2-%{pypi_name}-sql
86a4ca9
It contains the sql plugin for stestr.
86a4ca9
%endif
86a4ca9
86a4ca9
%if %{with python3}
346076f
%package -n     python3-%{pypi_name}
346076f
Summary:        A test runner runner similar to testrepository
86a4ca9
Obsoletes:      python2-%{pypi_name} < %{version}-%{release}
346076f
%{?python_provide:%python_provide python3-%{pypi_name}}
346076f
346076f
BuildRequires:    python3-devel
346076f
BuildRequires:    python3-setuptools
346076f
BuildRequires:    python3-pbr
346076f
346076f
# Test Requirements
aa0133b
BuildRequires:   python3-mock
aa0133b
BuildRequires:   python3-future
aa0133b
BuildRequires:   python3-subunit
b932fba
BuildRequires:   /usr/bin/subunit2sql-db-manage
aa0133b
BuildRequires:   python3-fixtures
aa0133b
BuildRequires:   python3-six
07f6f96
BuildRequires:   python3-sqlalchemy
b932fba
BuildRequires:   python3-subunit2sql
aa0133b
BuildRequires:   python3-testtools
aa0133b
BuildRequires:   python3-PyYAML
1dbc2a5
BuildRequires:   python3-ddt
0f98998
BuildRequires:   python3-cliff
0f98998
BuildRequires:   python3-voluptuous
346076f
346076f
Requires:   python3-pbr
346076f
Requires:   python3-future
346076f
Requires:   python3-subunit
346076f
Requires:   python3-fixtures
346076f
Requires:   python3-six
346076f
Requires:   python3-testtools
346076f
Requires:   python3-PyYAML
0f98998
Requires:   python3-cliff
0f98998
Requires:   python3-voluptuous
346076f
346076f
%description -n python3-%{pypi_name}
346076f
%{common_desc}
4b33206
4b33206
%package -n     python3-%{pypi_name}-sql
4b33206
Summary:    sql plugin for stestr
4b33206
4b33206
Requires:       python3-%{pypi_name} = %{version}-%{release}
aa0133b
Requires:       python3-subunit2sql
4b33206
4b33206
%description    -n python3-%{pypi_name}-sql
4b33206
It contains the sql plugin for stestr.
86a4ca9
%endif
346076f
346076f
%if 0%{?with_doc}
346076f
%package -n python-%{pypi_name}-doc
346076f
Summary:        stestr documentation
346076f
86a4ca9
%if %{with python2}
86a4ca9
BuildRequires:  python2-sphinx
86a4ca9
BuildRequires:  python2-subunit2sql
86a4ca9
%endif
86a4ca9
%if %{with python3}
b932fba
BuildRequires:  python3-sphinx
86a4ca9
BuildRequires:  python3-subunit2sql
86a4ca9
%endif
346076f
346076f
%description -n python-%{pypi_name}-doc
346076f
%{common_desc}
346076f
346076f
It contains the documentation for stestr.
346076f
%endif
346076f
346076f
%prep
f5efbf3
%autosetup -n %{pypi_name}-%{version} -S git
346076f
# Remove bundled egg-info
346076f
rm -rf %{pypi_name}.egg-info
346076f
rm -f test-requirements.txt requirements.txt
346076f
4b67b36
# Remove pbr>=2.0.0 version as it is required for pike
4b67b36
sed -i 's/pbr>=2.0.0/pbr/g' setup.py
4b67b36
346076f
%build
86a4ca9
%if %{with python2}
86a4ca9
%py2_build
86a4ca9
%endif
346076f
86a4ca9
%if %{with python3}
346076f
%py3_build
86a4ca9
%endif
346076f
346076f
%if 0%{?with_doc}
346076f
# generate html docs
86a4ca9
%if %{with python2}
86a4ca9
%{__python2} setup.py build_sphinx
86a4ca9
%endif
86a4ca9
%if %{with python3}
b932fba
%{__python3} setup.py build_sphinx
86a4ca9
%endif
346076f
# remove the sphinx-build leftovers
346076f
rm -rf html/.{doctrees,buildinfo}
346076f
%endif
346076f
346076f
%install
86a4ca9
%if %{with python3}
346076f
%py3_install
b932fba
# compat symlinks
b932fba
ln -s stestr %{buildroot}/%{_bindir}/stestr-3
b932fba
ln -s stestr-3 %{buildroot}/%{_bindir}/stestr-%{python3_version}
86a4ca9
%endif
86a4ca9
86a4ca9
%if %{with python2}
86a4ca9
%py2_install
86a4ca9
cp %{buildroot}/%{_bindir}/stestr %{buildroot}/%{_bindir}/stestr-2
86a4ca9
ln -sf %{_bindir}/stestr-2 %{buildroot}/%{_bindir}/stestr-%{python2_version}
86a4ca9
%endif
86a4ca9
346076f
346076f
%check
07f6f96
export PATH=%{buildroot}/%{_bindir}:$PATH
86a4ca9
%if %{with python2}
86a4ca9
# currently, 3 test are failing
86a4ca9
%{__python2} setup.py test || :
86a4ca9
%endif
86a4ca9
%if %{with python3}
1dbc2a5
rm -fr .stestr
86a4ca9
# currently, 4 test are failing
86a4ca9
PYTHON=%{__python3} %{__python3} setup.py test || :
86a4ca9
%endif
346076f
86a4ca9
%if %{with python2}
86a4ca9
%files -n python2-%{pypi_name}
86a4ca9
%license LICENSE
86a4ca9
%doc README.rst
86a4ca9
%{_bindir}/stestr*
86a4ca9
%{python2_sitelib}/%{pypi_name}
618d512
%{python2_sitelib}/%{pypi_name}-*.egg-info
86a4ca9
86a4ca9
%files -n python2-%{pypi_name}-sql
86a4ca9
%{python2_sitelib}/%{pypi_name}/repository/sql.py
86a4ca9
%endif
86a4ca9
86a4ca9
%if %{with python3}
346076f
%files -n python3-%{pypi_name}
346076f
%license LICENSE
346076f
%doc README.rst
b932fba
%{_bindir}/stestr*
346076f
%{python3_sitelib}/%{pypi_name}
618d512
%{python3_sitelib}/%{pypi_name}-*.egg-info
4b33206
4b33206
%files -n python3-%{pypi_name}-sql
4b33206
%{python3_sitelib}/%{pypi_name}/repository/sql.py
86a4ca9
%endif
346076f
346076f
%if 0%{?with_doc}
346076f
%files -n python-%{pypi_name}-doc
346076f
%license LICENSE
346076f
%doc doc/build/html
346076f
%endif
346076f
346076f
%changelog
618d512
* Tue Jul 23 2019 Chandan Kumar <chkumar246@gmail.com> - 2.4.0-1
618d512
- Update to 2.4.0
618d512
- Removed patch "Discover python executable when discover is not used"
618d512
f5efbf3
* Fri Jun 07 2019 Alfredo Moralejo <amoralej@redhat.com> - 2.3.1-1
f5efbf3
- Update to 2.3.1
f5efbf3
- Included patch "Discover python executable when discover is not used"
f5efbf3
86a4ca9
* Thu Feb 14 2019 Yatin Karel <ykarel@redhat.com> - 2.2.0-1
86a4ca9
- Update to 2.2.0 and Enable py2 build for CentOS <= 7
86a4ca9
cf8d245
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.0-3
cf8d245
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
cf8d245
b932fba
* Fri Oct 12 2018 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 2.1.0-2
b932fba
- Python2 binary package has been removed
b932fba
  See https://fedoraproject.org/wiki/Changes/Mass_Python_2_Package_Removal
b932fba
0f98998
* Mon Jul 30 2018 Chandan Kumar <chkumar246@gmail.com> - 2.1.0-1
0f98998
- Bump to version 2.1.0
0f98998
- Synced requirements for newer version
0f98998
- Closes-Bug RHBZ#1480520
0f98998
969f7ac
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.0-5
969f7ac
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
969f7ac
3a87ce1
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 1.1.0-4
3a87ce1
- Rebuilt for Python 3.7
3a87ce1
39ed14a
* Mon Mar 26 2018 Iryna Shcherbina <ishcherb@redhat.com> - 1.1.0-3
39ed14a
- Update Python 2 dependency declarations to new packaging standards
39ed14a
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
39ed14a
c266392
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.0-2
c266392
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
c266392
1dbc2a5
* Tue Oct 17 2017 Chandan Kumar <chkumar246@gmail.com> - 1.1.0-1
1dbc2a5
- Update the spec to 1.1.0
1dbc2a5
- Enable tests
1dbc2a5
- Moved python2-subunit2sql under docs
1dbc2a5
15a02ef
* Fri Sep 15 2017 Chandan Kumar <chkumar246@gmail.com> - 1.0.0-4
15a02ef
- Disable tests
15a02ef
aa0133b
* Fri Sep 15 2017 Chandan Kumar <chkumar246@gmail.com> - 1.0.0-3
aa0133b
- Fixed test requirements and enabled subunit2sql
aa0133b
3f12b8f
* Fri Sep 15 2017 Chandan Kumar <chkumar246@gmail.com> - 1.0.0-2
3f12b8f
- Disable subunit2sql
3f12b8f
3172683
* Fri Sep 15 2017 Chandan Kumar <chkumar246@gmail.com> - 1.0.0-1
3172683
- Bumped to 1.0.0
3172683
8bd98ef
* Thu Aug 10 2017 Chandan Kumar <chkumar246@gmail.com> - 0.5.0-4
4b33206
- Added -sql subpackage
4b33206
4b67b36
* Tue Aug 01 2017 Chandan Kumar <chkumar246@gmail.com> - 0.5.0-3
4b67b36
- Use sed to remove pbr>=2.0.0 dependency
4b67b36
346076f
* Tue Aug 01 2017 Chandan Kumar <chkumar246@gmail.com> - 0.5.0-2
346076f
- Fixed rpmlint errors
346076f
346076f
* Mon Jul 31 2017 Chandan Kumar <chkumar246@gmail.com> - 0.5.0-1
346076f
- Initial package.