Blob Blame History Raw
%global srcname junit-xml
%global modname %(echo '%{srcname}' | tr - _)

Name:           python-%{modname}
Version:        1.7
Release:        3%{?dist}
Summary:        Python module for creating JUnit XML test result documents

License:        MIT
URL:            https://github.com/kyrus/python-%{srcname}/
Source0:        %{pypi_source}

BuildArch:      noarch

%global common_description %{expand:
A Python module for creating JUnit XML test result documents that can be read
by tools such as Jenkins or Bamboo. If you are ever working with test tool or
test suite written in Python and want to take advantage of Jenkins' or Bamboo's
pretty graphs and test reporting capabilities, this module will let you
generate the XML test reports.}

%description %{common_description}


%package -n python2-%{modname}
Summary:        %{summary}
%{?python_provide:%python_provide python2-%{modname}}

BuildRequires:  python2-devel
BuildRequires:  python2-setuptools
BuildRequires:  python2-six
BuildRequires:  python2-pytest

Requires:       python2-six

%description -n python2-%{modname} %{common_description}


%package -n python%{python3_pkgversion}-%{modname}
Summary:        %{summary}
%{?python_provide:%python_provide python%{python3_pkgversion}-%{modname}}

BuildRequires:  python%{python3_pkgversion}-devel
BuildRequires:  python%{python3_pkgversion}-setuptools
BuildRequires:  python%{python3_pkgversion}-six
BuildRequires:  python%{python3_pkgversion}-pytest

Requires:       python%{python3_pkgversion}-six

%description -n python%{python3_pkgversion}-%{modname} %{common_description}


%prep
%autosetup -n %{srcname}-%{version}

%build
%py2_build
%py3_build

%install
%py2_install
%py3_install

%check
mkdir results
%{python2} -m pytest --junitxml=./results/junit-py2.xml
%{python3} -m pytest --junitxml=./results/junit-py3.xml


%files -n python2-%{modname}
%license LICENSE.txt
%doc README.rst
%{python2_sitelib}/%{modname}
%{python2_sitelib}/%{modname}-%{version}-py%{python2_version}.egg-info


%files -n python%{python3_pkgversion}-%{modname}
%license LICENSE.txt
%doc README.rst
%{python3_sitelib}/%{modname}
%{python3_sitelib}/%{modname}-%{version}-py%{python3_version}.egg-info


%changelog
* Thu Jan 14 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 1.7-3
- Fix a leftover conditional macro
- Do not use banned %%{python3_sitelib}/* or %%{python2_sitelib}/*

* Thu Jan 14 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 1.7-2
- Drop EL6 support
- Drop unnecessary macros
- Do not conditionalize Python 3 build
- Update summary and description from upstream
- Use %%python3_pkgversion where appropriate
- Add missing BR on setuptools
- Add missing runtime requirement for python*-six

* Wed Feb 15 2017 James Hogarth <james.hogarth@gmail.com> - 1.7-1
- Initial package