MCPcopy Index your code
hub / github.com/python/cpython / calculate_node_path

Function calculate_node_path

Platforms/emscripten/__main__.py:432–456  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

430
431
432def calculate_node_path():
433 node_version = os.environ.get("PYTHON_NODE_VERSION", None)
434 if node_version is None:
435 node_version = load_config_toml()["node-version"]
436
437 subprocess.run(
438 [
439 "bash",
440 "-c",
441 f"source ~/.nvm/nvm.sh && nvm install {node_version}",
442 ],
443 check=True,
444 )
445
446 res = subprocess.run(
447 [
448 "bash",
449 "-c",
450 f"source ~/.nvm/nvm.sh && nvm which {node_version}",
451 ],
452 text=True,
453 capture_output=True,
454 check=True,
455 )
456 return res.stdout.strip()
457
458
459@subdir("host_dir", clean_ok=True)

Callers 1

Calls 4

load_config_tomlFunction · 0.85
getMethod · 0.45
runMethod · 0.45
stripMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…