Creates a clean venv with only core ADK installed (requires network).
(tmp_path_factory)
| 37 | |
| 38 | @pytest.fixture(scope="session") |
| 39 | def clean_core_venv(tmp_path_factory): |
| 40 | """Creates a clean venv with only core ADK installed (requires network).""" |
| 41 | if not RUN_INTEGRATION: |
| 42 | pytest.skip("Integration tests requiring network are disabled by default.") |
| 43 | |
| 44 | venv_path = tmp_path_factory.mktemp("adk_core_venv") |
| 45 | python_exe = venv_path / "bin" / "python" |
| 46 | |
| 47 | # Create venv using uv for speed |
| 48 | subprocess.run( |
| 49 | ["uv", "venv", str(venv_path), "--python", "3.11"], |
| 50 | check=True, |
| 51 | capture_output=True, |
| 52 | ) |
| 53 | |
| 54 | # Install core ADK from local repo (uses current pyproject.toml) |
| 55 | subprocess.run( |
| 56 | ["uv", "pip", "install", "--python", str(python_exe), str(_REPO_ROOT)], |
| 57 | check=True, |
| 58 | capture_output=True, |
| 59 | ) |
| 60 | |
| 61 | return python_exe |
| 62 | |
| 63 | |
| 64 | # ============================================================================= |