mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-04 04:28:58 +00:00
infra: migrate to uv (#29566)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#!/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'))))")
|
||||
SKIP_NOTEBOOKS=$(uv run python -c "import json; print('\n'.join(json.load(open('docs/notebooks_no_execution.json'))))")
|
||||
|
||||
# Get the working directory or specific notebook file from the input parameter
|
||||
WORKING_DIRECTORY=$1
|
||||
@@ -13,7 +13,7 @@ execute_notebook() {
|
||||
total="$3"
|
||||
echo "Starting execution of $file ($index/$total)"
|
||||
start_time=$(date +%s)
|
||||
if ! output=$(time poetry run jupyter nbconvert --to notebook --execute --ExecutePreprocessor.kernel_name=python3 $file 2>&1); then
|
||||
if ! output=$(time uv run --group dev --group test jupyter nbconvert --to notebook --execute --ExecutePreprocessor.kernel_name=python3 $file 2>&1); then
|
||||
end_time=$(date +%s)
|
||||
execution_time=$((end_time - start_time))
|
||||
echo "Error in $file. Execution time: $execution_time seconds"
|
||||
|
@@ -12,7 +12,7 @@
|
||||
# modifications should be discarded after the cassettes are generated.
|
||||
#
|
||||
# Usage:
|
||||
# In monorepo env, `poetry install --with dev,test`
|
||||
# In monorepo env, `uv sync --group dev --group test`
|
||||
# `./docs/scripts/update_cassettes.sh path/to/notebook`
|
||||
# e.g., `./docs/scripts/update_cassettes.sh docs/docs/how_to/tool_choice.ipynb`
|
||||
#
|
||||
@@ -41,11 +41,11 @@ delete_cassettes "$WORKING_DIRECTORY"
|
||||
|
||||
# Pre-download tiktoken files
|
||||
echo "Pre-downloading nltk and tiktoken files..."
|
||||
poetry run python docs/scripts/cache_data.py
|
||||
uv run python docs/scripts/cache_data.py
|
||||
|
||||
# Prepare notebooks
|
||||
echo "Preparing notebooks for CI..."
|
||||
poetry run python docs/scripts/prepare_notebooks_for_ci.py --comment-install-cells --working-directory "$WORKING_DIRECTORY"
|
||||
uv run python docs/scripts/prepare_notebooks_for_ci.py --comment-install-cells --working-directory "$WORKING_DIRECTORY"
|
||||
|
||||
# Run notebooks
|
||||
echo "Running notebooks..."
|
||||
|
Reference in New Issue
Block a user