diff --git a/.github/workflows/nightly-test.yml b/.github/workflows/nightly-test.yml index 2816c92..fd10e8a 100644 --- a/.github/workflows/nightly-test.yml +++ b/.github/workflows/nightly-test.yml @@ -32,7 +32,7 @@ jobs: [[ -z "$skip_nb" || "$skip_nb" =~ ^# ]] && continue IGNORE_LIST+=("$skip_nb") done < .github/ignore-notebooks.txt - + # 3) Filter out notebooks that match anything in IGNORE_LIST FILTERED_NBS=() for nb in $NBS; do @@ -47,16 +47,16 @@ jobs: FILTERED_NBS+=("$nb") fi done - + # 4) Stuff into a single-line JSON array NB_JSON=$(printf '%s\n' "${FILTERED_NBS[@]}" \ | jq -R . \ | jq -s -c .) - + if [ -z "$NB_JSON" ] || [ "$NB_JSON" = "[]" ]; then NB_JSON="[]" fi - + echo "All valid notebooks: $NB_JSON" # 5) Check if there's anything in FILTERED_NBS @@ -65,7 +65,7 @@ jobs: else echo "has_notebooks=false" >> $GITHUB_OUTPUT fi - + echo "notebooks=$NB_JSON" >> $GITHUB_OUTPUT # --------------------------------------------------------- @@ -99,7 +99,7 @@ jobs: python -m venv venv source venv/bin/activate pip install --upgrade pip setuptools wheel - pip install pytest nbval + pip install --no-cache-dir pytest nbval - name: Test notebook env: @@ -108,4 +108,4 @@ jobs: run: | echo "Testing notebook: ${{ matrix.notebook }}" source venv/bin/activate - pytest --nbval-lax --disable-warnings "${{ matrix.notebook }}" + pytest --nbval-lax --nbval-cell-timeout=300 --disable-warnings "${{ matrix.notebook }}" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 17af1c4..8d2da34 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -27,7 +27,7 @@ jobs: # 1) Compare this commit/PR to 'main' and list changed notebooks git fetch --depth=1 origin main CHANGED_NOTEBOOKS=$(git diff --name-only origin/main | grep '\.ipynb$' || true) - + # 2) Load notebooks to ignore IGNORE_LIST=() while IFS= read -r skip_nb || [ -n "$skip_nb" ]; do @@ -35,7 +35,7 @@ jobs: [[ -z "$skip_nb" || "$skip_nb" =~ ^# ]] && continue IGNORE_LIST+=("$skip_nb") done < .github/ignore-notebooks.txt - + # 3) Filter out ignored notebooks FILTERED_NBS=() for nb in $CHANGED_NOTEBOOKS; do @@ -52,16 +52,16 @@ jobs: FILTERED_NBS+=("$nb") fi done - + # 4) Stuff into a single-line JSON array NB_JSON=$(printf '%s\n' "${FILTERED_NBS[@]}" \ | jq -R . \ | jq -s -c .) - + if [ -z "$NB_JSON" ] || [ "$NB_JSON" = "[]" ]; then NB_JSON="[]" fi - + echo "All valid notebooks: $NB_JSON" # 5) Check if there's anything in FILTERED_NBS @@ -104,7 +104,7 @@ jobs: python -m venv venv source venv/bin/activate pip install --upgrade pip setuptools wheel - pip install pytest nbval + pip install --no-cache-dir pytest nbval - name: Test notebook env: @@ -113,4 +113,4 @@ jobs: run: | echo "Testing notebook: ${{ matrix.notebook }}" source venv/bin/activate - pytest --nbval-lax --disable-warnings "${{ matrix.notebook }}" + pytest --nbval-lax --nbval-cell-timeout=300 --disable-warnings "${{ matrix.notebook }}" diff --git a/python-recipes/agents/00_langgraph_redis_agentic_rag.ipynb b/python-recipes/agents/00_langgraph_redis_agentic_rag.ipynb index f00a37e..58f5fe8 100644 --- a/python-recipes/agents/00_langgraph_redis_agentic_rag.ipynb +++ b/python-recipes/agents/00_langgraph_redis_agentic_rag.ipynb @@ -38,14 +38,14 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "id": "969fb438", "metadata": { "id": "969fb438" }, "outputs": [], "source": [ - "%pip install -q langchain-community tiktoken langchain-openai langchainhub \"langchain-redis>=0.2.0\" langchain langgraph langchain-text-splitters bs4" + "%pip install -q --upgrade --force-reinstall langchain-community tiktoken langchain-openai langchainhub \"langchain-redis>=0.2.0\" langchain \"langgraph>0.3.1\" langchain-text-splitters bs4" ] }, { @@ -666,7 +666,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.9" + "version": "3.13.1" } }, "nbformat": 4, diff --git a/python-recipes/agents/02_full_featured_agent.ipynb b/python-recipes/agents/02_full_featured_agent.ipynb index cb1ad60..cfd9d3d 100644 --- a/python-recipes/agents/02_full_featured_agent.ipynb +++ b/python-recipes/agents/02_full_featured_agent.ipynb @@ -30,13 +30,13 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "metadata": { "id": "Zz62U5COgF21" }, "outputs": [], "source": [ - "%pip install -q langchain langchain-openai \"langchain-redis>=0.2.0\" langgraph sentence-transformers" + "%pip install -q --upgrade --force-reinstall langchain langchain-openai \"langchain-redis>=0.2.0\" \"langgraph>0.3.1\" sentence-transformers" ] }, { @@ -969,7 +969,7 @@ }, { "cell_type": "code", - "execution_count": 54, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -985,7 +985,7 @@ " if cache_hit:\n", " print(\"Cache hit - short circuit\")\n", " return cache_hit\n", - " \n", + "\n", " return graph.invoke({\"messages\": question})\n" ] }