mirror of
https://github.com/frappe/bench.git
synced 2025-01-09 08:30:39 +00:00
fix: Pass cwd for cmd subprocess execution
Also, use python instead of python3 hardcoded in env
This commit is contained in:
parent
bff9dfd004
commit
01b77598ff
@ -71,7 +71,7 @@ class Bench(Base, Validator):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def python(self) -> str:
|
def python(self) -> str:
|
||||||
return get_env_cmd("python3", bench_path=self.name)
|
return get_env_cmd("python", bench_path=self.name)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def shallow_clone(self) -> bool:
|
def shallow_clone(self) -> bool:
|
||||||
@ -352,15 +352,18 @@ class BenchSetup(Base):
|
|||||||
|
|
||||||
if not os.path.exists(self.bench.python):
|
if not os.path.exists(self.bench.python):
|
||||||
if virtualenv:
|
if virtualenv:
|
||||||
self.run(f"{virtualenv} {quiet_flag} env -p {python}")
|
self.run(f"{virtualenv} {quiet_flag} env -p {python}", cwd=self.bench.name)
|
||||||
else:
|
else:
|
||||||
venv = get_venv_path(verbose=verbose, python=python)
|
venv = get_venv_path(verbose=verbose, python=python)
|
||||||
self.run(f"{venv} env")
|
self.run(f"{venv} env", cwd=self.bench.name)
|
||||||
|
|
||||||
self.pip()
|
self.pip()
|
||||||
|
|
||||||
if os.path.exists(frappe):
|
if os.path.exists(frappe):
|
||||||
self.run(f"{self.bench.python} -m pip install {quiet_flag} --upgrade -e {frappe}")
|
self.run(
|
||||||
|
f"{self.bench.python} -m pip install {quiet_flag} --upgrade -e {frappe}",
|
||||||
|
cwd=self.bench.name,
|
||||||
|
)
|
||||||
|
|
||||||
@step(title="Setting Up Bench Config", success="Bench Config Set Up")
|
@step(title="Setting Up Bench Config", success="Bench Config Set Up")
|
||||||
def config(self, redis=True, procfile=True):
|
def config(self, redis=True, procfile=True):
|
||||||
@ -388,7 +391,9 @@ class BenchSetup(Base):
|
|||||||
verbose = bench.cli.verbose or verbose
|
verbose = bench.cli.verbose or verbose
|
||||||
quiet_flag = "" if verbose else "--quiet"
|
quiet_flag = "" if verbose else "--quiet"
|
||||||
|
|
||||||
return self.run(f"{self.bench.python} -m pip install {quiet_flag} --upgrade pip")
|
return self.run(
|
||||||
|
f"{self.bench.python} -m pip install {quiet_flag} --upgrade pip", cwd=self.bench.name
|
||||||
|
)
|
||||||
|
|
||||||
def logging(self):
|
def logging(self):
|
||||||
from bench.utils import setup_logging
|
from bench.utils import setup_logging
|
||||||
|
Loading…
Reference in New Issue
Block a user