d56b13
%{?python_enable_dependency_generator}
d56b13
d56b13
%if 0%{?rhel} == 7
d56b13
%bcond_with    python3
d56b13
%bcond_without python2
d56b13
%else
d56b13
%bcond_with    python2
d56b13
%bcond_without python3
d56b13
%endif
d56b13
d56b13
%if 0%{?rhel} == 7
d56b13
%global py3 python%{python3_pkgversion}
d56b13
%global py3dev python%{python3_pkgversion}
d56b13
Patch0:     python-kubernetes-el7.patch
d56b13
%endif
d56b13
%if 0%{?rhel} == 8
d56b13
%global py3 python3
d56b13
%global py3dev python36
d56b13
%endif
d56b13
%if 0%{?fedora} || 0%{?rhel} > 8
d56b13
%global py3 python3
d56b13
%global py3dev python3
d56b13
%endif
d56b13
d56b13
%global library kubernetes
d56b13
%global basehash d30f1e6fd4e2725aae04fa2f4982a4cfec7c682b
d56b13
d56b13
Name:       python-%{library}
d56b13
Epoch:      1
d56b13
Version:    11.0.0
d56b13
Release:    7%{?dist}
d56b13
Summary:    Python client for the kubernetes API.
d56b13
License:    ASL 2.0
d56b13
URL:        https://pypi.python.org/pypi/kubernetes
d56b13
d56b13
Source0:    https://github.com/kubernetes-client/python/archive/v%{version}.tar.gz
d56b13
Source1:    https://github.com/kubernetes-client/python-base/archive/%{basehash}.tar.gz
d56b13
BuildArch:  noarch
d56b13
d56b13
%if 0%{?with_python2}
d56b13
%package -n python2-%{library}
d56b13
Summary:    Kubernetes Python Client
d56b13
%{?python_provide:%python_provide python2-%{library}}
d56b13
BuildRequires:  git
d56b13
BuildRequires:  python2-devel
d56b13
BuildRequires:  python-setuptools
d56b13
%if 0%{?rhel} != 7
d56b13
Requires:  python-adal
d56b13
%endif
d56b13
Requires:  python-certifi
d56b13
Requires:  python-six
d56b13
Requires:  python-dateutil
d56b13
Requires:  python-setuptools
d56b13
Requires:  python-urllib3
d56b13
Requires:  PyYAML
d56b13
Requires:  python-google-auth
d56b13
Requires:  python-ipaddress
d56b13
Requires:  python-websocket-client
d56b13
Requires:  python-requests
d56b13
Requires:  python-requests-oauthlib
d56b13
d56b13
%description -n python2-%{library}
d56b13
Python client for the kubernetes API.
d56b13
d56b13
%package -n python2-%{library}-tests
d56b13
Summary:    Tests python-kubernetes library
d56b13
d56b13
Requires:  python-nose
d56b13
Requires:  python-py
d56b13
Requires:  python-mock
d56b13
Requires:  python2-%{library} = 1:%{version}-%{release}
d56b13
d56b13
%description -n python2-%{library}-tests
d56b13
Tests python-kubernetes library
d56b13
%endif
d56b13
d56b13
%if 0%{?with_python3}
d56b13
%package -n %{py3}-%{library}
d56b13
Summary:    Kubernetes Python Client
d56b13
BuildRequires:  git
d56b13
BuildRequires:  %{py3dev}-devel
d56b13
BuildRequires:  %{py3dev}-rpm-macros
d56b13
BuildRequires:  %{py3}-setuptools 
d56b13
%if %{undefined __pythondist_requires}
d56b13
%if 0%{?fedora}
d56b13
Requires:  %{py3}-adal
d56b13
%endif
d56b13
Requires:  %{py3}-certifi
d56b13
Requires:  %{py3}-six
d56b13
Requires:  %{py3}-dateutil
d56b13
Requires:  %{py3}-setuptools 
d56b13
Requires:  %{py3}-urllib3
d56b13
Requires:  %{py3}-PyYAML
d56b13
Requires:  %{py3}-google-auth
d56b13
Requires:  %{py3}-websocket-client
d56b13
%endif
d56b13
d56b13
%description -n %{py3}-%{library}
d56b13
Python client for the kubernetes API.
d56b13
d56b13
%package -n %{py3}-%{library}-tests
d56b13
Summary:    Tests python-kubernetes library
d56b13
d56b13
Requires:  %{py3}-nose
d56b13
Requires:  %{py3}-py
d56b13
Requires:  %{py3}-mock
d56b13
Requires:  %{py3}-%{library} = 1:%{version}-%{release}
d56b13
d56b13
%description -n %{py3}-%{library}-tests
d56b13
Tests python-kubernetes library
d56b13
d56b13
%endif
d56b13
d56b13
#recommonmark not available for docs in EPEL
d56b13
%if 0%{?fedora}
d56b13
%package doc
d56b13
Summary: Documentation for %{name}.
d56b13
Provides: %{name}-doc = 1:%{version}-%{release}
d56b13
%if 0%{?with_python3}
d56b13
BuildRequires: %{py3}-sphinx
d56b13
BuildRequires: %{py3}-recommonmark
d56b13
%else
d56b13
BuildRequires: python2-sphinx
d56b13
BuildRequires: python2-recommonmark
d56b13
%endif
d56b13
%description doc
d56b13
%{summary}
d56b13
%endif
d56b13
d56b13
%description
d56b13
Python client for the kubernetes API.
d56b13
d56b13
%prep
d56b13
%autosetup -n python-%{version} -S git
d56b13
d56b13
#This is needed until CentOS 8.1. The dep was
d56b13
#updated because of a CVE in urllib3 and the
d56b13
#corresponding package update is in EL 8.1
d56b13
%if 0%{?rhel} == 8
d56b13
sed -i 's/1.24.2/1.23/g' requirements.txt
d56b13
%endif
d56b13
d56b13
#BZ1758141 - python autorequires do not handles asterisks properly.
d56b13
#Fedora is using 0.56.0+ since at least Fedora 31 so this works aorund
d56b13
#the issue by setting the minimum version above the problem versions.
d56b13
%if 0%{?fedora} > 30
d56b13
sed -i 's/websocket-client.*/websocket-client>=0.43.0/g' requirements.txt
d56b13
%endif
d56b13
d56b13
pushd kubernetes
d56b13
rm -rf base
d56b13
tar zxvf %{SOURCE1}
d56b13
mv python-base-%{basehash} base
d56b13
popd
d56b13
d56b13
%build
d56b13
%if 0%{?with_python2}
d56b13
%py2_build
d56b13
%endif
d56b13
%if 0%{?with_python3}
d56b13
%py3_build
d56b13
%endif
d56b13
d56b13
#11.0 adds spinx-markdown-tables as a requirement
d56b13
#It is not packaged in Fedora
d56b13
#%if 0%{?fedora}
d56b13
#sphinx-build doc/source/ html
d56b13
#%{__rm} -rf html/.buildinfo
d56b13
#%endif
d56b13
d56b13
# Currently recommonmark requires an old version of commonmark,
d56b13
# commonmark (<=0.5.4) wich doesn't exist in fedora rawhide so
d56b13
# we disable docs generation until recommonmark is fixed to be
d56b13
# compatible with recent version.
d56b13
# generate html docs
d56b13
# {__python2} setup.py build_sphinx
d56b13
# remove the sphinx-build leftovers
d56b13
#rm -rf html/.{doctrees,buildinfo}
d56b13
d56b13
%install
d56b13
%if 0%{?with_python2}
d56b13
%py2_install
d56b13
cp -pr kubernetes/test %{buildroot}%{python2_sitelib}/%{library}/
d56b13
cp -pr kubernetes/e2e_test %{buildroot}%{python2_sitelib}/%{library}/
d56b13
%endif
d56b13
%if 0%{?with_python3}
d56b13
%py3_install
d56b13
cp -pr kubernetes/test %{buildroot}%{python3_sitelib}/%{library}/
d56b13
cp -pr kubernetes/e2e_test %{buildroot}%{python3_sitelib}/%{library}/
d56b13
%endif
d56b13
d56b13
%check
d56b13
d56b13
%if 0%{?with_python2}
d56b13
%files -n python2-%{library}
d56b13
%license LICENSE
d56b13
%doc README.md
d56b13
%{python2_sitelib}/%{library}
d56b13
%{python2_sitelib}/%{library}-*.egg-info
d56b13
%exclude %{python2_sitelib}/%{library}/test
d56b13
%exclude %{python2_sitelib}/%{library}/e2e_test
d56b13
d56b13
%files -n python2-%{library}-tests
d56b13
%license LICENSE
d56b13
%{python2_sitelib}/%{library}/test
d56b13
%{python2_sitelib}/%{library}/e2e_test
d56b13
%endif
d56b13
d56b13
%if 0%{?fedora}
d56b13
%files doc
d56b13
%license LICENSE
d56b13
#%doc html
d56b13
%endif
d56b13
d56b13
%if 0%{?with_python3}
d56b13
%files -n %{py3}-%{library}
d56b13
%license LICENSE
d56b13
%doc README.md
d56b13
%{python3_sitelib}/%{library}
d56b13
%{python3_sitelib}/%{library}-*.egg-info
d56b13
%exclude %{python3_sitelib}/%{library}/test
d56b13
%exclude %{python3_sitelib}/%{library}/e2e_test
d56b13
d56b13
%files -n %{py3}-%{library}-tests
d56b13
%license LICENSE
d56b13
%{python3_sitelib}/%{library}/test
d56b13
%{python3_sitelib}/%{library}/e2e_test
d56b13
%endif
d56b13
d56b13
%changelog
d56b13
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1:11.0.0-7
d56b13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
d56b13
d56b13
* Fri Dec 11 2020 Jason Montleon <jmontleo@redhat.com> - 1:11.0.0-6
d56b13
- Fix sub-package requirements to account for the epoch
d56b13
d56b13
* Fri Dec 11 2020 Jason Montleon <jmontleo@redhat.com> - 1:11.0.0-5
d56b13
- Revert upadte until https://github.com/kubernetes-client/python/issues/1333 is fixed
d56b13
d56b13
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 11.0.0-4
d56b13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
d56b13
d56b13
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 11.0.0-3
d56b13
- Rebuilt for Python 3.9
d56b13
d56b13
* Thu Apr 30 2020 Jason Montleon <jmontleo@redhat.com> - 11.0.0-2
d56b13
- Fix EPEL 7 and 8 builds
d56b13
d56b13
* Thu Apr 30 2020 Jason Montleon <jmontleo@redhat.com> - 11.0.0-1
d56b13
- Update to 11.0.0
d56b13
d56b13
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 10.0.1-2
d56b13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
d56b13
- Work around BZ1758141 for BZ1799937
d56b13
d56b13
* Fri Nov 08 2019 Jason Montleon <jmontleo@redhat.com> 10.0.1-1
d56b13
- Update to upstream 10.0.1
d56b13
d56b13
* Fri Oct 18 2019 Jason Montleon <jmontleo@redhat.com> 9.0.1-1
d56b13
- Update to upstream 9.0.1
d56b13
d56b13
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 8.0.1-4
d56b13
- Rebuilt for Python 3.8.0rc1 (#1748018)
d56b13
d56b13
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 8.0.1-3
d56b13
- Rebuilt for Python 3.8
d56b13
d56b13
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 8.0.1-2
d56b13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
d56b13
d56b13
* Mon Feb 18 2019 Jason Montleon <jmontleo@redhat.com> 8.0.1-1
d56b13
- Update to upstream 8.0.1
d56b13
d56b13
* Sat Feb 2 2019 Jason Montleon <jmontleo@redhat.com> 8.0.0-8
d56b13
- add upstream patch to make python-adal optional
d56b13
- remove python-adal requires for EL7 since it's not available in RHEL base, optional, or extras
d56b13
d56b13
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 8.0.0-7
d56b13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
d56b13
d56b13
* Thu Jan 17 2019 Jason Montleon <jmontleo@redhat.com> 8.0.0-6
d56b13
- Only apply EL7 requirement patch on EL7 so Fedora dependency generator works correctly
d56b13
d56b13
* Thu Jan 17 2019 Jason Montleon <jmontleo@redhat.com> 8.0.0-5
d56b13
- Keep python 2 enabled for Fedora 29.
d56b13
d56b13
* Tue Jan 15 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 8.0.0-4
d56b13
- Enable python dependency generator
d56b13
d56b13
* Fri Dec 14 2018 Jason Montleon <jmontleo@redhat.com> 8.0.0-3
d56b13
- Default to python 2 for EPEL 7 and python 3 for Fedora
d56b13
- Add docs package for Fedora
d56b13
d56b13
* Mon Nov 26 2018 Jason Montleon <jmontleo@redhat.com> 8.0.0-2
d56b13
- Patch setup.py to work with EL7 python-setuptools
d56b13
d56b13
* Mon Nov 5 2018 Jason Montleon <jmontleo@redhat.com> 8.0.0-1
d56b13
- Update to 8.0.0
d56b13
d56b13
* Wed Oct 3 2018 Jason Montleon <jmontleo@redhat.com> 7.0.0-3
d56b13
- Adding missing python3-adal dependency
d56b13
d56b13
* Wed Oct 3 2018 Jason Montleon <jmontleo@redhat.com> 7.0.0-2
d56b13
- Adding missing python-adal dependency
d56b13
d56b13
* Wed Oct 3 2018 Jason Montleon <jmontleo@redhat.com> 7.0.0-1
d56b13
- Update to 7.0.0
d56b13
d56b13
* Tue Feb 28 2017 Alfredo Moralejo <amoralej@redhat.com> 1.0.0-0.3.0b3
d56b13
- Remove BRs for documentation building as it's not creating html docs.
d56b13
d56b13
* Mon Feb 27 2017 Alfredo Moralejo <amoralej@redhat.com> 1.0.0-0.2.0b3
d56b13
- Fixed files section of python3-kubernetes-tests to contain python3 tests.
d56b13
d56b13
* Mon Feb 27 2017 Alfredo Moralejo <amoralej@redhat.com> 1.0.0-0.1.0b3
d56b13
- Initial spec for release 1.0.0b3