Skip to content

Commit 38efd31

Browse files
ericapisaniclaude
andauthored
build(test-langchain): Migrate to uv and pyproject.toml (#34)
Replace pip/requirements.txt with uv/pyproject.toml for dependency management. Update run scripts to use uv run instead of manual venv creation and pip install. Fixes PY-2461 Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 04aa2cf commit 38efd31

5 files changed

Lines changed: 28 additions & 34 deletions

File tree

test-langchain/pyproject.toml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[project]
2+
name = "test-langchain"
3+
version = "0"
4+
requires-python = ">=3.12"
5+
6+
dependencies = [
7+
"ipdb>=0.13.13",
8+
"langchain>=0.3.18",
9+
"langchain-anthropic>=0.3.12",
10+
"langchain-community>=0.3.17",
11+
"langchain-openai>=0.3.7",
12+
"sentry-sdk",
13+
]
14+
15+
[tool.uv.sources]
16+
sentry-sdk = { path = "../../sentry-python", editable = true }

test-langchain/requirements.txt

Lines changed: 0 additions & 8 deletions
This file was deleted.

test-langchain/run.sh

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
#!/usr/bin/env bash
2-
32
set -euo pipefail
4-
53
reset
64

7-
python3 -m venv .venv
8-
source .venv/bin/activate
9-
10-
pip install -r requirements.txt
5+
if ! command -v uv &> /dev/null; then
6+
curl -LsSf https://astral.sh/uv/install.sh | sh
7+
fi
118

12-
python3 main.py
9+
uv run python3 main.py

test-langchain/run_async.sh

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
#!/usr/bin/env bash
2-
32
set -euo pipefail
4-
53
reset
64

7-
python3 -m venv .venv
8-
source .venv/bin/activate
9-
10-
pip install -r requirements.txt
5+
if ! command -v uv &> /dev/null; then
6+
curl -LsSf https://astral.sh/uv/install.sh | sh
7+
fi
118

12-
python3 main_async.py
9+
uv run python3 main_async.py

test-langchain/run_tool.sh

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,9 @@
11
#!/usr/bin/env bash
2-
32
set -euo pipefail
4-
53
reset
64

7-
# Set up environment variables for API keys
8-
# export OPENAI_API_KEY="your-openai-key-here"
9-
# export ANTHROPIC_API_KEY="your-anthropic-key-here"
10-
# export SENTRY_DSN="your-sentry-dsn-here"
11-
12-
python3 -m venv .venv
13-
source .venv/bin/activate
14-
15-
pip install -r requirements.txt
5+
if ! command -v uv &> /dev/null; then
6+
curl -LsSf https://astral.sh/uv/install.sh | sh
7+
fi
168

17-
python3 main_tool.py
9+
uv run python3 main_tool.py

0 commit comments

Comments
 (0)