2
0
mirror of https://github.com/frappe/bench.git synced 2024-11-11 15:51:03 +00:00

Merge pull request #861 from gavindsouza/pinned-requirements

fix: add upgrade flags to pip install
This commit is contained in:
gavin 2019-11-18 12:16:10 +05:30 committed by GitHub
commit 1d7e3ca383
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 13 deletions

View File

@ -160,16 +160,15 @@ def new_app(app, bench_path='.'):
run_frappe_cmd('make-app', apps, app, bench_path=bench_path)
install_app(app, bench_path=bench_path)
def install_app(app, bench_path='.', verbose=False, no_cache=False):
logger.info('installing {}'.format(app))
# find_links = '--find-links={}'.format(conf.get('wheel_cache_dir')) if conf.get('wheel_cache_dir') else ''
find_links = ''
exec_cmd("{pip} install {quiet} {find_links} -e {app} {no_cache}".format(
pip=os.path.join(bench_path, 'env', 'bin', 'pip'),
quiet="-q" if not verbose else "",
no_cache='--no-cache-dir' if no_cache else '',
app=os.path.join(bench_path, 'apps', app),
find_links=find_links))
def install_app(app, bench_path=".", verbose=False, no_cache=False):
logger.info("installing {}".format(app))
pip_path = os.path.join(bench_path, "env", "bin", "pip")
quiet_flag = "-q" if not verbose else ""
app_path = os.path.join(bench_path, "apps", app)
cache_flag = "--no-cache-dir" if no_cache else ""
exec_cmd("{pip} install {quiet} -U -e {app} {no_cache}".format(pip=pip_path, quiet=quiet_flag, app=app_path, no_cache=cache_flag))
add_to_appstxt(app, bench_path=bench_path)
def remove_app(app, bench_path='.'):

View File

@ -431,8 +431,6 @@ def update_requirements(bench_path='.'):
exec_cmd("{pip} install --upgrade pip".format(pip=pip))
apps_dir = os.path.join(bench_path, 'apps')
# Update bench requirements
bench_req_file = os.path.join(os.path.dirname(bench.__path__[0]), 'requirements.txt')
install_requirements(pip, bench_req_file)
@ -504,7 +502,7 @@ def update_npm_packages(bench_path='.'):
def install_requirements(pip, req_file):
if os.path.exists(req_file):
exec_cmd("{pip} install -q -r {req_file}".format(pip=pip, req_file=req_file))
exec_cmd("{pip} install -q -U -r {req_file}".format(pip=pip, req_file=req_file))
def backup_site(site, bench_path='.'):
bench.set_frappe_version(bench_path=bench_path)