mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-09-06 01:37:49 +02:00
adding tutorials to notebook checks (#1747)
* wip * actually catch errors * fixing tool-calling-errors and persistence-redis * poetry changes * poetry update * run tutorials * only tutorials (testing) * print errors * rewoo fixes * remove customer support because of user input * skip notebooks programatically * add back how-tos * remove redundant if * add cassetes for tutorials * remove no execution since it is generated by CI, * remove multi-agent/usaco * try to run in parallel * skip notebooks fix * remove magic/non-magic cells * msgpack instead of yaml * prepare_notebooks change * ignore msgpack for spelling * use compression for cassettes * update spell check * reset poetry changes * upgrade packages for latest * no update * poetry changes
This commit is contained in:
@@ -1,5 +1,32 @@
|
||||
for file in $(find docs/docs/how-tos -name "*.ipynb" | grep -v ".ipynb_checkpoints")
|
||||
do
|
||||
echo "Executing $file"
|
||||
poetry run jupyter execute "$file"
|
||||
done
|
||||
#!/bin/bash
|
||||
|
||||
# Read the list of notebooks to skip from the JSON file
|
||||
SKIP_NOTEBOOKS=$(python -c "import json; print('\n'.join(json.load(open('docs/notebooks_no_execution.json'))))")
|
||||
|
||||
# Function to execute a single notebook
|
||||
execute_notebook() {
|
||||
file="$1"
|
||||
echo "Starting execution of $file"
|
||||
start_time=$(date +%s)
|
||||
if ! output=$(time poetry run jupyter execute --allow-errors "$file" 2>&1); then
|
||||
end_time=$(date +%s)
|
||||
execution_time=$((end_time - start_time))
|
||||
echo "Error in $file. Execution time: $execution_time seconds"
|
||||
echo "Error details: $output"
|
||||
exit 1
|
||||
fi
|
||||
end_time=$(date +%s)
|
||||
execution_time=$((end_time - start_time))
|
||||
echo "Finished $file. Execution time: $execution_time seconds"
|
||||
}
|
||||
|
||||
export -f execute_notebook
|
||||
|
||||
# Find all notebooks and filter out those in the skip list
|
||||
notebooks=$(find docs/docs/tutorials docs/docs/how-tos -name "*.ipynb" | grep -v ".ipynb_checkpoints" | grep -vFf <(echo "$SKIP_NOTEBOOKS"))
|
||||
|
||||
# Run notebooks in parallel
|
||||
if ! parallel execute_notebook ::: $notebooks; then
|
||||
echo "Errors occurred during notebook execution"
|
||||
exit 1
|
||||
fi
|
||||
Reference in New Issue
Block a user