Skip to content

Commit

Permalink
Make setup.py compatible with pip version 10 (#9)
Browse files Browse the repository at this point in the history
* make compatible with pip version 10

* make compatible with all pip versions
  • Loading branch information
kunalgosar authored and devin-petersohn committed Jun 25, 2018
1 parent 3df1985 commit f049ece
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@
import platform
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]

ray_whl = "ray" # Fall back on pip install if no relevant wheel exists
Expand Down Expand Up @@ -37,7 +44,7 @@

class build_ext(_build_ext.build_ext):
def run(self):
pip.main(['install', ray_whl])
main(['install', ray_whl])


setup(
Expand Down

0 comments on commit f049ece

Please sign in to comment.