install: adjustments to better support specifying an alternative python for install using PYTHON env variable
This commit is contained in:
parent
33f3eccdcf
commit
5f1e722331
1 changed files with 8 additions and 1 deletions
9
tasks.py
9
tasks.py
|
@ -110,6 +110,10 @@ class OsInfo:
|
||||||
return OsInfo(os_name, os_like, version)
|
return OsInfo(os_name, os_like, version)
|
||||||
|
|
||||||
|
|
||||||
|
def get_env_python() -> str:
|
||||||
|
return os.environ.get("PYTHON", "python3")
|
||||||
|
|
||||||
|
|
||||||
def get_python(c: Context, warn: bool = False) -> str:
|
def get_python(c: Context, warn: bool = False) -> str:
|
||||||
with c.cd(DAEMON_DIR):
|
with c.cd(DAEMON_DIR):
|
||||||
r = c.run("poetry env info -p", warn=warn, hide=True)
|
r = c.run("poetry env info -p", warn=warn, hide=True)
|
||||||
|
@ -180,8 +184,9 @@ def install_system(c: Context, os_info: OsInfo, hide: bool) -> None:
|
||||||
|
|
||||||
|
|
||||||
def install_grpcio(c: Context, hide: bool) -> None:
|
def install_grpcio(c: Context, hide: bool) -> None:
|
||||||
|
python_bin = get_env_python()
|
||||||
c.run(
|
c.run(
|
||||||
"python3 -m pip install --user grpcio==1.27.2 grpcio-tools==1.27.2",
|
f"{python_bin} -m pip install --user grpcio==1.27.2 grpcio-tools==1.27.2",
|
||||||
hide=hide,
|
hide=hide,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -204,6 +209,8 @@ def install_poetry(c: Context, dev: bool, local: bool, hide: bool) -> None:
|
||||||
else:
|
else:
|
||||||
args = "" if dev else "--no-dev"
|
args = "" if dev else "--no-dev"
|
||||||
with c.cd(DAEMON_DIR):
|
with c.cd(DAEMON_DIR):
|
||||||
|
python_bin = get_env_python()
|
||||||
|
c.run(f"poetry env use {python_bin}", hide=hide)
|
||||||
c.run(f"poetry install {args}", hide=hide)
|
c.run(f"poetry install {args}", hide=hide)
|
||||||
if dev:
|
if dev:
|
||||||
c.run("poetry run pre-commit install", hide=hide)
|
c.run("poetry run pre-commit install", hide=hide)
|
||||||
|
|
Loading…
Reference in a new issue