mirror of
https://github.com/frappe/bench.git
synced 2024-11-12 00:06:36 +00:00
fix: dont run ayrn install while setting up py reqs
This commit is contained in:
parent
c022d7be1d
commit
dd047002a1
@ -20,7 +20,7 @@ from six.moves import reload_module
|
|||||||
# imports - module imports
|
# imports - module imports
|
||||||
import bench
|
import bench
|
||||||
from bench.config.common_site_config import get_config
|
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
|
||||||
|
|
||||||
|
|
||||||
logging.basicConfig(level="INFO")
|
logging.basicConfig(level="INFO")
|
||||||
@ -173,7 +173,7 @@ def new_app(app, bench_path='.'):
|
|||||||
|
|
||||||
|
|
||||||
def install_app(app, bench_path=".", verbose=False, no_cache=False, postprocess=True, skip_assets=False):
|
def install_app(app, bench_path=".", verbose=False, no_cache=False, postprocess=True, skip_assets=False):
|
||||||
logger.info("installing {}".format(app))
|
print('\n{0}Installing {1}{2}'.format(color.yellow, app, color.nc))
|
||||||
|
|
||||||
pip_path = os.path.join(bench_path, "env", "bin", "pip")
|
pip_path = os.path.join(bench_path, "env", "bin", "pip")
|
||||||
quiet_flag = "-q" if not verbose else ""
|
quiet_flag = "-q" if not verbose else ""
|
||||||
|
@ -128,13 +128,17 @@ def setup_socketio():
|
|||||||
@click.option("--node", help="Update only Node packages", default=False, is_flag=True)
|
@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)
|
@click.option("--python", help="Update only Python packages", default=False, is_flag=True)
|
||||||
def setup_requirements(node=False, python=False):
|
def setup_requirements(node=False, python=False):
|
||||||
if not node:
|
if not (node or python):
|
||||||
from bench.utils import update_requirements as setup_python_packages
|
from bench.utils import update_requirements
|
||||||
setup_python_packages()
|
update_requirements()
|
||||||
|
|
||||||
if not python:
|
elif not node:
|
||||||
from bench.utils import update_node_packages as setup_node_packages
|
from bench.utils import update_python_packages
|
||||||
setup_node_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")
|
@click.command("manager", help="Setup bench-manager.local site with the bench_manager app installed on it")
|
||||||
|
@ -564,15 +564,26 @@ def update_env_pip(bench_path):
|
|||||||
|
|
||||||
def update_requirements(bench_path='.'):
|
def update_requirements(bench_path='.'):
|
||||||
from bench.app import get_apps, install_app
|
from bench.app import get_apps, install_app
|
||||||
print('Updating Python libraries...')
|
print('Installing applications...')
|
||||||
|
|
||||||
# update env pip
|
|
||||||
update_env_pip(bench_path)
|
update_env_pip(bench_path)
|
||||||
|
|
||||||
for app in get_apps():
|
for app in get_apps():
|
||||||
install_app(app, bench_path=bench_path, skip_assets=True)
|
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='.'):
|
def update_node_packages(bench_path='.'):
|
||||||
print('Updating node packages...')
|
print('Updating node packages...')
|
||||||
from bench.app import get_develop_version
|
from bench.app import get_develop_version
|
||||||
|
Loading…
Reference in New Issue
Block a user