33f97df
%global srcname etcd3gw
33f97df
44a7923
%if 0%{?fedora} && 0%{?fedora} < 30
44a7923
%bcond_without python2
44a7923
%bcond_without python3
44a7923
%else
Alan Pevec a5885ec
%if 0%{?fedora} || 0%{?rhel} > 7
Alan Pevec a5885ec
%bcond_with    python2
Alan Pevec a5885ec
%bcond_without python3
Alan Pevec a5885ec
%else
Alan Pevec a5885ec
%bcond_without python2
Alan Pevec a5885ec
%bcond_with    python3
Alan Pevec a5885ec
%endif
44a7923
%endif
Alan Pevec a5885ec
33f97df
Name:           python-%{srcname}
33f97df
Version:        0.2.4
44a7923
Release:        7%{?dist}
33f97df
Summary:        An etcd3 gateway Python client
33f97df
33f97df
License:        ASL 2.0
33f97df
URL:            https://pypi.python.org/pypi/%{srcname}
33f97df
Source0:        %{pypi_source}
33f97df
33f97df
BuildArch:      noarch
33f97df
33f97df
%description
33f97df
A python client for etcd3 grpc-gateway v3alpha API
33f97df
Alan Pevec a5885ec
%if %{with python2}
Alan Pevec a5885ec
%package -n python2-%{srcname}
Alan Pevec a5885ec
Summary:        %{summary}
Alan Pevec a5885ec
BuildRequires:  python2-devel
Alan Pevec a5885ec
Alan Pevec a5885ec
BuildRequires:  python2-futurist
Alan Pevec a5885ec
BuildRequires:  python2-oslotest
Alan Pevec a5885ec
BuildRequires:  python2-requests
Alan Pevec a5885ec
Alan Pevec a5885ec
Requires:  python2-futurist
Alan Pevec a5885ec
Requires:  python2-pbr
Alan Pevec a5885ec
Requires:  python2-requests
Alan Pevec a5885ec
Requires:  python2-six
Alan Pevec a5885ec
Alan Pevec a5885ec
%{?python_provide:%python_provide python2-%{srcname}}
Alan Pevec a5885ec
Alan Pevec a5885ec
%description -n python2-%{srcname}
Alan Pevec a5885ec
A python client for etcd3 grpc-gateway v3alpha API
Alan Pevec a5885ec
%endif
Alan Pevec a5885ec
Alan Pevec a5885ec
%if %{with python3}
33f97df
%package -n python3-%{srcname}
33f97df
Summary:        %{summary}
33f97df
BuildRequires:  python3-devel
33f97df
33f97df
BuildRequires:  python3-futurist
33f97df
BuildRequires:  python3-oslotest
33f97df
BuildRequires:  python3-requests
33f97df
fba4361
Requires: python3-futurist
4d5bded
Requires: python3-pbr
fba4361
Requires: python3-requests
fba4361
Requires: python3-six
fba4361
33f97df
%{?python_enable_dependency_generator}
33f97df
33f97df
%{?python_provide:%python_provide python3-%{srcname}}
33f97df
33f97df
%description -n python3-%{srcname}
33f97df
A python client for etcd3 grpc-gateway v3alpha API
Alan Pevec a5885ec
%endif
33f97df
33f97df
%prep
33f97df
%autosetup -n %{srcname}-%{version}
33f97df
d585b46
# Let's manage dependencies using rpm deps.
d585b46
rm -f *requirements.txt
d585b46
33f97df
%build
Alan Pevec a5885ec
%if %{with python2}
Alan Pevec a5885ec
%py2_build
Alan Pevec a5885ec
%endif
Alan Pevec a5885ec
Alan Pevec a5885ec
%if %{with python3}
33f97df
%py3_build
Alan Pevec a5885ec
%endif
33f97df
33f97df
%install
Alan Pevec a5885ec
%if %{with python2}
Alan Pevec a5885ec
%py2_install
Alan Pevec a5885ec
%endif
Alan Pevec a5885ec
Alan Pevec a5885ec
%if %{with python3}
33f97df
%py3_install
Alan Pevec a5885ec
%endif
33f97df
33f97df
%check
Alan Pevec a5885ec
%if %{with python2}
Alan Pevec a5885ec
export PYTHON=%{__python2}
Alan Pevec a5885ec
%{__python2} setup.py test
Alan Pevec a5885ec
%endif
Alan Pevec a5885ec
Alan Pevec a5885ec
%if %{with python3}
33f97df
export PYTHON=%{__python3}
44a7923
# workaround for https://bugs.launchpad.net/testrepository/+bug/1229445
44a7923
rm -rf .testrepository/times.dbm
33f97df
%{__python3} setup.py test
Alan Pevec a5885ec
%endif
Alan Pevec a5885ec
Alan Pevec a5885ec
%if %{with python2}
Alan Pevec a5885ec
%files -n python2-%{srcname}
Alan Pevec a5885ec
%license LICENSE
Alan Pevec a5885ec
%doc README.md CONTRIBUTING.rst HACKING.rst
Alan Pevec a5885ec
%{python2_sitelib}/%{srcname}-*.egg-info/
Alan Pevec a5885ec
%{python2_sitelib}/%{srcname}/
Alan Pevec a5885ec
%endif
33f97df
Alan Pevec a5885ec
%if %{with python3}
33f97df
%files -n python3-%{srcname}
33f97df
%license LICENSE
33f97df
%doc README.md CONTRIBUTING.rst HACKING.rst
33f97df
%{python3_sitelib}/%{srcname}-*.egg-info/
33f97df
%{python3_sitelib}/%{srcname}/
Alan Pevec a5885ec
%endif
33f97df
33f97df
33f97df
%changelog
44a7923
* Fri Mar  8 2019 John Eckersberg <eck@redhat.com> - 0.2.4-7
44a7923
- Before f30, build for both py2 and py3
44a7923
- Add test workaround when run for both py2 and py3
44a7923
4d5bded
* Tue Mar  5 2019 John Eckersberg <eck@redhat.com> - 0.2.4-6
4d5bded
- Add missing req for python3-pbr
4d5bded
fba4361
* Tue Mar 05 2019 Eric Harney <eharney@redhat.com> - 0.2.4-5
fba4361
- Add missing reqs for python3
fba4361
0266371
* Mon Mar 04 2019 Eric Harney <eharney@redhat.com> - 0.2.4-4
0266371
- Remove runtime req on oslotest
0266371
d585b46
* Thu Feb 28 2019 Alfredo Moralejo <amoralej@redhat.com> - 0.2.4-3
d585b46
- Remve {test-,}requirements.txt to manage dependencies manually.
d585b46
33f97df
* Wed Feb 13 2019 John Eckersberg <eck@redhat.com> - 0.2.4-1
33f97df
- Initial package
33f97df