mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-08-17 21:25:46 +02:00
fix(cli): cover every npm install lifecycle hook
npm runs prepublish, preprepare and postprepare on install too, so a project using one of those would have had its install layer split and the hook would run against a source tree that is not there yet.
This commit is contained in:
@@ -1162,8 +1162,16 @@ def _build_runtime_env_vars(config: Config) -> list[str]:
|
||||
return env_vars
|
||||
|
||||
|
||||
# These run as part of the install step, before the source would be copied.
|
||||
_NODE_INSTALL_HOOKS = ("preinstall", "install", "postinstall", "prepare")
|
||||
# npm runs all of these as part of an install, before the source would be copied.
|
||||
_NODE_INSTALL_HOOKS = (
|
||||
"preinstall",
|
||||
"install",
|
||||
"postinstall",
|
||||
"prepublish",
|
||||
"preprepare",
|
||||
"prepare",
|
||||
"postprepare",
|
||||
)
|
||||
|
||||
|
||||
def _splittable_node_manifests(
|
||||
|
||||
@@ -3531,7 +3531,16 @@ class TestNodeDependencyLayerOrdering:
|
||||
)
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"hook", ["preinstall", "install", "postinstall", "prepare"]
|
||||
"hook",
|
||||
[
|
||||
"preinstall",
|
||||
"install",
|
||||
"postinstall",
|
||||
"prepublish",
|
||||
"preprepare",
|
||||
"prepare",
|
||||
"postprepare",
|
||||
],
|
||||
)
|
||||
def test_install_hook_keeps_source_first(
|
||||
self, tmp_path: pathlib.Path, hook: str
|
||||
|
||||
Reference in New Issue
Block a user