|
| 1 | +# SETUP.MD |
| 2 | + |
| 3 | +This file documents how to provision a clean development environment for the five packages in this repo (`uipath-agent-framework`, `uipath-google-adk`, `uipath-llamaindex`, `uipath-openai-agents`, `uipath-pydantic-ai`), run the build, execute the tests, and validate a sample code change end-to-end. It is intended both as a quick reference for human contributors and as a structured guide for automated environment-setup tooling. |
| 4 | + |
| 5 | +## Prerequisites |
| 6 | + |
| 7 | +- Python 3.11+ |
| 8 | +- [uv](https://docs.astral.sh/uv/) 0.5+ |
| 9 | + |
| 10 | +### Supported platforms |
| 11 | + |
| 12 | +`uv` is shell- and OS-agnostic, so the commands below run unchanged on every supported platform: |
| 13 | + |
| 14 | +- [x] Linux |
| 15 | +- [x] Windows |
| 16 | +- [x] macOS |
| 17 | + |
| 18 | +## Environment Variables |
| 19 | + |
| 20 | +None required for environment setup, build, or unit tests. The suites under the `Test` section run fully offline and require no external authentication. |
| 21 | + |
| 22 | +> **All commands below must be run from the repository root.** The `uv --directory packages/<name>` invocations resolve each subpackage relative to the current working directory. The first line of `## Setup` enforces this by `cd`-ing to the git root. |
| 23 | +
|
| 24 | +## Setup |
| 25 | + |
| 26 | +```bash |
| 27 | +cd "$(git rev-parse --show-toplevel)" |
| 28 | +python3 -m pip install --upgrade uv |
| 29 | + |
| 30 | +# Sync all five packages (each is independent) |
| 31 | +uv --directory packages/uipath-agent-framework sync --all-extras |
| 32 | +uv --directory packages/uipath-google-adk sync --all-extras |
| 33 | +uv --directory packages/uipath-llamaindex sync --all-extras |
| 34 | +uv --directory packages/uipath-openai-agents sync --all-extras |
| 35 | +uv --directory packages/uipath-pydantic-ai sync --all-extras |
| 36 | +``` |
| 37 | + |
| 38 | +## Verify Setup |
| 39 | + |
| 40 | +```bash |
| 41 | +uv --version |
| 42 | +uv --directory packages/uipath-pydantic-ai run python --version |
| 43 | +uv --directory packages/uipath-agent-framework run python -c "import uipath_agent_framework; print('uipath-agent-framework ok')" |
| 44 | +uv --directory packages/uipath-google-adk run python -c "import uipath_google_adk; print('uipath-google-adk ok')" |
| 45 | +uv --directory packages/uipath-llamaindex run python -c "import uipath_llamaindex; print('uipath-llamaindex ok')" |
| 46 | +uv --directory packages/uipath-openai-agents run python -c "import uipath_openai_agents; print('uipath-openai-agents ok')" |
| 47 | +uv --directory packages/uipath-pydantic-ai run python -c "import uipath_pydantic_ai; print('uipath-pydantic-ai ok')" |
| 48 | +``` |
| 49 | + |
| 50 | +## Build |
| 51 | + |
| 52 | +N/A |
| 53 | + |
| 54 | +## Test |
| 55 | + |
| 56 | +```bash |
| 57 | +uv --directory packages/uipath-agent-framework run pytest |
| 58 | +uv --directory packages/uipath-google-adk run pytest |
| 59 | +uv --directory packages/uipath-llamaindex run pytest |
| 60 | +uv --directory packages/uipath-openai-agents run pytest |
| 61 | +uv --directory packages/uipath-pydantic-ai run pytest |
| 62 | +``` |
| 63 | + |
| 64 | +## Sample Code Change |
| 65 | + |
| 66 | +### The change |
| 67 | + |
| 68 | +Add a new `agent_count` property to `PydanticAiConfig` in `packages/uipath-pydantic-ai/src/uipath_pydantic_ai/runtime/config.py`, immediately after the existing `entrypoint` property: |
| 69 | + |
| 70 | +```python |
| 71 | +@property |
| 72 | +def agent_count(self) -> int: |
| 73 | + """Number of agents defined in the configuration.""" |
| 74 | + return len(self.agents) |
| 75 | +``` |
| 76 | + |
| 77 | +Then create `packages/uipath-pydantic-ai/tests/test_config_agent_count.py` with two pytest tests: |
| 78 | + |
| 79 | +```python |
| 80 | +"""Tests for PydanticAiConfig.agent_count.""" |
| 81 | + |
| 82 | +import json |
| 83 | +from pathlib import Path |
| 84 | + |
| 85 | +from uipath_pydantic_ai.runtime.config import PydanticAiConfig |
| 86 | + |
| 87 | + |
| 88 | +def test_agent_count_single(tmp_path: Path) -> None: |
| 89 | + config_path = tmp_path / "pydantic_ai.json" |
| 90 | + config_path.write_text(json.dumps({"agents": {"main": "main:agent"}})) |
| 91 | + cfg = PydanticAiConfig(str(config_path)) |
| 92 | + assert cfg.agent_count == 1 |
| 93 | + |
| 94 | + |
| 95 | +def test_agent_count_multiple(tmp_path: Path) -> None: |
| 96 | + config_path = tmp_path / "pydantic_ai.json" |
| 97 | + config_path.write_text( |
| 98 | + json.dumps( |
| 99 | + { |
| 100 | + "agents": { |
| 101 | + "alpha": "alpha:agent", |
| 102 | + "beta": "beta:agent", |
| 103 | + "gamma": "gamma:agent", |
| 104 | + } |
| 105 | + } |
| 106 | + ) |
| 107 | + ) |
| 108 | + cfg = PydanticAiConfig(str(config_path)) |
| 109 | + assert cfg.agent_count == 3 |
| 110 | +``` |
| 111 | + |
| 112 | +### Verification |
| 113 | + |
| 114 | +```bash |
| 115 | +uv --directory packages/uipath-pydantic-ai run pytest tests/test_config_agent_count.py -v |
| 116 | +``` |
| 117 | + |
| 118 | +## Test with a real UiPath Coded Agent |
| 119 | + |
| 120 | +The unit tests above are necessary but not sufficient — they don't exercise the package end-to-end through a real agent. The flow below validates changes against a live runtime: |
| 121 | + |
| 122 | +1. Apply the code changes locally. |
| 123 | +2. Run the unit tests (see the `Sample Code Change` section above). |
| 124 | +3. Scaffold a coded UiPath agent (PydanticAI / OpenAI / Google ADK / LlamaIndex / Agent Framework, matching the package you changed) that exercises the changed code path. |
| 125 | +4. In the downstream project's `pyproject.toml`, add this local library as an editable dependency (substitute the package you changed): |
| 126 | + |
| 127 | + ```toml |
| 128 | + [tool.uv.sources] |
| 129 | + uipath-pydantic-ai = { path = "../path/to/uipath-integrations-python/packages/uipath-pydantic-ai", editable = true } |
| 130 | + ``` |
| 131 | + |
| 132 | +5. Exercise the new behavior end-to-end: |
| 133 | + |
| 134 | + ```bash |
| 135 | + uv run uipath run <agent-name> --input '{...}' |
| 136 | + ``` |
| 137 | + |
| 138 | +6. (Optional) Open a PR and apply the `build:dev` label — this publishes the development version to Test PyPI. |
| 139 | +7. The PR description is updated automatically with instructions for pointing the downstream agent at the Test PyPI dev version. |
| 140 | +8. Push the dev version to UiPath with [`uipath push`](https://uipath.github.io/uipath-python/cli/#push), then deploy it to Orchestrator or Studio Web with [`uipath deploy`](https://uipath.github.io/uipath-python/cli/#deploy), and run it in cloud to confirm the changes behave correctly against the real platform. |
| 141 | +9. Once validation is done, close the dev PR — these PRs are not meant to be merged; their only purpose was to publish a Test PyPI build for end-to-end validation. |
0 commit comments