Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
63 changes: 63 additions & 0 deletions .github/workflows/lint-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,69 @@ jobs:
working-directory: packages/uipath-agent-framework
run: uv run ruff format --check .

lint-claude-sdk:
name: Lint uipath-claude-sdk
needs: detect-changed-packages
runs-on: uipath-ubuntu-latest
steps:
- name: Check if package changed
id: check
run: |
if [[ "${{ contains(github.event.pull_request.labels.*.name, 'test-core-dev-version') }}" == "true" ]]; then
echo "skip=true" >> $GITHUB_OUTPUT
echo "reason=custom-version-testing" >> $GITHUB_OUTPUT
elif echo '${{ needs.detect-changed-packages.outputs.packages }}' | jq -e 'index("uipath-claude-sdk")' > /dev/null; then
echo "skip=false" >> $GITHUB_OUTPUT
else
echo "skip=true" >> $GITHUB_OUTPUT
echo "reason=no-changes" >> $GITHUB_OUTPUT
fi

- name: Skip
if: steps.check.outputs.skip == 'true'
run: |
if [[ "${{ steps.check.outputs.reason }}" == "custom-version-testing" ]]; then
echo "Skipping - custom version testing enabled"
else
echo "Skipping - no changes to uipath-claude-sdk"
fi

- name: Checkout
if: steps.check.outputs.skip != 'true'
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0

- name: Setup uv
if: steps.check.outputs.skip != 'true'
uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5.4.2
with:
enable-cache: true

- name: Setup Python
if: steps.check.outputs.skip != 'true'
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version-file: "packages/uipath-claude-sdk/.python-version"

- name: Install dependencies
if: steps.check.outputs.skip != 'true'
working-directory: packages/uipath-claude-sdk
run: uv sync --all-extras

- name: Check static types
if: steps.check.outputs.skip != 'true'
working-directory: packages/uipath-claude-sdk
run: uv run mypy --config-file pyproject.toml .

- name: Check linting
if: steps.check.outputs.skip != 'true'
working-directory: packages/uipath-claude-sdk
run: uv run ruff check .

- name: Check formatting
if: steps.check.outputs.skip != 'true'
working-directory: packages/uipath-claude-sdk
run: uv run ruff format --check .

skip-lint:
name: Skip Lint (Custom Version Testing)
runs-on: uipath-ubuntu-latest
Expand Down
82 changes: 80 additions & 2 deletions .github/workflows/test-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -405,11 +405,81 @@ jobs:
path: packages/uipath-agent-framework/coverage.xml
retention-days: 30

test-claude-sdk:
name: Test (uipath-claude-sdk, ${{ matrix.python-version }}, ${{ matrix.os }})
needs: detect-changed-packages
runs-on: ${{ matrix.os == 'windows-latest' && 'uipath-windows-latest' || 'uipath-ubuntu-latest' }}
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12", "3.13"]
os: [ubuntu-latest, windows-latest]
steps:
- name: Check if package changed
id: check
shell: bash
run: |
if echo '${{ needs.detect-changed-packages.outputs.packages }}' | jq -e 'index("uipath-claude-sdk")' > /dev/null; then
echo "skip=false" >> $GITHUB_OUTPUT
else
echo "skip=true" >> $GITHUB_OUTPUT
fi

- name: Skip
if: steps.check.outputs.skip == 'true'
shell: bash
run: echo "Skipping - no changes to uipath-claude-sdk"

- name: Checkout
if: steps.check.outputs.skip != 'true'
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0

- name: Setup uv
if: steps.check.outputs.skip != 'true'
uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5.4.2

- name: Setup Python
if: steps.check.outputs.skip != 'true'
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
if: steps.check.outputs.skip != 'true'
working-directory: packages/uipath-claude-sdk
run: uv sync --all-extras --python ${{ matrix.python-version }}

- name: Run tests
if: steps.check.outputs.skip != 'true' && !(matrix.os == 'ubuntu-latest' && matrix.python-version == '3.13')
working-directory: packages/uipath-claude-sdk
run: uv run pytest

- name: Run tests with coverage
if: steps.check.outputs.skip != 'true' && matrix.os == 'ubuntu-latest' && matrix.python-version == '3.13'
working-directory: packages/uipath-claude-sdk
run: uv run pytest --cov-report=xml --cov-report=html --tb=short

- name: Upload coverage HTML report
if: steps.check.outputs.skip != 'true' && matrix.os == 'ubuntu-latest' && matrix.python-version == '3.13' && always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: coverage-html-uipath-claude-sdk
path: packages/uipath-claude-sdk/htmlcov/
retention-days: 30

- name: Upload coverage XML report
if: steps.check.outputs.skip != 'true' && matrix.os == 'ubuntu-latest' && matrix.python-version == '3.13' && always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: coverage-xml-uipath-claude-sdk
path: packages/uipath-claude-sdk/coverage.xml
retention-days: 30

sonarcloud:
name: SonarCloud
needs: [test-llamaindex, test-openai-agents, test-google-adk, test-pydantic-ai, test-agent-framework]
needs: [test-llamaindex, test-openai-agents, test-google-adk, test-pydantic-ai, test-agent-framework, test-claude-sdk]
runs-on: uipath-ubuntu-latest
if: always() && needs.test-llamaindex.result != 'failure' && needs.test-openai-agents.result != 'failure' && needs.test-google-adk.result != 'failure' && needs.test-pydantic-ai.result != 'failure' && needs.test-agent-framework.result != 'failure'
if: always() && needs.test-llamaindex.result != 'failure' && needs.test-openai-agents.result != 'failure' && needs.test-google-adk.result != 'failure' && needs.test-pydantic-ai.result != 'failure' && needs.test-agent-framework.result != 'failure' && needs.test-claude-sdk.result != 'failure'
permissions:
contents: read
steps:
Expand Down Expand Up @@ -453,13 +523,21 @@ jobs:
name: coverage-xml-uipath-agent-framework
path: packages/uipath-agent-framework

- name: Download uipath-claude-sdk coverage
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
continue-on-error: true
with:
name: coverage-xml-uipath-claude-sdk
path: packages/uipath-claude-sdk

- name: Rewrite coverage XML <source> to repo-relative paths
run: |
sed -i 's|<source>src/uipath_llamaindex</source>|<source>packages/uipath-llamaindex/src/uipath_llamaindex</source>|g' packages/uipath-llamaindex/coverage.xml || true
sed -i 's|<source>src/uipath_openai_agents</source>|<source>packages/uipath-openai-agents/src/uipath_openai_agents</source>|g' packages/uipath-openai-agents/coverage.xml || true
sed -i 's|<source>src/uipath_google_adk</source>|<source>packages/uipath-google-adk/src/uipath_google_adk</source>|g' packages/uipath-google-adk/coverage.xml || true
sed -i 's|<source>src/uipath_pydantic_ai</source>|<source>packages/uipath-pydantic-ai/src/uipath_pydantic_ai</source>|g' packages/uipath-pydantic-ai/coverage.xml || true
sed -i 's|<source>src/uipath_agent_framework</source>|<source>packages/uipath-agent-framework/src/uipath_agent_framework</source>|g' packages/uipath-agent-framework/coverage.xml || true
sed -i 's|<source>src/uipath_claude_sdk</source>|<source>packages/uipath-claude-sdk/src/uipath_claude_sdk</source>|g' packages/uipath-claude-sdk/coverage.xml || true

- name: SonarCloud Scan
uses: SonarSource/sonarqube-scan-action@2f77a1ec69fb1d595b06f35ab27e97605bdef703 # v5
Expand Down
1 change: 1 addition & 0 deletions packages/uipath-claude-sdk/.python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.11
52 changes: 52 additions & 0 deletions packages/uipath-claude-sdk/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Contributing to UiPath Claude Agent SDK

## Local Development Setup

### Prerequisites

1. **Install Python 3.11 or later**:
- Download and install Python from the official [Python website](https://www.python.org/downloads/)
- Verify the installation by running:
```sh
python3.11 --version
```

Alternative: [mise](https://mise.jdx.dev/lang/python.html)

The package is pinned to 3.11 through `.python-version` and is tested on 3.11, 3.12 and 3.13.

2. **Install [uv](https://docs.astral.sh/uv/)**:
```sh
pip install uv
```

3. **Create a virtual environment in the current working directory**:
```sh
uv venv
```

4. **Install dependencies**:
```sh
uv sync --all-extras
```

### Checks

Run these from `packages/uipath-claude-sdk`. They are the same commands CI runs:

```sh
uv run mypy --config-file pyproject.toml .
uv run ruff check .
uv run ruff format --check .
uv run pytest
```

`uv run ruff format .` rewrites the files in place instead of only reporting.

### Use SDK Locally
1. Create a folder on your own device `mkdir project; cd project`
2. Initialize the python project `uv` `uv init . --python 3.11`
3. Obtain the project path `PATH_TO_SDK=/Users/YOUR_USER/uipath-integrations-python/packages/uipath-claude-sdk/`
4. Install the sdk in editable mode `uv add --editable ${PATH_TO_SDK}`

:information_source: Instead of cloning the project into `.venv/lib/python3.11/site-packages/uipath-claude-sdk`, this mode creates a file named `_uipath-claude-sdk.pth` inside `.venv/lib/python3.11/site-packages`. That file contains the value of `PATH_TO_SDK`, which is added to `sys.path`, the list of directories where python searches for packages. (Run `python -c 'import sys; print(sys.path)'` to see the entries.)
Loading