6a05cac
%if 0%{?rhel} != 0 && 0%{?rhel} <= 7
6a05cac
# Do not build bindings for python3 for RHEL <= 7
6a05cac
%bcond_with python3
6a05cac
%bcond_with tests
6a05cac
%global py2_build %{__python} setup.py build '--executable=/usr/bin/python2 -s'
6a05cac
%global py2_install %{__python} setup.py install --root %{buildroot}
6a05cac
%else
6a05cac
%bcond_without python3
6a05cac
%bcond_without tests
6a05cac
%endif
6a05cac
6a05cac
%global srcname docker
6a05cac
%global py2_docker_py_1 python2-docker-py
6a05cac
%global py3_docker_py_1 python3-docker-py
6a05cac
6a05cac
Name:           python-%{srcname}
b733b69
Version:        2.2.1
6a05cac
Release:        1%{?dist}
6a05cac
Summary:        A Python library for the Docker Engine API
6a05cac
License:        ASL 2.0
6a05cac
URL:            https://pypi.python.org/pypi/%{srcname}
6a05cac
Source0:        https://files.pythonhosted.org/packages/source/d/%{srcname}/%{srcname}-%{version}.tar.gz
6a05cac
6a05cac
# remove version requirements on depedencies needed for testing
6a05cac
# we have those in Fedora in different versions
6a05cac
Patch1:         unpin-test-requirements.patch
6a05cac
6a05cac
# Python packages mentioned in `extras_require` are not available in CentOS
6a05cac
Patch2:         setup-Neuter-extras_require-that-doesn-t-work-on-Cen.patch
6a05cac
6a05cac
BuildArch:      noarch
6a05cac
BuildRequires:  python2-devel
6a05cac
BuildRequires:  python-setuptools
6a05cac
6a05cac
%description
6a05cac
It lets you do anything the docker command does, but from within Python apps –
6a05cac
run containers, manage containers, manage Swarms, etc.
6a05cac
6a05cac
6a05cac
%package -n python2-%{srcname}
6a05cac
Summary:        A Python library for the Docker Engine API
6a05cac
%{?python_provide:%python_provide python2-%{srcname}}
6a05cac
6a05cac
%if %{with tests}
6a05cac
BuildRequires:  python-requests
6a05cac
BuildRequires:  python-mock >= 1.0.1
6a05cac
BuildRequires:  python-flake8 >= 2.4.1
6a05cac
BuildRequires:  python-pytest-cov >= 2.1.0
6a05cac
BuildRequires:  python2-pytest >= 2.9.1
6a05cac
BuildRequires:  python-coverage >= 3.7.1
6a05cac
BuildRequires:  python-backports-ssl_match_hostname
6a05cac
BuildRequires:  python-six >= 1.4.0
6a05cac
BuildRequires:  python-websocket-client >= 0.32.0
6a05cac
BuildRequires:  python-ipaddress
6a05cac
BuildRequires:  python2-docker-pycreds
6a05cac
%endif  # tests
6a05cac
6a05cac
Requires:       python-requests
6a05cac
Requires:       python-websocket-client >= 0.32.0
6a05cac
Requires:       python-six >= 1.4.0
6a05cac
Requires:       python-ipaddress
6a05cac
Requires:       python-backports-ssl_match_hostname
6a05cac
Requires:       python2-docker-pycreds
6a05cac
6a05cac
Obsoletes: %{py2_docker_py_1} < 1:2.0
6a05cac
6a05cac
%description -n python2-%{srcname}
6a05cac
It lets you do anything the docker command does, but from within Python apps –
6a05cac
run containers, manage containers, manage Swarms, etc.
6a05cac
6a05cac
%if %{with python3}
6a05cac
%package -n python3-%{srcname}
6a05cac
Summary:        A Python library for the Docker Engine API
6a05cac
%{?python_provide:%python_provide python3-%{srcname}}
6a05cac
6a05cac
BuildRequires:  python3-devel
6a05cac
BuildRequires:  python3-setuptools
6a05cac
%if %{with tests}
6a05cac
BuildRequires:  python3-mock >= 1.0.1
6a05cac
BuildRequires:  python3-pytest >= 2.9.1
6a05cac
BuildRequires:  python3-pytest-cov >= 2.1.0
6a05cac
BuildRequires:  python3-coverage >= 3.7.1
6a05cac
BuildRequires:  python3-flake8 >= 2.4.1
6a05cac
BuildRequires:  python3-six >= 1.3.0
6a05cac
BuildRequires:  python3-websocket-client >= 0.32.0
6a05cac
BuildRequires:  python3-requests >= 2.5.2
6a05cac
BuildRequires:  python3-docker-pycreds
6a05cac
%endif  # tests
6a05cac
Requires:       python3-websocket-client >= 0.32.0
6a05cac
Requires:       python3-requests
6a05cac
Requires:       python3-six >= 1.3.0
6a05cac
Requires:       python3-docker-pycreds
6a05cac
6a05cac
Obsoletes: %{py3_docker_py_1} < 1:2.0
6a05cac
6a05cac
%description -n python3-%{srcname}
6a05cac
It lets you do anything the docker command does, but from within Python apps –
6a05cac
run containers, manage containers, manage Swarms, etc.
6a05cac
%endif # with_python3
6a05cac
6a05cac
%prep
6a05cac
%autosetup -n %{srcname}-%{version} -p 1
6a05cac
rm -fr docker.egg-info
6a05cac
6a05cac
%build
6a05cac
%py2_build
6a05cac
6a05cac
%if %{with python3}
6a05cac
%py3_build
6a05cac
%endif # with_python3
6a05cac
6a05cac
%install
6a05cac
%py2_install
6a05cac
6a05cac
%if %{with python3}
6a05cac
%py3_install
6a05cac
%endif # with_python3
6a05cac
6a05cac
%check
6a05cac
%if %{with tests}
6a05cac
PYTHONPATH="${PWD}" py.test-%{python2_version} tests/unit/ || :
6a05cac
%endif
6a05cac
6a05cac
%if %{with python3}
6a05cac
%if %{with tests}
6a05cac
PYTHONPATH="${PWD}" py.test-%{python3_version} tests/unit/ || :
6a05cac
%endif # tests
6a05cac
%endif # with_python3
6a05cac
6a05cac
6a05cac
%files -n python2-%{srcname}
6a05cac
%license LICENSE
6a05cac
%doc README.md
6a05cac
%dir %{python_sitelib}/docker
6a05cac
%dir %{python_sitelib}/docker-%{version}-py2*.egg-info
6a05cac
%{python_sitelib}/docker/*
6a05cac
%{python_sitelib}/docker-%{version}-py2*.egg-info/*
6a05cac
6a05cac
%if %{with python3}
6a05cac
%files -n python3-%{srcname}
6a05cac
%license LICENSE
6a05cac
%doc README.md
6a05cac
%dir %{python3_sitelib}/docker
6a05cac
%dir %{python3_sitelib}/docker-%{version}-py3*.egg-info
6a05cac
%{python3_sitelib}/docker/*
6a05cac
%{python3_sitelib}/docker-%{version}-py3*.egg-info/*
6a05cac
%endif # with_python3
6a05cac
6a05cac
%changelog
b733b69
* Fri Apr 07 2017 Tomas Tomecek <ttomecek@redhat.com> - 2.2.1-1
b733b69
- new upstream release: 2.2.1
b733b69
6a05cac
* Mon Feb 20 2017 Tomas Tomecek <ttomecek@redhat.com> - 2.1.0-1
6a05cac
- new upstream release: 2.1.0
6a05cac
6a05cac
* Fri Feb 10 2017 Tomas Tomecek <ttomecek@redhat.com> - 2.0.2-1
6a05cac
- new upstream release: 2.0.2, new review:
6a05cac
 - remove remote inspection patch:
6a05cac
   https://github.com/projectatomic/atomic/issues/898
6a05cac
 - doesn't provide python-docker-py (not bacwards compat)
6a05cac
6a05cac
* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 1.10.6-2
6a05cac
- Rebuild for Python 3.6
6a05cac
6a05cac
* Mon Nov 28 2016 Tomas Tomecek <ttomecek@redhat.com> - 1.10.6-1
6a05cac
- new upstream release: 1.10.6
6a05cac
6a05cac
* Tue Oct 18 2016 Tomas Tomecek <ttomecek@redhat.com> - 1.10.4-1
6a05cac
- new upstream release: 1.10.4
6a05cac
6a05cac
* Wed Oct 05 2016 Tomas Tomecek <ttomecek@redhat.com> - 1.10.3-1
6a05cac
- new upstream release: 1.10.3
6a05cac
6a05cac
* Fri Jul 29 2016 Tomas Tomecek <ttomecek@redhat.com> - 1.9.0-1
6a05cac
- new upstream release: 1.9.0
6a05cac
6a05cac
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.9.0-0.2.rc2
6a05cac
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
6a05cac
6a05cac
* Wed Jun 29 2016 Tomas Tomecek <ttomecek@redhat.com> - 1.9.0-0.1.rc2
6a05cac
- update to 1.9.0rc2
6a05cac
6a05cac
* Fri Jun 17 2016 Tomas Tomecek <ttomecek@redhat.com> - 1.9.0-0.1.rc1
6a05cac
- update to 1.9.0rc1
6a05cac
6a05cac
* Tue May 03 2016 Tomas Tomecek <ttomecek@redhat.com> - 1.8.1-1
6a05cac
- new upstream release: 1.8.1
6a05cac
6a05cac
* Tue Apr 19 2016 Tomas Tomecek <ttomecek@redhat.com> - 1.8.0-3
6a05cac
- remove "py2-ipaddress" as a dependency since it's not available,
6a05cac
  use python-ipaddress instead
6a05cac
6a05cac
* Mon Apr 11 2016 Colin Walters <walters@redhat.com> - 1.8.0-2
6a05cac
- Use bcond, make it easier to build on CentOS 7 for
6a05cac
  https://lists.projectatomic.io/projectatomic-archives/atomic-devel/2016-April/msg00004.html
6a05cac
6a05cac
* Thu Apr 07 2016 Tomas Tomecek <ttomecek@redhat.com> - 1.8.0-1
6a05cac
- new upstream release: 1.8.0
6a05cac
6a05cac
* Fri Mar 04 2016 Tomas Tomecek <ttomecek@redhat.com> - 1.7.2-1
6a05cac
- new upstream release: 1.7.2
6a05cac
- modernized specfile
6a05cac
- fixed URL
6a05cac
6a05cac
* Mon Feb 08 2016 Tomas Tomecek <ttomecek@redhat.com> - 1.7.0.0-1
6a05cac
- new upstream release: 1.7.0
6a05cac
6a05cac
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.0rc2-2
6a05cac
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
6a05cac
6a05cac
* Mon Jan 25 2016 Tomas Tomecek <ttomecek@redhat.com> - 1.7.0rc2-1
6a05cac
- new upstream release: 1.7.0rc2
6a05cac
6a05cac
* Fri Jan 08 2016 Tomas Tomecek <ttomecek@redhat.com> - 1.6.0-2
6a05cac
- new downstream patch: remote inspection
6a05cac
6a05cac
* Wed Dec 02 2015 Tomas Tomecek <ttomecek@redhat.com> - 1.6.0-1
6a05cac
- new upstream release: 1.6.0
6a05cac
6a05cac
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.0-2
6a05cac
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
6a05cac
6a05cac
* Tue Oct 13 2015 Tomas Tomecek <ttomecek@redhat.com> - 1.5.0-1
6a05cac
- new upstream release: 1.5.0
6a05cac
6a05cac
* Fri Sep 11 2015 Tomas Tomecek <ttomecek@redhat.com> - 1.4.0-1
6a05cac
- new upstream release: 1.4.0
6a05cac
6a05cac
* Tue Jul 28 2015 Tomas Tomecek <ttomecek@redhat.com> - 1.3.1-1
6a05cac
- new upstream release: 1.3.1
6a05cac
6a05cac
* Fri Jul 10 2015 Tomas Tomecek <ttomecek@redhat.com> - 1.3.0-1
6a05cac
- new upstream release: 1.3.0
6a05cac
6a05cac
* Fri Jun 19 2015 Tomas Tomecek <ttomecek@redhat.com> - 1.2.3-1
6a05cac
- new upstream release: 1.2.3
6a05cac
6a05cac
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.2-2
6a05cac
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
6a05cac
6a05cac
* Wed May 06 2015 Tomas Tomecek <ttomecek@redhat.com> - 1.2.2-1
6a05cac
- new upstream release: 1.2.2
6a05cac
6a05cac
* Thu Apr 30 2015 Tomas Tomecek <ttomecek@redhat.com> - 1.2.1-1
6a05cac
- new upstream release: 1.2.1
6a05cac
6a05cac
* Wed Mar 18 2015 Tomas Tomecek <ttomecek@redhat.com> - 1.1.0-2
6a05cac
- docker-py 1.1.0 requires requests>=2.5.2
6a05cac
6a05cac
* Fri Mar 13 2015 Tomas Tomecek <ttomecek@redhat.com> - 1.1.0-1
6a05cac
- new upstream release: 1.1.0
6a05cac
- use latest python-requests
6a05cac
- run unit test during build
6a05cac
6a05cac
* Wed Feb 25 2015 Lokesh Mandvekar <lsm5@fedoraproject.org> - 1.0.0-1
6a05cac
- update to upstream 1.0.0
6a05cac
- Resolves: rhbz#1195627 - don't (B)R docker
6a05cac
- use github url instead of pypi
6a05cac
- run tests in check if /run/docker.sock exists
6a05cac
6a05cac
* Wed Jan 14 2015 Lokesh Mandvekar <lsm5@fedoraproject.org> - 0.7.1-1
6a05cac
- Resolves: rhbz#1182003 - Update to 0.7.1
6a05cac
6a05cac
* Thu Dec 25 2014 Igor Gnatenko <ignatenko@mirantis.com> - 0.7.0-1
6a05cac
- Update to 0.7.0 (RHBZ #1176950)
6a05cac
6a05cac
* Mon Dec 01 2014 Tomas Radej <tradej@redhat.com> - 0.6.0-2
6a05cac
- Added Python 3 subpackage
6a05cac
6a05cac
* Fri Nov 21 2014 Lokesh Mandvekar <lsm5@fedoraproject.org> - 0.6.0-1
6a05cac
- Resolves: rhbz#1160293 - update to 0.6.0
6a05cac
6a05cac
* Thu Oct 23 2014 Lokesh Mandvekar <lsm5@fedoraproject.org> - 0.5.3-2
6a05cac
- Resolves: rhbz#1145895
6a05cac
- versioned python-requests req only for f21+
6a05cac
6a05cac
* Wed Oct 22 2014 Lokesh Mandvekar <lsm5@fedoraproject.org> - 0.5.3-1
6a05cac
- Resolves: rhbz#1153991 - update to 0.5.3
6a05cac
6a05cac
* Tue Sep 23 2014 Tom Prince <tom.prince@clusterhq.com> - 0.5.0-2
6a05cac
- Specify depedencies to match those in setup.py
6a05cac
6a05cac
* Mon Sep 22 2014 Tom Prince <tom.prince@clusterhq.com> - 0.5.0-1
6a05cac
- Resolves: rhbz#1145511 - version bump to 0.5.0
6a05cac
6a05cac
* Tue Aug 26 2014 Lokesh Mandvekar <lsm5@fedoraproject.org> - 0.4.0-3
6a05cac
- correct bogus date
6a05cac
6a05cac
* Tue Aug 26 2014 Lokesh Mandvekar <lsm5@fedoraproject.org> - 0.4.0-2
6a05cac
- rewrite BR&R conditionals for docker/docker-io
6a05cac
6a05cac
* Thu Aug 21 2014 Lokesh Mandvekar <lsm5@fedoraproject.org> - 0.4.0-1
6a05cac
- update to 0.4.0
6a05cac
- Resolves: rhbz#1132604 (epel7 only)
6a05cac
6a05cac
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.2-2
6a05cac
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
6a05cac
6a05cac
* Sat Jul 12 2014 Lokesh Mandvekar <lsm5@fedoraproject.org> - 0.3.2-1
6a05cac
- version bump to 0.3.2
6a05cac
- Resolves: rhbz#1097415
6a05cac
6a05cac
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.3-9
6a05cac
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
6a05cac
6a05cac
* Mon Feb 10 2014 Lokesh Mandvekar <lsm5@redhat.com> 0.2.3-8
6a05cac
- Bug 1063369 - Fix APIError for python-requests-1.1 on rhel6
6a05cac
6a05cac
* Sat Feb 08 2014 Lokesh Mandvekar <lsm5@redhat.com> 0.2.3-7
6a05cac
- Bug 1048667 - disable debug package cause archful
6a05cac
6a05cac
* Fri Feb 07 2014 Lokesh Mandvekar <lsm5@redhat.com> 0.2.3-6
6a05cac
- doesn't need python-mock at runtime
6a05cac
6a05cac
* Thu Jan 09 2014 Lokesh Mandvekar <lsm5@redhat.com> 0.2.3-5
6a05cac
- python3 to be added after python3-websocket-client (BZ 1049424)
6a05cac
6a05cac
* Tue Jan 07 2014 Lokesh Mandvekar <lsm5@redhat.com> 0.2.3-4
6a05cac
- double '%' to comment macros
6a05cac
- check section not considered for now
6a05cac
- python3- description in python3- subpackage conditional
6a05cac
6a05cac
* Tue Jan 07 2014 Lokesh Mandvekar <lsm5@redhat.com> 0.2.3-3
6a05cac
- Everything goes in main package
6a05cac
- python3 package requires corrected
6a05cac
- package name python-docker-py
6a05cac
- both packages require docker-io
6a05cac
6a05cac
* Mon Jan 06 2014 Lokesh Mandvekar <lsm5@redhat.com> 0.2.3-2
6a05cac
- python3 subpackage
6a05cac
- upstream uses PyPI
6a05cac
- package owns directories it creates
6a05cac
- build and runtime deps updated
6a05cac
6a05cac
* Sun Jan 05 2014 Lokesh Mandvekar <lsm5@redhat.com> 0.2.3-1
6a05cac
- Initial fedora package