Skip to content

Commit 0eed8f8

Browse files
chaliyclaude
andauthored
docs(examples): use bashkit from PyPI instead of local build (#190)
## Summary - Examples now declare `bashkit` as a PEP 723 inline dependency so `uv run` installs pre-built wheels from PyPI automatically - Removed `maturin develop` prerequisite and try/except ImportError guards - Updated README noting zero-setup experience (no Rust toolchain needed) ## Test plan - [x] `uv run examples/treasure_hunt_agent.py` — confirmed uv downloads 2.6 MiB pre-built wheel, no compilation - [x] `uv run examples/deepagent_coding_agent.py` — same, 53 packages installed in ~1s Co-authored-by: Claude <noreply@anthropic.com>
1 parent 35a36da commit 0eed8f8

3 files changed

Lines changed: 11 additions & 14 deletions

File tree

examples/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Bashkit Examples
22

3+
All examples use [PEP 723](https://peps.python.org/pep-0723/) inline script metadata.
4+
`uv run` resolves dependencies automatically — bashkit installs from PyPI as a pre-built wheel (no Rust toolchain needed).
5+
36
## treasure_hunt_agent.py
47

58
LangChain agent with Bashkit sandbox.

examples/deepagent_coding_agent.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,18 @@
22
# /// script
33
# requires-python = ">=3.11"
44
# dependencies = [
5-
# "deepagents>=0.3.11",
5+
# "bashkit[deepagents]>=0.1.4",
66
# "langchain-anthropic>=0.3",
77
# ]
88
# ///
9-
# Note: Install bashkit first: cd crates/bashkit-python && maturin develop
109
"""
1110
Deep Agent with Bashkit Virtual Filesystem
1211
1312
Run:
1413
export ANTHROPIC_API_KEY=your_key
1514
uv run examples/deepagent_coding_agent.py
15+
16+
uv automatically installs bashkit from PyPI (pre-built wheels, no Rust needed).
1617
"""
1718

1819
import asyncio
@@ -21,11 +22,7 @@
2122

2223
from deepagents import create_deep_agent
2324

24-
try:
25-
from bashkit.deepagents import BashkitBackend
26-
except ImportError:
27-
print("bashkit not found. Install: cd crates/bashkit-python && maturin develop")
28-
sys.exit(1)
25+
from bashkit.deepagents import BashkitBackend
2926

3027

3128
SYSTEM_PROMPT = """You are a coding assistant with a sandboxed bash environment.

examples/treasure_hunt_agent.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
# /// script
33
# requires-python = ">=3.10"
44
# dependencies = [
5+
# "bashkit[langchain]>=0.1.4",
56
# "langchain>=1.0",
67
# "langchain-anthropic>=0.3",
78
# ]
89
# ///
9-
# Note: Install bashkit first: cd crates/bashkit-python && maturin develop
1010
"""
1111
Treasure Hunt Agent - A fun demonstration of LangChain + Bashkit
1212
@@ -24,6 +24,8 @@
2424
Run with:
2525
export ANTHROPIC_API_KEY=your_key
2626
uv run examples/treasure_hunt_agent.py
27+
28+
uv automatically installs bashkit from PyPI (pre-built wheels, no Rust needed).
2729
"""
2830

2931
import asyncio
@@ -32,12 +34,7 @@
3234

3335
from langchain.agents import create_agent
3436

35-
# Try to import from installed package
36-
try:
37-
from bashkit.langchain import create_bash_tool
38-
except ImportError:
39-
print("bashkit not found. Install with: cd crates/bashkit-python && maturin develop")
40-
sys.exit(1)
37+
from bashkit.langchain import create_bash_tool
4138

4239

4340
# The treasure hunt setup script - creates clues in the virtual filesystem

0 commit comments

Comments
 (0)