From 72d3077b1cb1e93ec3a5508f89a66ae7dd4132a9 Mon Sep 17 00:00:00 2001 From: Kunal Gosar Date: Sun, 24 Jun 2018 19:11:35 -0500 Subject: [PATCH 1/2] make compatible with pip version 10 --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index e16efe4b86e..edf709b12c6 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ import setuptools.command.build_ext as _build_ext import sys import platform -import pip +from pip._internal import main # https://github.com/pypa/pip/issues/5240 python_version = platform.python_version()[:3] @@ -37,7 +37,7 @@ class build_ext(_build_ext.build_ext): def run(self): - pip.main(['install', ray_whl]) + main(['install', ray_whl]) setup( From 7ec87570c959d5fac7956f7e24398e62237fcdf0 Mon Sep 17 00:00:00 2001 From: Kunal Gosar Date: Sun, 24 Jun 2018 19:22:53 -0500 Subject: [PATCH 2/2] make compatible with all pip versions --- setup.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index edf709b12c6..00d376da0fe 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,14 @@ import setuptools.command.build_ext as _build_ext import sys import platform -from pip._internal import main # https://github.com/pypa/pip/issues/5240 +import pip + +pip_major = int(pip.__version__.split(".")[0]) +if pip_major < 10: + # https://github.com/pypa/pip/issues/5240 + from pip import main +else: + from pip._internal import main python_version = platform.python_version()[:3]