示例#1
0
def update_requirements(bench_path='.'):
    from bench.app import get_apps, install_app
    print('Updating Python libraries...')

    # update env pip
    update_env_pip(bench_path)

    for app in get_apps():
        install_app(app, bench_path=bench_path, skip_assets=True)
示例#2
0
def update_requirements(bench_path='.'):
    from bench.app import get_apps, install_app
    print('Installing applications...')

    update_env_pip(bench_path)

    for app in get_apps():
        install_app(app,
                    bench_path=bench_path,
                    skip_assets=True,
                    restart_bench=False)
示例#3
0
def update_requirements(bench_path='.'):
    from bench.app import get_apps, install_app
    print('Updating Python libraries...')

    # update env pip
    update_env_pip(bench_path)

    # Update bench requirements (at user level)
    update_bench_requirements()

    for app in get_apps():
        install_app(app, bench_path=bench_path)
def update_requirements(bench_path='.'):
    print('Updating Python libraries...')
    pip = os.path.join(bench_path, 'env', 'bin', 'pip')

    exec_cmd("{pip} install --upgrade pip".format(pip=pip))

    # Update bench requirements
    bench_req_file = os.path.join(os.path.dirname(bench.__path__[0]),
                                  'requirements.txt')
    install_requirements(pip, bench_req_file)

    from bench.app import get_apps, install_app

    for app in get_apps():
        install_app(app, bench_path=bench_path)
示例#5
0
文件: utils.py 项目: seethersan/bench
def update_requirements(bench_path='.'):
	print('Updating Python libraries...')
	pip = os.path.join(bench_path, 'env', 'bin', 'pip')

	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)

	from bench.app import get_apps, install_app

	for app in get_apps():
		install_app(app, bench_path=bench_path)
示例#6
0
def update_requirements(bench_path='.'):
	print('Updating Python libraries...')

	# update env pip
	env_pip = os.path.join(bench_path, 'env', 'bin', 'pip')
	exec_cmd("{pip} install -q -U pip".format(pip=env_pip))

	# Update bench requirements (at user level)
	bench_req_file = os.path.join(os.path.dirname(bench.__path__[0]), 'requirements.txt')
	user_pip = which("pip" if PY2 else "pip3")
	install_requirements(user_pip, bench_req_file, user=True)

	from bench.app import get_apps, install_app

	for app in get_apps():
		install_app(app, bench_path=bench_path)
示例#7
0
文件: utils.py 项目: seethersan/bench
	def setup_app(app):
		# run git reset --hard in each branch, pull latest updates and install_app
		app_path = os.path.join(bench_path, 'apps', app)

		# remove .egg-ino
		subprocess.check_output(['rm', '-rf', app + '.egg-info'], cwd=app_path)

		if update_app and os.path.exists(os.path.join(app_path, '.git')):
			remotes = subprocess.check_output(['git', 'remote'], cwd=app_path).strip().split()
			if 'upstream' in remotes:
				remote = 'upstream'
			else:
				remote = remotes[0]
			print('Cleaning up {0}'.format(app))
			branch = subprocess.check_output(['git', 'rev-parse', '--abbrev-ref', 'HEAD'], cwd=app_path).strip()
			subprocess.check_output(['git', 'reset', '--hard'], cwd=app_path)
			subprocess.check_output(['git', 'pull', '--rebase', remote, branch], cwd=app_path)

		install_app(app, bench_path)
示例#8
0
	def setup_app(app):
		# run git reset --hard in each branch, pull latest updates and install_app
		app_path = os.path.join(bench_path, 'apps', app)

		# remove .egg-ino
		subprocess.check_output(['rm', '-rf', app + '.egg-info'], cwd=app_path)

		if update_app and os.path.exists(os.path.join(app_path, '.git')):
			remotes = subprocess.check_output(['git', 'remote'], cwd=app_path).strip().split()
			if 'upstream' in remotes:
				remote = 'upstream'
			else:
				remote = remotes[0]
			print('Cleaning up {0}'.format(app))
			branch = subprocess.check_output(['git', 'rev-parse', '--abbrev-ref', 'HEAD'], cwd=app_path).strip()
			subprocess.check_output(['git', 'reset', '--hard'], cwd=app_path)
			subprocess.check_output(['git', 'pull', '--rebase', remote, branch], cwd=app_path)

		install_app(app, bench_path)
示例#9
0
def update_requirements(bench_path='.'):
    print('Updating Python libraries...')
    pip = os.path.join(bench_path, 'env', 'bin', 'pip')
    cmd_str = "{pip} --version".format(pip=pip)
    pip_version = str(subprocess.check_output(cmd_str, shell=True))
    #if pip version is 9.0.3 (for old versions of frappe/erpnext, DO NOT UPDATE pip
    if pip_version.split(' ')[1] != "9.0.3":
        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)

    from bench.app import get_apps, install_app

    for app in get_apps():
        install_app(app, bench_path=bench_path)
示例#10
0
文件: utils.py 项目: vallantis/bench

def update_env_pip(bench_path):
	env_pip = os.path.join(bench_path, 'env', 'bin', 'pip')
	exec_cmd("{pip} install -q -U pip".format(pip=env_pip))


def update_requirements(bench_path='.'):
	from bench.app import get_apps, install_app
	print('Installing applications...')

	update_env_pip(bench_path)

	for app in get_apps():
<<<<<<< HEAD
		install_app(app, bench_path=bench_path, skip_assets=True, restart_bench=False)


def update_python_packages(bench_path='.'):
	from bench.app import get_apps
	pip_path = os.path.join(bench_path, "env", "bin", "pip")
	print('Updating Python libraries...')

	update_env_pip(bench_path)
	for app in get_apps():
		print('\n{0}Installing python dependencies for {1}{2}'.format(color.yellow, app, color.nc))
		app_path = os.path.join(bench_path, "apps", app)
		exec_cmd("{0} install -q -U -e {1}".format(pip_path, app_path), cwd=bench_path)
=======
		install_app(app, bench_path=bench_path, skip_assets=True, postprocess=False)
>>>>>>> c226d97b27bd851b04ef613f97182fa7de83dcd1