]> rtime.felk.cvut.cz Git - coffee/buildroot.git/blob - package/python-docker/0001-setup.py-make-pip-optional.patch
package: add python-docker
[coffee/buildroot.git] / package / python-docker / 0001-setup.py-make-pip-optional.patch
1 From 978643b7222db66837d39037f884be01fb9af234 Mon Sep 17 00:00:00 2001
2 From: Peter Korsgaard <peter@korsgaard.com>
3 Date: Fri, 9 Mar 2018 18:40:16 +0100
4 Subject: [PATCH] setup.py: make pip optional
5
6 pip may not be available on the build host, and it is only used to check if
7 docker-py is already installed, so skip the check if pip isn't available.
8
9 [Upstream-status: submitted (https://github.com/docker/docker-py/pull/1948)]
10 Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
11 ---
12  setup.py | 20 ++++++++++++--------
13  1 file changed, 12 insertions(+), 8 deletions(-)
14
15 diff --git a/setup.py b/setup.py
16 index 271d94f..c9b91a3 100644
17 --- a/setup.py
18 +++ b/setup.py
19 @@ -5,16 +5,20 @@ import codecs
20  import os
21  import sys
22  
23 -import pip
24 -
25  from setuptools import setup, find_packages
26  
27 -if 'docker-py' in [x.project_name for x in pip.get_installed_distributions()]:
28 -    print(
29 -        'ERROR: "docker-py" needs to be uninstalled before installing this'
30 -        ' package:\npip uninstall docker-py', file=sys.stderr
31 -    )
32 -    sys.exit(1)
33 +try:
34 +    import pip
35 +
36 +    if 'docker-py' in \
37 +            [x.project_name for x in pip.get_installed_distributions()]:
38 +        print(
39 +            'ERROR: "docker-py" needs to be uninstalled before installing this'
40 +            ' package:\npip uninstall docker-py', file=sys.stderr
41 +        )
42 +        sys.exit(1)
43 +except ImportError:
44 +    pass
45  
46  ROOT_DIR = os.path.dirname(__file__)
47  SOURCE_DIR = os.path.join(ROOT_DIR)
48 -- 
49 2.11.0
50