2
0
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:
Ameya Shenoy 2018-04-15 03:23:49 +05:30
parent e630093746
commit 5d7bb5a896
No known key found for this signature in database
GPG Key ID: 735490161CD5C91E
2 changed files with 7 additions and 8 deletions

View File

@ -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:

View File

@ -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