dev-python/docker-py: Stabilize on amd64
[gentoo.git] / dev-python / docker-py / docker-py-2.7.0.ebuild
1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5 PYTHON_COMPAT=( python{2_7,3_4,3_5,3_6} )
6
7 inherit distutils-r1
8
9 DESCRIPTION="Python client for Docker"
10 HOMEPAGE="https://github.com/docker/docker-py"
11 SRC_URI="https://github.com/docker/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
12
13 LICENSE="Apache-2.0"
14 SLOT="0"
15 KEYWORDS="amd64 ~arm64 ~x86"
16 IUSE="doc test"
17
18 RDEPEND="
19         >=dev-python/docker-pycreds-0.2.1[${PYTHON_USEDEP}]
20         !~dev-python/requests-2.18.0[${PYTHON_USEDEP}]
21         >=dev-python/requests-2.14.2[${PYTHON_USEDEP}]
22         >=dev-python/six-1.4.0[${PYTHON_USEDEP}]
23         >=dev-python/websocket-client-0.32.0[${PYTHON_USEDEP}]
24         $(python_gen_cond_dep '>=dev-python/backports-ssl-match-hostname-3.5[${PYTHON_USEDEP}]' 'python2_7' 'python3_4' )
25         $(python_gen_cond_dep '>=dev-python/ipaddress-1.0.16[${PYTHON_USEDEP}]' 'python2_7' )
26 "
27 DEPEND="
28         dev-python/setuptools[${PYTHON_USEDEP}]
29         test? (
30                 ${RDEPEND}
31                 >=dev-python/mock-1.0.1[${PYTHON_USEDEP}]
32                 dev-python/pytest-runner[${PYTHON_USEDEP}]
33                 >=dev-python/pytest-2.9.1[${PYTHON_USEDEP}]
34         )
35         doc? (
36                 dev-python/recommonmark[${PYTHON_USEDEP}]
37                 >=dev-python/sphinx-1.4.6[${PYTHON_USEDEP}]
38         )
39 "
40
41 python_prepare_all() {
42         sed -i -e "s/import pip//" -e "s/if 'docker-py'.*/if False:/" setup.py || die
43         distutils-r1_python_prepare_all
44 }
45
46 python_compile_all() {
47         if use doc; then
48                 sphinx-build docs html || die "docs failed to build"
49                 HTML_DOCS=( html/. )
50         fi
51 }
52
53 python_test() {
54         py.test tests/unit/ || die "tests failed under ${EPYTHON}"
55 }