mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
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:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user