Skip to content

Commit

Permalink
(WIP) fixes for autobuild on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
brentyi committed Mar 23, 2024
1 parent b0ed961 commit dfe9504
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ dependencies = [
"numpy>=1.0.0",
"msgpack>=1.0.7",
"imageio>=2.0.0",
"pyliblzfse>=0.4.1",
"pyliblzfse>=0.4.1; platform_system!='Windows'",
"scikit-image>=0.18.0",
"scipy>=1.7.3",
"tqdm>=4.0.0",
Expand Down
26 changes: 13 additions & 13 deletions src/viser/_client_autobuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,20 @@ def ensure_client_is_built() -> None:
node_exec_dir = _install_sandboxed_node()
npx_path = node_exec_dir / "npx"


import os
subprocess_env = os.environ.copy()
subprocess_env["NODE_VIRTUAL_ENV"] = str(node_exec_dir.parent)
subprocess_env["PATH"] = str(node_exec_dir) + ";" + subprocess_env["PATH"]
subprocess.run(
args=(
"bash -c '"
f"source {node_exec_dir / 'activate'};"
f"{npx_path} yarn install;"
f"{npx_path} yarn run build;"
"'"
),
args=f"{npx_path} --yes yarn install",
env=subprocess_env,
cwd=client_dir,
shell=True,
check=False,
)
subprocess.run(
args=f"{npx_path} --yes yarn run build",
env=subprocess_env,
cwd=client_dir,
shell=True,
check=False,
Expand All @@ -92,11 +97,6 @@ def _install_sandboxed_node() -> Path:
subprocess.run(
[sys.executable, "-m", "nodeenv", "--node=20.4.0", env_dir], check=False
)
subprocess.run(
args=[node_exec_dir / "npm", "install", "yarn"],
input="y\n".encode(),
check=False,
)
assert (node_exec_dir / "npx").exists()
return node_exec_dir

Expand Down

0 comments on commit dfe9504

Please sign in to comment.