Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
fbdfd8d
Add execution environments abstraction and toolset
dmontagu Feb 21, 2026
68b4036
Add environment_factory for per-run environment isolation
dmontagu Feb 21, 2026
c847585
Remove unused variable in doc example
dmontagu Feb 21, 2026
00be4ca
Fix type errors: use lists instead of sets for include/exclude args
dmontagu Feb 21, 2026
33604e6
Work around huggingface/vllm dependency conflict
dmontagu Feb 21, 2026
01a94c3
Address PR review feedback
dmontagu Feb 21, 2026
a735b73
Filter tools at runtime based on environment capabilities
dmontagu Feb 21, 2026
9001b1a
Add ToolName type, rename edit tool to edit_file, filter by tool names
dmontagu Feb 21, 2026
c66ea20
Rename Capability to EnvCapability, fix edit strategy fallback, fix g…
dmontagu Feb 21, 2026
9460ea5
Merge branch 'main' into execution-environments
dmontagu Feb 21, 2026
a7c70d6
Rename Capability to EnvCapability, improve _resolve_edit_tool fallback
dmontagu Feb 21, 2026
282819c
Unify EnvCapability + ToolName into single EnvToolName type
dmontagu Feb 22, 2026
b635b48
Move Docker shell builders to docker.py, fix grep on hidden files
dmontagu Feb 22, 2026
9e28bc1
Use extended regex (-E) in Docker grep for consistency with Local/Memory
dmontagu Feb 22, 2026
94d0329
Add tests for full coverage, add pragmas for defensive branches
dmontagu Feb 22, 2026
2b30c3a
Catch PermissionError/OSError in edit_file tool for ModelRetry
dmontagu Feb 22, 2026
3d8b3a6
Fix Docker read_file offset validation and image NotFound handling
dmontagu Feb 22, 2026
d8d3aba
Fix coverage
dmontagu Feb 22, 2026
598a8cf
Address feedback
dmontagu Feb 22, 2026
37e4d1f
Simplify docker coverage stuff
dmontagu Feb 22, 2026
b91be81
Use anyio.Lock
dmontagu Feb 22, 2026
8392293
Fix Docker glob missing root-level files for **/ patterns
dmontagu Feb 23, 2026
a539b4e
Add environment-specific tool descriptions (regex flavor docs for grep)
dmontagu Feb 23, 2026
e567e98
Use _shared_environment directly in shared lifecycle __aenter__
dmontagu Feb 23, 2026
df4fe1a
Add test for __aenter__ with no environment configured
dmontagu Feb 23, 2026
4e01113
Strip ./ prefix from Docker glob and grep output for consistency with…
dmontagu Feb 23, 2026
99ae9c9
Handle mid-pattern **/ in Docker glob to match zero directories
dmontagu Feb 23, 2026
32a0ce7
Remove unreachable guard in _globstar_zero_dir_variants to fix coverage
dmontagu Feb 23, 2026
561eeda
Address review feedback: testable doc examples, public files accessor…
dmontagu Feb 23, 2026
2ac4084
Make process classes and container property private, narrow exception…
dmontagu Feb 24, 2026
caad429
glob fix
adtyavrdhn Feb 24, 2026
49ba0d6
glob fix
adtyavrdhn Feb 24, 2026
1bd7d31
glob fix
adtyavrdhn Feb 24, 2026
672a80d
cov
adtyavrdhn Feb 26, 2026
02d363f
Merge branch 'main' of github.com:pydantic/pydantic-ai into execution…
adtyavrdhn Feb 26, 2026
9cf206a
adding for cov
adtyavrdhn Feb 27, 2026
c55a0df
adding for cov
adtyavrdhn Feb 27, 2026
2386886
glob removing, need to ensure tests removal for now
adtyavrdhn Feb 27, 2026
802161f
glob removing, need to ensure tests removal for now
adtyavrdhn Feb 27, 2026
ef04316
removing ls and grep
adtyavrdhn Feb 27, 2026
dbbc126
lint
adtyavrdhn Feb 27, 2026
29ff88c
non blocking writes / reads
adtyavrdhn Feb 27, 2026
3623284
addressing issues with open sockets
adtyavrdhn Feb 27, 2026
e423283
cov
adtyavrdhn Feb 27, 2026
114ac84
cov
adtyavrdhn Feb 27, 2026
26ba4e8
docker fix timeout 0 unintentional
adtyavrdhn Feb 27, 2026
e52ae45
merge this shit
adtyavrdhn Feb 27, 2026
529b0e0
coverage for timeouts
adtyavrdhn Feb 27, 2026
46c57bf
removing truncation? We don't need it in the execution env
adtyavrdhn Feb 27, 2026
bff3271
removing truncation tests
adtyavrdhn Feb 27, 2026
0d2b2e9
removing truncation tests
adtyavrdhn Feb 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
cache-suffix: lint

- name: Install dependencies
run: uv sync --all-extras --all-packages --group lint
run: uv sync --all-extras --no-extra outlines-vllm-offline --all-packages --group lint

- uses: pre-commit/action@v3.0.0
with:
Expand Down Expand Up @@ -113,7 +113,7 @@ jobs:
- name: standard
command: ""
- name: all-extras
command: "--all-extras"
command: "--all-extras --no-extra outlines-vllm-offline"
env:
CI: true
COVERAGE_PROCESS_START: ./pyproject.toml
Expand Down Expand Up @@ -194,7 +194,7 @@ jobs:

- run: unset UV_FROZEN

- run: uv run --all-extras --resolution lowest-direct coverage run -m pytest --durations=100 -n auto --dist=loadgroup
- run: uv run --all-extras --no-extra outlines-vllm-offline --resolution lowest-direct coverage run -m pytest --durations=100 -n auto --dist=loadgroup
env:
COVERAGE_FILE: .coverage/.coverage.${{matrix.python-version}}-lowest-versions

Expand Down Expand Up @@ -232,7 +232,7 @@ jobs:
restore-keys: |
hf-${{ runner.os }}-

- run: uv run --all-extras python tests/import_examples.py
- run: uv run --all-extras --no-extra outlines-vllm-offline python tests/import_examples.py

coverage:
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ __pycache__
/scratch/
/.coverage
env*/
!**/environments/
/TODO.md
/postgres-data/
.DS_Store
Expand Down
20 changes: 10 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@

.PHONY: install
install: .uv .pre-commit ## Install the package, dependencies, and pre-commit for local development
uv sync --frozen --all-extras --all-packages --group lint --group docs
uv sync --frozen --all-extras --no-extra outlines-vllm-offline --all-packages --group lint --group docs
pre-commit install --install-hooks

.PHONY: install-all-python
install-all-python: ## Install and synchronize an interpreter for every python version
UV_PROJECT_ENVIRONMENT=.venv310 uv sync --python 3.10 --frozen --all-extras --all-packages --group lint --group docs
UV_PROJECT_ENVIRONMENT=.venv311 uv sync --python 3.11 --frozen --all-extras --all-packages --group lint --group docs
UV_PROJECT_ENVIRONMENT=.venv312 uv sync --python 3.12 --frozen --all-extras --all-packages --group lint --group docs
UV_PROJECT_ENVIRONMENT=.venv313 uv sync --python 3.13 --frozen --all-extras --all-packages --group lint --group docs
UV_PROJECT_ENVIRONMENT=.venv310 uv sync --python 3.10 --frozen --all-extras --no-extra outlines-vllm-offline --all-packages --group lint --group docs
UV_PROJECT_ENVIRONMENT=.venv311 uv sync --python 3.11 --frozen --all-extras --no-extra outlines-vllm-offline --all-packages --group lint --group docs
UV_PROJECT_ENVIRONMENT=.venv312 uv sync --python 3.12 --frozen --all-extras --no-extra outlines-vllm-offline --all-packages --group lint --group docs
UV_PROJECT_ENVIRONMENT=.venv313 uv sync --python 3.13 --frozen --all-extras --no-extra outlines-vllm-offline --all-packages --group lint --group docs

.PHONY: sync
sync: .uv ## Update local packages and uv.lock
uv sync --all-extras --all-packages --group lint --group docs
uv sync --all-extras --no-extra outlines-vllm-offline --all-packages --group lint --group docs

.PHONY: format
format: ## Format the code
Expand Down Expand Up @@ -57,10 +57,10 @@ test: ## Run tests without coverage (fast, for local dev)

.PHONY: test-all-python
test-all-python: ## Run tests on Python 3.10 to 3.13
COLUMNS=150 UV_PROJECT_ENVIRONMENT=.venv310 uv run --python 3.10 --all-extras --all-packages coverage run -p -m pytest
COLUMNS=150 UV_PROJECT_ENVIRONMENT=.venv311 uv run --python 3.11 --all-extras --all-packages coverage run -p -m pytest
COLUMNS=150 UV_PROJECT_ENVIRONMENT=.venv312 uv run --python 3.12 --all-extras --all-packages coverage run -p -m pytest
COLUMNS=150 UV_PROJECT_ENVIRONMENT=.venv313 uv run --python 3.13 --all-extras --all-packages coverage run -p -m pytest
COLUMNS=150 UV_PROJECT_ENVIRONMENT=.venv310 uv run --python 3.10 --all-extras --no-extra outlines-vllm-offline --all-packages coverage run -p -m pytest
COLUMNS=150 UV_PROJECT_ENVIRONMENT=.venv311 uv run --python 3.11 --all-extras --no-extra outlines-vllm-offline --all-packages coverage run -p -m pytest
COLUMNS=150 UV_PROJECT_ENVIRONMENT=.venv312 uv run --python 3.12 --all-extras --no-extra outlines-vllm-offline --all-packages coverage run -p -m pytest
COLUMNS=150 UV_PROJECT_ENVIRONMENT=.venv313 uv run --python 3.13 --all-extras --no-extra outlines-vllm-offline --all-packages coverage run -p -m pytest
@uv run coverage combine
@uv run coverage report

Expand Down
31 changes: 31 additions & 0 deletions docs/api/environments.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# `pydantic_ai.environments`

::: pydantic_ai.environments
options:
members:
- EnvToolName
- ExecutionEnvironment
- ExecutionEnvironmentToolset
- ExecutionProcess
- ExecutionResult

## `pydantic_ai.environments.local`

::: pydantic_ai.environments.local
options:
members:
- LocalEnvironment

## `pydantic_ai.environments.docker`

::: pydantic_ai.environments.docker
options:
members:
- DockerEnvironment

## `pydantic_ai.environments.memory`

::: pydantic_ai.environments.memory
options:
members:
- MemoryEnvironment
Loading