mirror of
https://github.com/frappe/bench.git
synced 2025-01-23 15:08:24 +00:00
Compatibility fixes for pip 10
This commit is contained in:
parent
e630093746
commit
5d7bb5a896
@ -36,21 +36,17 @@ def install_bench(args):
|
|||||||
# secure pip installation
|
# secure pip installation
|
||||||
if find_executable('pip'):
|
if find_executable('pip'):
|
||||||
run_os_command({
|
run_os_command({
|
||||||
'yum': 'sudo pip install --upgrade setuptools pip',
|
'pip': 'sudo pip install --upgrade setuptools pip'
|
||||||
'apt-get': 'sudo pip install --upgrade setuptools pip',
|
|
||||||
'brew': "sudo pip install --upgrade setuptools pip --user"
|
|
||||||
})
|
})
|
||||||
|
|
||||||
else:
|
else:
|
||||||
if not os.path.exists("get-pip.py"):
|
if not os.path.exists("get-pip.py"):
|
||||||
run_os_command({
|
run_os_command({
|
||||||
'apt-get': 'wget https://bootstrap.pypa.io/get-pip.py',
|
'wget': 'wget https://bootstrap.pypa.io/get-pip.py'
|
||||||
'yum': 'wget https://bootstrap.pypa.io/get-pip.py'
|
|
||||||
})
|
})
|
||||||
|
|
||||||
success = run_os_command({
|
success = run_os_command({
|
||||||
'apt-get': 'sudo python get-pip.py',
|
'python': 'sudo python get-pip.py --force-reinstall'
|
||||||
'yum': 'sudo python get-pip.py',
|
|
||||||
})
|
})
|
||||||
|
|
||||||
if success:
|
if success:
|
||||||
|
3
setup.py
3
setup.py
@ -1,4 +1,7 @@
|
|||||||
from setuptools import setup, find_packages
|
from setuptools import setup, find_packages
|
||||||
|
try: # for pip >= 10
|
||||||
|
from pip._internal.req import parse_requirements
|
||||||
|
except ImportError: # for pip <= 9.0.3
|
||||||
from pip.req import parse_requirements
|
from pip.req import parse_requirements
|
||||||
import re, ast
|
import re, ast
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user