mirror of
https://github.com/frappe/bench.git
synced 2024-11-12 00:06:36 +00:00
Merge pull request #1001 from gavindsouza/fix-setup-requirements
fix: don't run yarn install while setting up py requirements
This commit is contained in:
commit
70ea51af4b
@ -20,7 +20,7 @@ from six.moves import reload_module
|
||||
# imports - module imports
|
||||
import bench
|
||||
from bench.config.common_site_config import get_config
|
||||
from bench.utils import CommandFailedError, build_assets, check_git_for_shallow_clone, exec_cmd, get_cmd_output, get_frappe, restart_supervisor_processes, restart_systemd_processes, run_frappe_cmd
|
||||
from bench.utils import color, CommandFailedError, build_assets, check_git_for_shallow_clone, exec_cmd, get_cmd_output, get_frappe, restart_supervisor_processes, restart_systemd_processes, run_frappe_cmd
|
||||
|
||||
|
||||
logger = logging.getLogger(bench.PROJECT_NAME)
|
||||
@ -177,6 +177,7 @@ def new_app(app, bench_path='.'):
|
||||
|
||||
|
||||
def install_app(app, bench_path=".", verbose=False, no_cache=False, postprocess=True, skip_assets=False):
|
||||
print('\n{0}Installing {1}{2}'.format(color.yellow, app, color.nc))
|
||||
logger.log("installing {}".format(app))
|
||||
|
||||
pip_path = os.path.join(bench_path, "env", "bin", "pip")
|
||||
|
@ -128,13 +128,17 @@ def setup_socketio():
|
||||
@click.option("--node", help="Update only Node packages", default=False, is_flag=True)
|
||||
@click.option("--python", help="Update only Python packages", default=False, is_flag=True)
|
||||
def setup_requirements(node=False, python=False):
|
||||
if not node:
|
||||
from bench.utils import update_requirements as setup_python_packages
|
||||
setup_python_packages()
|
||||
if not (node or python):
|
||||
from bench.utils import update_requirements
|
||||
update_requirements()
|
||||
|
||||
if not python:
|
||||
from bench.utils import update_node_packages as setup_node_packages
|
||||
setup_node_packages()
|
||||
elif not node:
|
||||
from bench.utils import update_python_packages
|
||||
update_python_packages()
|
||||
|
||||
elif not python:
|
||||
from bench.utils import update_node_packages
|
||||
update_node_packages()
|
||||
|
||||
|
||||
@click.command("manager", help="Setup bench-manager.local site with the bench_manager app installed on it")
|
||||
|
@ -591,15 +591,26 @@ def update_env_pip(bench_path):
|
||||
|
||||
def update_requirements(bench_path='.'):
|
||||
from bench.app import get_apps, install_app
|
||||
print('Updating Python libraries...')
|
||||
print('Installing applications...')
|
||||
|
||||
# update env pip
|
||||
update_env_pip(bench_path)
|
||||
|
||||
for app in get_apps():
|
||||
install_app(app, bench_path=bench_path, skip_assets=True)
|
||||
|
||||
|
||||
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)
|
||||
|
||||
|
||||
def update_node_packages(bench_path='.'):
|
||||
print('Updating node packages...')
|
||||
from bench.app import get_develop_version
|
||||
|
Loading…
Reference in New Issue
Block a user