From 642935a8a85f880e5db6f0ac889632a5683a7e59 Mon Sep 17 00:00:00 2001 From: Ameya Shenoy Date: Tue, 17 Apr 2018 16:13:17 +0530 Subject: [PATCH] removed pip lockdown on 9.0.3 --- .travis.yml | 2 +- bench/commands/__init__.py | 3 +-- bench/utils.py | 5 ++--- playbooks/install.py | 6 +++--- setup.py | 16 ++++++---------- 5 files changed, 13 insertions(+), 19 deletions(-) diff --git a/.travis.yml b/.travis.yml index cb463b9b..d3221fd8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,7 +22,7 @@ install: script: - cd ~ - - sudo pip install --upgrade pip==9.0.3 + - sudo pip install --upgrade pip - sudo pip install -e ~/.bench # - sudo python -m unittest bench.tests.test_setup_production.TestSetupProduction.test_setup_production_v6 - sudo python -m unittest -v bench.tests.test_setup_production diff --git a/bench/commands/__init__.py b/bench/commands/__init__.py index da0bb257..0da08013 100755 --- a/bench/commands/__init__.py +++ b/bench/commands/__init__.py @@ -159,8 +159,7 @@ def migrate_env(python, no_backup = False): ), cwd = path) pip = osp.join(pvenv, 'bin', 'pip') - # pip 10 seems to have a few problems associated with it, temporary freeze pip at 9.0.3 - exec_cmd('{pip} install --upgrade pip==9.0.3'.format(pip=pip)) + exec_cmd('{pip} install --upgrade pip'.format(pip=pip)) exec_cmd('{pip} install --upgrade setuptools'.format(pip=pip)) # TODO: Options diff --git a/bench/utils.py b/bench/utils.py index 7aedfd0f..7458e5c7 100755 --- a/bench/utils.py +++ b/bench/utils.py @@ -173,7 +173,7 @@ def setup_env(bench_path='.', python = 'python'): python = which(python, raise_err = True) exec_cmd('virtualenv -q {} -p {}'.format('env', python), cwd=bench_path) - exec_cmd('./env/bin/pip -q install --upgrade pip==9.0.3', cwd=bench_path) + exec_cmd('./env/bin/pip -q install --upgrade pip', cwd=bench_path) exec_cmd('./env/bin/pip -q install wheel', cwd=bench_path) # exec_cmd('./env/bin/pip -q install https://github.com/frappe/MySQLdb1/archive/MySQLdb-1.2.5-patched.tar.gz', cwd=bench_path) exec_cmd('./env/bin/pip -q install six', cwd=bench_path) @@ -421,8 +421,7 @@ def update_requirements(bench_path='.'): print('Updating Python libraries...') pip = os.path.join(bench_path, 'env', 'bin', 'pip') - # pip 10 seems to have a few problems associated with it, temporary freeze pip at 9.0.3 - exec_cmd("{pip} install --upgrade pip==9.0.3".format(pip=pip)) + exec_cmd("{pip} install --upgrade pip".format(pip=pip)) apps_dir = os.path.join(bench_path, 'apps') diff --git a/playbooks/install.py b/playbooks/install.py index c2504478..b569a656 100644 --- a/playbooks/install.py +++ b/playbooks/install.py @@ -36,7 +36,7 @@ def install_bench(args): # secure pip installation if find_executable('pip'): run_os_command({ - 'pip': 'sudo pip install --upgrade setuptools urllib3 requests cryptography pip==9.0.3' + 'pip': 'sudo pip install --upgrade setuptools urllib3 requests cryptography pip' }) else: @@ -51,7 +51,7 @@ def install_bench(args): if success: run_os_command({ - 'pip': 'sudo pip install --upgrade setuptools urllib3 requests cryptography pip==9.0.3' + 'pip': 'sudo pip install --upgrade setuptools urllib3 requests cryptography pip' }) success = run_os_command({ @@ -374,7 +374,7 @@ def parse_commandline_args(): parser.add_argument('--frappe-branch', dest='frappe_branch', action='store', help='Clone a particular branch of frappe') - parser.add_argument('--erpnext-repo-url', dest='erpnext_repo_url', action='store', default='https://github.com/frappe/erpnext', + parser.add_argument('--erpnext-repo-url', dest='erpnext_repo_url', action='store', default='https://github.com/frappe/erpnext', help='Clone erpnext from the given url') parser.add_argument('--erpnext-branch', dest='erpnext_branch', action='store', diff --git a/setup.py b/setup.py index 69379c67..6cbeddbc 100644 --- a/setup.py +++ b/setup.py @@ -1,18 +1,15 @@ 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 import re, ast # get version from __version__ variable in bench/__init__.py _version_re = re.compile(r'__version__\s+=\s+(.*)') -with open('bench/__init__.py', 'rb') as f: - version = str(ast.literal_eval(_version_re.search( - f.read().decode('utf-8')).group(1))) +with open('requirements.txt') as f: + install_requires = f.read().strip().split('\n') -requirements = parse_requirements("requirements.txt", session="") +with open('bench/__init__.py', 'rb') as f: + version = str(ast.literal_eval(_version_re.search( + f.read().decode('utf-8')).group(1))) setup( name='bench', @@ -23,8 +20,7 @@ setup( packages=find_packages(), zip_safe=False, include_package_data=True, - install_requires=[str(ir.req) for ir in requirements], - dependency_links=[str(ir._link) for ir in requirements if ir._link], + install_requires=install_requires, entry_points=''' [console_scripts] bench=bench.cli:cli