346076f
%global pypi_name stestr
346076f
%global with_doc 1
346076f
346076f
%if 0%{?fedora}
346076f
%global with_python3 0
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}
3172683
Version:    1.0.0
3172683
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
346076f
%description
346076f
%{common_desc}
346076f
346076f
%package -n    python2-%{pypi_name}
346076f
Summary:    A test runner runner similar to testrepository
346076f
%{?python_provide:%python_provide python2-%{pypi_name}}
346076f
346076f
BuildRequires:    python2-devel
346076f
BuildRequires:    python-setuptools
4b33206
BuildRequires:    python2-pbr
346076f
346076f
# Test Requirements
4b33206
BuildRequires:   python2-mock
3172683
BuildRequires:   python2-subunit2sql
4b33206
4b33206
Requires:   python2-pbr
4b33206
Requires:   python2-future
4b33206
Requires:   python2-subunit
4b33206
Requires:   python2-fixtures
4b33206
Requires:   python2-six
4b33206
Requires:   python2-testtools
4b33206
Requires:   python2-PyYAML
346076f
346076f
%description -n python2-%{pypi_name}
346076f
%{common_desc}
346076f
4b33206
%package -n     python2-%{pypi_name}-sql
4b33206
Summary:    sql plugin for stestr
4b33206
4b33206
Requires:       python2-%{pypi_name} = %{version}-%{release}
3172683
Requires:       python2-subunit2sql
4b33206
4b33206
%description    -n python2-%{pypi_name}-sql
4b33206
It contains the sql plugin for stestr.
4b33206
346076f
%if %{with python3}
346076f
%package -n     python3-%{pypi_name}
346076f
Summary:        A test runner runner similar to testrepository
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
346076f
BuildRequires:    python3-mock
346076f
# BuildRequires:  python3-subunit2sql
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
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}
4b33206
# Requires:       python3-subunit2sql
4b33206
4b33206
%description    -n python3-%{pypi_name}-sql
4b33206
It contains the sql plugin for stestr.
346076f
%endif
346076f
346076f
%if 0%{?with_doc}
346076f
%package -n python-%{pypi_name}-doc
346076f
Summary:        stestr documentation
346076f
346076f
BuildRequires:  python-sphinx
346076f
346076f
%description -n python-%{pypi_name}-doc
346076f
%{common_desc}
346076f
346076f
It contains the documentation for stestr.
346076f
%endif
346076f
346076f
%prep
346076f
%autosetup -n %{pypi_name}-%{version}
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
346076f
%py2_build
346076f
346076f
%if %{with python3}
346076f
%py3_build
346076f
%endif
346076f
346076f
%if 0%{?with_doc}
346076f
# generate html docs
346076f
%{__python2} setup.py build_sphinx
346076f
# remove the sphinx-build leftovers
346076f
rm -rf html/.{doctrees,buildinfo}
346076f
%endif
346076f
346076f
%install
346076f
%if %{with python3}
346076f
%py3_install
346076f
cp %{buildroot}/%{_bindir}/stestr %{buildroot}/%{_bindir}/stestr-3
346076f
ln -sf %{_bindir}/stestr-3 %{buildroot}/%{_bindir}/stestr-%{python3_version}
346076f
%endif
346076f
346076f
%py2_install
346076f
cp %{buildroot}/%{_bindir}/stestr %{buildroot}/%{_bindir}/stestr-2
346076f
ln -sf %{_bindir}/stestr-2 %{buildroot}/%{_bindir}/stestr-%{python2_version}
346076f
346076f
346076f
%check
346076f
# Skipping tests as python-subunit2sql is not available
346076f
%{__python2} setup.py test ||
346076f
346076f
%if %{with python3}
346076f
%{__python3} setup.py test ||
346076f
%endif
346076f
346076f
%files -n python2-%{pypi_name}
346076f
%license LICENSE
346076f
%doc README.rst
346076f
%{_bindir}/stestr
346076f
%{_bindir}/stestr-2
346076f
%{_bindir}/stestr-%{python2_version}
346076f
%{python2_sitelib}/%{pypi_name}
4b33206
%exclude %{python2_sitelib}/%{pypi_name}/repository/sql.py
346076f
%{python2_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info
346076f
4b33206
%files -n python2-%{pypi_name}-sql
4b33206
%{python2_sitelib}/%{pypi_name}/repository/sql.py
4b33206
346076f
%if %{with python3}
346076f
%files -n python3-%{pypi_name}
346076f
%license LICENSE
346076f
%doc README.rst
346076f
%{_bindir}/stestr-3
346076f
%{_bindir}/stestr-%{python3_version}
346076f
%{python3_sitelib}/%{pypi_name}
4b33206
%exclude %{python3_sitelib}/%{pypi_name}/repository/sql.py
346076f
%{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info
4b33206
4b33206
%files -n python3-%{pypi_name}-sql
4b33206
%{python3_sitelib}/%{pypi_name}/repository/sql.py
346076f
%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
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.