|
@@ -14,14 +14,23 @@ def run_procs(
|
|
|
repo: str,
|
|
|
reporoot: str,
|
|
|
venv_path: str,
|
|
|
- _procs: tuple[tuple[str, tuple[str, ...]], ...],
|
|
|
+ _procs: tuple[tuple[str, tuple[str, ...], dict[str, str]], ...],
|
|
|
) -> bool:
|
|
|
procs: list[tuple[str, tuple[str, ...], subprocess.Popen[bytes]]] = []
|
|
|
|
|
|
- for name, cmd in _procs:
|
|
|
+ for name, cmd, extra_env in _procs:
|
|
|
print(f"⏳ {name}")
|
|
|
if constants.DEBUG:
|
|
|
proc.xtrace(cmd)
|
|
|
+ env = {
|
|
|
+ **constants.user_environ,
|
|
|
+ **proc.base_env,
|
|
|
+ "VIRTUAL_ENV": venv_path,
|
|
|
+ "VOLTA_HOME": f"{reporoot}/.devenv/bin/volta-home",
|
|
|
+ "PATH": f"{venv_path}/bin:{reporoot}/.devenv/bin:{proc.base_path}",
|
|
|
+ }
|
|
|
+ if extra_env:
|
|
|
+ env = {**env, **extra_env}
|
|
|
procs.append(
|
|
|
(
|
|
|
name,
|
|
@@ -30,13 +39,7 @@ def run_procs(
|
|
|
cmd,
|
|
|
stdout=subprocess.PIPE,
|
|
|
stderr=subprocess.STDOUT,
|
|
|
- env={
|
|
|
- **constants.user_environ,
|
|
|
- **proc.base_env,
|
|
|
- "VIRTUAL_ENV": venv_path,
|
|
|
- "VOLTA_HOME": f"{reporoot}/.devenv/bin/volta-home",
|
|
|
- "PATH": f"{venv_path}/bin:{reporoot}/.devenv/bin:{proc.base_path}",
|
|
|
- },
|
|
|
+ env=env,
|
|
|
cwd=reporoot,
|
|
|
),
|
|
|
)
|
|
@@ -127,6 +130,7 @@ def main(context: dict[str, str]) -> int:
|
|
|
"requirements-dev-frozen.txt",
|
|
|
"pip",
|
|
|
),
|
|
|
+ {},
|
|
|
),
|
|
|
),
|
|
|
):
|
|
@@ -137,6 +141,21 @@ def main(context: dict[str, str]) -> int:
|
|
|
reporoot,
|
|
|
venv_dir,
|
|
|
(
|
|
|
+ (
|
|
|
+ # Spreading out the network load by installing js,
|
|
|
+ # then py in the next batch.
|
|
|
+ "javascript dependencies (1/1)",
|
|
|
+ (
|
|
|
+ "yarn",
|
|
|
+ "install",
|
|
|
+ "--frozen-lockfile",
|
|
|
+ "--no-progress",
|
|
|
+ "--non-interactive",
|
|
|
+ ),
|
|
|
+ {
|
|
|
+ "NODE_ENV": "development",
|
|
|
+ },
|
|
|
+ ),
|
|
|
(
|
|
|
"python dependencies (2/4)",
|
|
|
(
|
|
@@ -146,6 +165,7 @@ def main(context: dict[str, str]) -> int:
|
|
|
"djangorestframework-stubs",
|
|
|
"django-stubs",
|
|
|
),
|
|
|
+ {},
|
|
|
),
|
|
|
),
|
|
|
):
|
|
@@ -156,7 +176,6 @@ def main(context: dict[str, str]) -> int:
|
|
|
reporoot,
|
|
|
venv_dir,
|
|
|
(
|
|
|
- ("javascript dependencies", ("make", "install-js-dev")),
|
|
|
# could opt out of syncing python if FRONTEND_ONLY but only if repo-local devenv
|
|
|
# and pre-commit were moved to inside devenv and not the sentry venv
|
|
|
(
|
|
@@ -169,6 +188,7 @@ def main(context: dict[str, str]) -> int:
|
|
|
"-r",
|
|
|
"requirements-dev-frozen.txt",
|
|
|
),
|
|
|
+ {},
|
|
|
),
|
|
|
),
|
|
|
):
|
|
@@ -179,8 +199,12 @@ def main(context: dict[str, str]) -> int:
|
|
|
reporoot,
|
|
|
venv_dir,
|
|
|
(
|
|
|
- ("python dependencies (4/4)", ("python3", "-m", "tools.fast_editable", "--path", ".")),
|
|
|
- ("pre-commit dependencies", ("pre-commit", "install", "--install-hooks", "-f")),
|
|
|
+ (
|
|
|
+ "python dependencies (4/4)",
|
|
|
+ ("python3", "-m", "tools.fast_editable", "--path", "."),
|
|
|
+ {},
|
|
|
+ ),
|
|
|
+ ("pre-commit dependencies", ("pre-commit", "install", "--install-hooks", "-f"), {}),
|
|
|
),
|
|
|
):
|
|
|
return 1
|
|
@@ -219,6 +243,7 @@ def main(context: dict[str, str]) -> int:
|
|
|
(
|
|
|
"python migrations",
|
|
|
("make", "apply-migrations"),
|
|
|
+ {},
|
|
|
),
|
|
|
),
|
|
|
):
|