%if 0%{?fedora} || 0%{?epel}
%global with_python3 1
%endif
%global pypi_name daiquiri
# Tests require python-json-logger package
# https://bugzilla.redhat.com/show_bug.cgi?id=1460757
Name: python-%{pypi_name}
Version: 1.2.1
Release: 2%{?dist}
Summary: Library to configure Python logging easily
License: ASL 2.0
URL: https://github.com/jd/daiquiri
Source0: https://files.pythonhosted.org/packages/source/d/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
BuildArch: noarch
%description
The %{pypi_name} library provides an easy way to configure Python logging.
It also provides some custom formatters and handlers.
%package -n python2-%{pypi_name}
Summary: Library to configure Python logging easily
BuildRequires: python2-devel
BuildRequires: python2-pbr
BuildRequires: python2-setuptools
BuildRequires: python2-testrepository
BuildRequires: python2-testtools
BuildRequires: python2-six >= 1.9.0
BuildRequires: python2-json-logger
Requires: python2-json-logger
%{?python_provide:%python_provide python2-%{pypi_name}}
%description -n python2-%{pypi_name}
The %{pypi_name} library provides an easy way to configure Python logging.
It also provides some custom formatters and handlers.
%if 0%{?with_python3}
%package -n python3-%{pypi_name}
Summary: Library to configure Python logging easily
BuildRequires: python3-devel
BuildRequires: python3-pbr
BuildRequires: python3-setuptools
BuildRequires: python3-testrepository
BuildRequires: python3-testtools
BuildRequires: python3-six >= 1.9.0
BuildRequires: python3-json-logger
Requires: python3-json-logger
%{?python_provide:%python_provide python3-%{pypi_name}}
%description -n python3-%{pypi_name}
The %{pypi_name} library provides an easy way to configure Python logging.
It also provides some custom formatters and handlers.
%endif
%package -n python-%{pypi_name}-doc
Summary: daiquiri documentation
BuildRequires: python2-sphinx
%description -n python-%{pypi_name}-doc
Documentation for daiquiri
%prep
%autosetup -n %{pypi_name}-%{version}
# Remove bundled egg-info
rm -rf %{pypi_name}.egg-info
%build
%py2_build
%if 0%{?with_python3}
%py3_build
%endif
# generate html docs
sphinx-build doc/source html
# remove the sphinx-build leftovers
rm -rf html/.{doctrees,buildinfo}
%install
%if 0%{?with_python3}
%py3_install
%endif
%py2_install
%check
%if 0%{?with_python3}
%{__python3} setup.py test
%endif
%{__python2} setup.py test
%files -n python2-%{pypi_name}
%license LICENSE
%doc README.rst
%{python2_sitelib}/%{pypi_name}
%{python2_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info
%if 0%{?with_python3}
%files -n python3-%{pypi_name}
%license LICENSE
%doc README.rst
%{python3_sitelib}/%{pypi_name}
%{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info
%endif
%files -n python-%{pypi_name}-doc
%doc html
%changelog
* Thu Jan 25 2018 Iryna Shcherbina <ishcherb@redhat.com> - 1.2.1-2
- Update Python 2 dependency declarations to new packaging standards
(See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
* Wed Jul 26 2017 Pradeep Kilambi <pkilambi@redhat.com> - 1.2.1-1
- Rebase to 1.2.1
* Mon Jun 12 2017 Haïkel Guémar <hguemar@fedoraproject.org> - 0.1.0-1
- Upstream 0.1.0
* Thu May 25 2017 Haïkel Guémar <hguemar@fedoraproject.org> - 0.0.1-1
- Initial package.