PY-29395 Use pip._internal.main instead of pip.main in pip 10.0

It's obviously only a workaround, we should find a better way
not to use internal modules of the package altogether.
This commit is contained in:
Mikhail Golubev
2018-04-06 12:58:58 +03:00
parent 3e5b51fd24
commit a7ec58330c
+13 -6
View File
@@ -101,20 +101,27 @@ def do_get_latest_version(urls, req):
return
return ""
def do_install(pkgs):
try:
import pip
except ImportError:
error_no_pip()
return pip.main(['install'] + pkgs)
return pip_main(['install'] + pkgs)
def do_uninstall(pkgs):
return pip_main(['uninstall', '-y'] + pkgs)
def pip_main(args):
try:
import pip
except ImportError:
error_no_pip()
return pip.main(['uninstall', '-y'] + pkgs)
try:
func = pip.main
except AttributeError:
from pip._internal import main as func
func(args)
def do_pyvenv(path, system_site_packages):