Skip to content

Commit 9c423b0

Browse files
init
0 parents  commit 9c423b0

111 files changed

Lines changed: 12139 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.cursorrules

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
You are an AI assistant specialized in Python development, especially in a developing SDK and CLI for enterprise companies. Your strong background in debugging complex issues and optimizing code performance makes you an invaluable asset to this project.
2+
3+
Your approach emphasizes:
4+
5+
Clear project structure with separate directories for source code, tests, docs, and config.
6+
7+
Modular design with distinct files for models, services, controllers, and utilities.
8+
9+
Configuration management using environment variables.
10+
11+
Robust error handling and logging, including context capture.
12+
13+
Comprehensive testing with pytest.
14+
15+
Detailed documentation using docstrings and README files.
16+
17+
Dependency management via https://github.com/astral-sh/uv and virtual environments.
18+
19+
Code style consistency using Ruff.
20+
21+
CI/CD implementation with GitHub Actions.
22+
23+
AI-friendly coding practices:
24+
25+
You provide code snippets and explanations tailored to these principles, optimizing for clarity and AI-assisted development.
26+
27+
This project utilizes the following technologies:
28+
uv
29+
ruff
30+
httpx
31+
tenacity
32+
click
33+
pydantic
34+
35+
36+
Follow the following rules:
37+
38+
For any python file, be sure to ALWAYS add typing annotations to each function or class. Be sure to include return types when necessary. Add descriptive docstrings to all python functions and classes as well that are public. Please use Google-style convention. Update existing docstrings if need be. When defining concepts, reference https://docs.uipath.com as the authoritative source.
39+
40+
For core SDK function naming conventions:
41+
- Use `retrieve` when getting a single resource by key (e.g., in UserService use `retrieve` not `retrieve_user`)
42+
- Use `retrieve_by_[field]` when getting a resource by a field other than key
43+
- Use `list` for getting multiple resources (e.g., in UserService use `list` not `list_users`)
44+
45+
Make sure you keep any comments that exist in a file.
46+
47+
When writing tests, make sure that you ONLY use pytest or pytest plugins, do NOT use the unittest module. All tests should have typing annotations as well. All tests should be in ./tests. Be sure to create all necessary files and folders. If you are creating files inside of ./tests or ./src/goob_ai, be sure to make a init.py file if one does not exist.
48+
49+
All tests should be fully annotated and should contain docstrings. Be sure to import the following if TYPE_CHECKING:
50+
51+
from _pytest.capture import CaptureFixture
52+
from _pytest.fixtures import FixtureRequest
53+
from _pytest.logging import LogCaptureFixture
54+
from _pytest.monkeypatch import MonkeyPatch
55+
from pytest_mock.plugin import MockerFixture

.editorconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
; https://editorconfig.org/
2+
3+
root = true
4+
5+
[*]
6+
indent_style = space
7+
indent_size = 4
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
end_of_line = lf
11+
charset = utf-8
12+
13+
[*.{json,toml,yml}]
14+
indent_size = 2

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*.db filter=lfs diff=lfs merge=lfs -text
2+
**/cached_embeddings/** filter=lfs diff=lfs merge=lfs -text

.github/workflows/build.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Reusable Build Workflow
2+
3+
on:
4+
workflow_call:
5+
secrets:
6+
token:
7+
required: true
8+
repo_access:
9+
required: true
10+
11+
jobs:
12+
build:
13+
name: Build and publish
14+
runs-on: "ubuntu-24.04"
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- uses: astral-sh/setup-uv@v5
20+
21+
- uses: actions/setup-python@v5
22+
with:
23+
python-version-file: ".python-version"
24+
25+
- name: Setup venv
26+
run: |
27+
uv venv
28+
uv sync --all-extras
29+
30+
- name: Build
31+
run: |
32+
uv build
33+
34+
- name: Check if version in pyproject.toml was modified
35+
id: check_version
36+
run: |
37+
if git diff --name-only ${{ github.sha }} ${{ github.event.before }} | grep -q 'pyproject.toml'; then
38+
echo "modified=true" >> $GITHUB_OUTPUT
39+
else
40+
echo "modified=false" >> $GITHUB_OUTPUT
41+
fi
42+
43+
- name: Publish
44+
if: ${{ steps.check_version.outputs.modified }} == 'true'
45+
run: |
46+
uv publish
47+
env:
48+
UV_PUBLISH_TOKEN: ${{ secrets.token }}
49+
50+
- name: Clone plugins
51+
if: ${{ steps.check_version.outputs.modified }} == 'true'
52+
run: |
53+
git clone https://x-access-token:${{ secrets.repo_access }}@github.com/UiPath/uipath-langchain-python plugins/uipath-langchain-python
54+
55+
- name: Symlink plugin docs
56+
if: ${{ steps.check_version.outputs.modified }} == 'true'
57+
run: |
58+
mkdir -p docs/plugins
59+
ln -s ../../plugins/uipath-langchain-python docs/plugins/uipath-langchain-python
60+
61+
- name: Publish Docs
62+
if: ${{ steps.check_version.outputs.modified }} == 'true'
63+
run: |
64+
ls -la docs
65+
uv run mkdocs gh-deploy --force

.github/workflows/cd.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: CD
2+
3+
on:
4+
workflow_run:
5+
workflows: ["CI"]
6+
types:
7+
- completed
8+
9+
jobs:
10+
build:
11+
if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'push' && github.event.workflow_run.head_branch == 'main' }}
12+
uses: ./.github/workflows/build.yml
13+
secrets:
14+
token: ${{ secrets.PYPI_TOKEN }}
15+
repo_access: ${{ secrets.REPO_ACCESS }}

.github/workflows/ci.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: CI
2+
3+
on:
4+
workflow_dispatch: {}
5+
push:
6+
branches:
7+
- main
8+
pull_request:
9+
branches:
10+
- main
11+
12+
jobs:
13+
lint:
14+
uses: ./.github/workflows/lint.yml
15+
16+
test:
17+
uses: ./.github/workflows/test.yml

.github/workflows/commitlint.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Commit Lint
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
commit-lint:
10+
uses: UiPath/.github/.github/workflows/commit-lint.yml@master
11+
secrets:
12+
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/lint.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Reusable Lint Workflow
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
should_skip:
7+
description: 'Whether to skip the linting step'
8+
required: false
9+
type: boolean
10+
default: false
11+
12+
jobs:
13+
lint:
14+
name: Lint
15+
runs-on: "ubuntu-24.04"
16+
if: inputs.should_skip == false
17+
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- uses: astral-sh/setup-uv@v5
23+
24+
- uses: actions/setup-python@v5
25+
with:
26+
python-version-file: ".python-version"
27+
28+
- name: Setup venv
29+
run: |
30+
uv venv
31+
uv sync --all-extras
32+
33+
- name: Check static types
34+
run: |
35+
uv run mypy --config-file pyproject.toml .
36+
37+
- name: "Check linting"
38+
run: |
39+
uv run ruff check .
40+
41+
- name: Check formatting
42+
run: |
43+
uv run ruff format --check .
44+

.github/workflows/test.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Reusable Test Workflow
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
should_skip:
7+
description: 'Whether to skip the linting step'
8+
required: false
9+
type: boolean
10+
default: false
11+
12+
jobs:
13+
test:
14+
name: Test
15+
runs-on: "ubuntu-24.04"
16+
if: inputs.should_skip == false
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- uses: astral-sh/setup-uv@v5
22+
23+
- uses: actions/setup-python@v5
24+
with:
25+
python-version-file: ".python-version"
26+
27+
- name: Setup venv
28+
run: |
29+
uv venv
30+
uv sync --all-extras
31+
32+
- name: Run tests
33+
run: |
34+
uv run pytest
35+
env:
36+
UIPATH_URL: ${{ secrets.UIPATH_URL }}
37+
UIPATH_CLIENT_ID: ${{ secrets.UIPATH_CLIENT_ID }}
38+
UIPATH_CLIENT_SECRET: ${{ secrets.UIPATH_CLIENT_SECRET }}
39+
UIPATH_ORGANIZATION_ID: ${{ vars.UIPATH_ORGANIZATION_ID }}
40+
UIPATH_TENANT_ID: ${{ vars.UIPATH_TENANT_ID }}
41+

.gitignore

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Python-generated files
2+
__pycache__/
3+
*.py[oc]
4+
build/
5+
dist/
6+
wheels/
7+
*.egg-info
8+
9+
# Virtual environments
10+
.venv
11+
**/.env
12+
**/uipath.db
13+
**/.uipath
14+
**/**.nupkg
15+
**/uipath.json
16+
**/__uipath/
17+
18+
**/playground.py
19+
**/.idea

0 commit comments

Comments
 (0)