Skip to content

Commit

Permalink
replacing unstable pip API with subprocess and sys.executable
Browse files Browse the repository at this point in the history
  • Loading branch information
jonrkarr committed Feb 24, 2020
1 parent 71e7d7d commit e273491
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions setup.py
Expand Up @@ -2,13 +2,10 @@
try:
import pkg_utils
except ImportError:
import pip
pip_version = tuple(pip.__version__.split('.'))
if pip_version >= ('19', '3', '0'):
import pip._internal.main as pip_main
elif pip_version >= ('19', '0', '0'):
import pip._internal as pip_main
pip_main.main(['install', 'pkg_utils'])
import subprocess
import sys
subprocess.check_call(
[sys.executable, "-m", "pip", "install", "pkg_utils"])
import pkg_utils
import os

Expand Down

0 comments on commit e273491

Please sign in to comment.