uipath 2.0.52__tar.gz → 2.0.54__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of uipath might be problematic. Click here for more details.
- {uipath-2.0.52 → uipath-2.0.54}/.github/workflows/test.yml +9 -1
- {uipath-2.0.52 → uipath-2.0.54}/.gitignore +4 -0
- {uipath-2.0.52 → uipath-2.0.54}/PKG-INFO +1 -1
- uipath-2.0.54/docs/FAQ.md +77 -0
- uipath-2.0.54/docs/assets/env-preparation-failed-dark.png +0 -0
- uipath-2.0.54/docs/assets/env-preparation-failed-light.png +0 -0
- uipath-2.0.54/docs/core/assets/cloud_env_var_dark.gif +0 -0
- uipath-2.0.54/docs/core/assets/cloud_env_var_light.gif +0 -0
- uipath-2.0.54/docs/core/assets/cloud_env_var_secret_dark.png +0 -0
- uipath-2.0.54/docs/core/assets/cloud_env_var_secret_light.png +0 -0
- uipath-2.0.54/docs/core/assets/copy_path_dark.png +0 -0
- uipath-2.0.54/docs/core/assets/copy_path_light.png +0 -0
- uipath-2.0.54/docs/core/environment_variables.md +115 -0
- {uipath-2.0.52 → uipath-2.0.54}/docs/core/getting_started.md +8 -0
- {uipath-2.0.52 → uipath-2.0.54}/mkdocs.yml +3 -1
- {uipath-2.0.52 → uipath-2.0.54}/pyproject.toml +13 -2
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/_cli/_auth/_auth_server.py +1 -1
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/_cli/cli_auth.py +1 -1
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/_cli/cli_invoke.py +1 -1
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/_cli/cli_run.py +1 -1
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/_execution_context.py +1 -1
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/_folder_context.py +1 -1
- uipath-2.0.54/src/uipath/_services/_base_service.py +183 -0
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/_services/actions_service.py +12 -4
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/_services/api_client.py +2 -36
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/_services/assets_service.py +73 -8
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/_services/buckets_service.py +4 -9
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/_services/jobs_service.py +1 -1
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/_uipath.py +1 -1
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/_utils/__init__.py +2 -0
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/_utils/_request_override.py +2 -2
- uipath-2.0.54/src/uipath/_utils/_url.py +85 -0
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/_utils/constants.py +1 -1
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/models/__init__.py +2 -1
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/models/assets.py +22 -0
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/telemetry/_constants.py +7 -2
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/telemetry/_track.py +9 -4
- uipath-2.0.54/tests/cli/mocks/pyproject.toml +9 -0
- uipath-2.0.54/tests/cli/mocks/uipath-mock.json +66 -0
- uipath-2.0.54/tests/cli/test_init.py +196 -0
- uipath-2.0.54/tests/cli/test_new.py +81 -0
- uipath-2.0.54/tests/cli/test_pack.py +326 -0
- uipath-2.0.54/tests/cli/test_publish.py +408 -0
- uipath-2.0.54/tests/cli/utils/project_details.py +49 -0
- uipath-2.0.54/tests/cli/utils/uipath_json.py +111 -0
- uipath-2.0.54/tests/conftest.py +69 -0
- uipath-2.0.54/tests/sdk/services/conftest.py +63 -0
- uipath-2.0.54/tests/sdk/services/test_actions_service.py +178 -0
- uipath-2.0.54/tests/sdk/services/test_api_client.py +91 -0
- uipath-2.0.54/tests/sdk/services/test_assets_service.py +279 -0
- uipath-2.0.54/tests/sdk/services/test_base_service.py +102 -0
- uipath-2.0.54/tests/sdk/services/test_buckets_service.py +276 -0
- uipath-2.0.54/tests/sdk/services/test_connections_service.py +196 -0
- uipath-2.0.54/tests/sdk/services/test_context_grounding_service.py +335 -0
- uipath-2.0.54/tests/sdk/services/test_folder_service.py +96 -0
- uipath-2.0.54/tests/sdk/services/test_jobs_service.py +271 -0
- {uipath-2.0.52 → uipath-2.0.54}/tests/sdk/services/test_llm_integration.py +27 -1
- uipath-2.0.54/tests/sdk/services/test_processes_service.py +254 -0
- uipath-2.0.54/tests/sdk/services/test_queues_service.py +688 -0
- {uipath-2.0.52 → uipath-2.0.54}/tests/sdk/services/test_uipath_llm_integration.py +3 -0
- {uipath-2.0.52 → uipath-2.0.54}/uv.lock +1784 -1683
- uipath-2.0.52/src/uipath/_services/_base_service.py +0 -261
- uipath-2.0.52/tests/cli/test_init.py +0 -194
- uipath-2.0.52/tests/conftest.py +0 -29
- {uipath-2.0.52 → uipath-2.0.54}/.cursorrules +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/.editorconfig +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/.gitattributes +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/.github/workflows/build.yml +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/.github/workflows/cd.yml +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/.github/workflows/ci.yml +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/.github/workflows/commitlint.yml +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/.github/workflows/lint.yml +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/.github/workflows/publish-dev.yml +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/.github/workflows/publish-docs.yml +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/.github/workflows/slack.yml +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/.pre-commit-config.yaml +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/.python-version +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/.vscode/extensions.json +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/.vscode/settings.json +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/CONTRIBUTING.md +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/LICENSE +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/README.md +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/docs/CONTRIBUTING.md +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/docs/assets/favicon.png +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/docs/assets/logo-dark.svg +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/docs/assets/logo-light.svg +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/docs/cli/index.md +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/docs/core/actions.md +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/docs/core/assets.md +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/docs/core/buckets.md +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/docs/core/connections.md +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/docs/core/context_grounding.md +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/docs/core/jobs.md +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/docs/core/processes.md +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/docs/core/queues.md +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/docs/hooks.py +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/docs/javascripts/extra.js +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/docs/langchain/chat_models.md +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/docs/langchain/context_grounding.md +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/docs/langchain/human_in_the_loop.md +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/docs/overrides/partials/logo.html +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/docs/release_policy.md +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/docs/stylesheets/extra.css +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/justfile +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/py.typed +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/__init__.py +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/_cli/README.md +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/_cli/__init__.py +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/_cli/_auth/_models.py +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/_cli/_auth/_oidc_utils.py +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/_cli/_auth/_portal_service.py +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/_cli/_auth/_utils.py +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/_cli/_auth/auth_config.json +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/_cli/_auth/index.html +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/_cli/_auth/localhost.crt +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/_cli/_auth/localhost.key +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/_cli/_runtime/_contracts.py +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/_cli/_runtime/_logging.py +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/_cli/_runtime/_runtime.py +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/_cli/_templates/.psmdcp.template +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/_cli/_templates/.rels.template +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/_cli/_templates/[Content_Types].xml.template +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/_cli/_templates/main.py.template +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/_cli/_templates/package.nuspec.template +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/_cli/_utils/_common.py +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/_cli/_utils/_console.py +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/_cli/_utils/_folders.py +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/_cli/_utils/_input_args.py +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/_cli/_utils/_parse_ast.py +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/_cli/_utils/_processes.py +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/_cli/cli_deploy.py +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/_cli/cli_init.py +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/_cli/cli_new.py +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/_cli/cli_pack.py +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/_cli/cli_publish.py +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/_cli/middlewares.py +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/_cli/spinner.py +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/_config.py +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/_services/__init__.py +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/_services/connections_service.py +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/_services/context_grounding_service.py +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/_services/folder_service.py +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/_services/llm_gateway_service.py +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/_services/processes_service.py +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/_services/queues_service.py +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/_utils/_endpoint.py +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/_utils/_infer_bindings.py +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/_utils/_logs.py +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/_utils/_read_overwrites.py +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/_utils/_request_spec.py +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/_utils/_user_agent.py +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/models/action_schema.py +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/models/actions.py +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/models/buckets.py +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/models/connections.py +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/models/context_grounding.py +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/models/context_grounding_index.py +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/models/errors.py +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/models/exceptions.py +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/models/interrupt_models.py +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/models/job.py +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/models/llm_gateway.py +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/models/processes.py +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/models/queues.py +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/py.typed +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/telemetry/__init__.py +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/tracing/__init__.py +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/tracing/_otel_exporters.py +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/tracing/_traced.py +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/src/uipath/tracing/_utils.py +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/tests/__init__.py +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/tests/sdk/services/test_llm_service.py +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/tests/sdk/test_config.py +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/tests/sdk/test_overwrites.py +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/tests/tracing/test_otel_exporters.py +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/tests/tracing/test_span_utils.py +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/tests/tracing/test_traced.py +0 -0
- {uipath-2.0.52 → uipath-2.0.54}/tests/tracing/test_tracing_manager.py +0 -0
|
@@ -24,11 +24,19 @@ jobs:
|
|
|
24
24
|
|
|
25
25
|
- name: Run tests
|
|
26
26
|
run: |
|
|
27
|
-
uv run pytest
|
|
27
|
+
uv run pytest --cov-report xml:./coverage/coverage.xml
|
|
28
28
|
env:
|
|
29
29
|
UIPATH_URL: ${{ secrets.UIPATH_URL }}
|
|
30
|
+
UIPATH_BASE_URL: ${{ secrets.UIPATH_BASE_URL }}
|
|
30
31
|
UIPATH_CLIENT_ID: ${{ secrets.UIPATH_CLIENT_ID }}
|
|
31
32
|
UIPATH_CLIENT_SECRET: ${{ secrets.UIPATH_CLIENT_SECRET }}
|
|
32
33
|
UIPATH_ORGANIZATION_ID: ${{ vars.UIPATH_ORGANIZATION_ID }}
|
|
33
34
|
UIPATH_TENANT_ID: ${{ vars.UIPATH_TENANT_ID }}
|
|
34
35
|
|
|
36
|
+
- name: Get Cover
|
|
37
|
+
uses: orgoro/coverage@v3.2
|
|
38
|
+
with:
|
|
39
|
+
coverageFile: ./coverage/coverage.xml
|
|
40
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
|
41
|
+
if: ${{ github.event_name == 'pull_request_target' }}
|
|
42
|
+
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: uipath
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.54
|
|
4
4
|
Summary: Python SDK and CLI for UiPath Platform, enabling programmatic interaction with automation services, process management, and deployment tools.
|
|
5
5
|
Project-URL: Homepage, https://uipath.com
|
|
6
6
|
Project-URL: Repository, https://github.com/UiPath/uipath-python
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# Frequently Asked Questions (FAQ)
|
|
2
|
+
|
|
3
|
+
### Q: Why am I getting a "Failed to prepare environment" error when deploying my python agent to UiPath Cloud Platform?
|
|
4
|
+
|
|
5
|
+
#### Error Message
|
|
6
|
+
|
|
7
|
+
```json
|
|
8
|
+
{
|
|
9
|
+
"Code": "Serverless.PythonCodedAgent.PrepareEnvironmentError",
|
|
10
|
+
"Title": "Failed to prepare environment",
|
|
11
|
+
"Detail": "An error occurred while installing the package dependencies. Please try again. If the error persists, please contact support.",
|
|
12
|
+
"Category": "System",
|
|
13
|
+
"Status": null
|
|
14
|
+
}
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
#### Visual Example
|
|
18
|
+
|
|
19
|
+
<picture data-light="../assets/env-preparation-failed-light.png" data-dark="../assets/env-preparation-failed-dark.png">
|
|
20
|
+
<source
|
|
21
|
+
media="(prefers-color-scheme: dark)"
|
|
22
|
+
srcset="../assets/env-preparation-failed-dark.png"
|
|
23
|
+
/>
|
|
24
|
+
<img
|
|
25
|
+
src="../assets/env-preparation-failed-light.png"
|
|
26
|
+
/>
|
|
27
|
+
</picture>
|
|
28
|
+
|
|
29
|
+
*Example of the error as it appears in UiPath Cloud Platform*
|
|
30
|
+
|
|
31
|
+
#### Description
|
|
32
|
+
|
|
33
|
+
This error might occur when deploying coded-agents to UiPath Cloud Platform, even though the same project might work correctly in your local environment. The issue is often related to how Python packages are discovered and distributed during the cloud deployment process.
|
|
34
|
+
|
|
35
|
+
#### Common Causes
|
|
36
|
+
|
|
37
|
+
1. Multiple top-level packages or modules in your project structure
|
|
38
|
+
2. Improper configuration or formatting in the pyproject.toml or requirements.txt files
|
|
39
|
+
|
|
40
|
+
#### Solution
|
|
41
|
+
|
|
42
|
+
##### 1. Check Your Project Structure
|
|
43
|
+
|
|
44
|
+
- Ensure your Python files are organized under a non top-level directory (e.g., using the `src` layout)
|
|
45
|
+
- Follow the recommended project structure:
|
|
46
|
+
|
|
47
|
+
```plaintext
|
|
48
|
+
project_root/
|
|
49
|
+
├── src/
|
|
50
|
+
│ └── your_package/
|
|
51
|
+
│ ├── __init__.py
|
|
52
|
+
│ └── your_modules.py
|
|
53
|
+
├── pyproject.toml
|
|
54
|
+
└── setup.cfg/setup.py
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
##### 2. Configure Package Discovery
|
|
58
|
+
|
|
59
|
+
If you need to maintain your current project structure, you can configure custom package discovery in your `pyproject.toml`:
|
|
60
|
+
|
|
61
|
+
```toml
|
|
62
|
+
[tool.setuptools]
|
|
63
|
+
py-modules = []
|
|
64
|
+
packages = ["your_package"]
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
##### 3. Verify Dependencies
|
|
68
|
+
|
|
69
|
+
- Ensure all required dependencies are properly listed in your `requirements.txt` or `pyproject.toml`
|
|
70
|
+
|
|
71
|
+
#### Reference
|
|
72
|
+
|
|
73
|
+
For more detailed information about package discovery and configuration, refer to the [official setuptools documentation](https://setuptools.pypa.io/en/latest/userguide/package_discovery.html).
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
*Note: This FAQ will be updated as new information becomes available. If you continue experiencing issues after following these solutions, please contact UiPath support.*
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# Environment Variables
|
|
2
|
+
|
|
3
|
+
Environment variables are configuration values stored at the operating system level that can be accessed by applications and scripts. They provide a flexible way to configure application behavior without hardcoding values in your source code.
|
|
4
|
+
|
|
5
|
+
Environment variables are loaded in the following order (highest to lowest priority):
|
|
6
|
+
|
|
7
|
+
1. `.env` file in the current directory
|
|
8
|
+
2. System environment variables
|
|
9
|
+
3. Default values in code
|
|
10
|
+
|
|
11
|
+
Example:
|
|
12
|
+
```bash
|
|
13
|
+
# .env file
|
|
14
|
+
UIPATH_FOLDER_PATH=/default/path
|
|
15
|
+
|
|
16
|
+
# System environment
|
|
17
|
+
export UIPATH_FOLDER_PATH=/system/path
|
|
18
|
+
```
|
|
19
|
+
/// warning
|
|
20
|
+
When deploying your agent to production, ensure that all required environment variables (such as API keys and custom configurations) are properly configured in your process settings. This step is crucial for the successful operation of your published package.
|
|
21
|
+
///
|
|
22
|
+
|
|
23
|
+
## Design
|
|
24
|
+
|
|
25
|
+
Create a `.env` file in your project's root directory to manage environment variables locally. When using the `uipath auth` or `uipath new my-agent` commands, this file is automatically created.
|
|
26
|
+
|
|
27
|
+
The `uipath auth` command automatically populates this file with essential variables:
|
|
28
|
+
|
|
29
|
+
- `UIPATH_URL`: Your UiPath Orchestrator instance URL
|
|
30
|
+
- `UIPATH_ACCESS_TOKEN`: Authentication token for API access
|
|
31
|
+
|
|
32
|
+
### Folder Configuration
|
|
33
|
+
Most UiPath services operate within a specific folder context. Configure your folder context using either:
|
|
34
|
+
|
|
35
|
+
- `UIPATH_FOLDER_PATH`: The full path to your target folder
|
|
36
|
+
- `UIPATH_FOLDER_KEY`: The unique identifier for your target folder
|
|
37
|
+
|
|
38
|
+
To obtain the folder path, right-click on the folder in UiPath Orchestrator and select "Copy folder path" from the context menu.
|
|
39
|
+
|
|
40
|
+
<picture data-light="../assets/copy_path_light.png" data-dark="../assets/copy_path_dark.png">
|
|
41
|
+
<source
|
|
42
|
+
media="(prefers-color-scheme: dark)"
|
|
43
|
+
srcset="
|
|
44
|
+
../assets/copy_path_dark.png
|
|
45
|
+
"
|
|
46
|
+
/>
|
|
47
|
+
<img
|
|
48
|
+
src="../assets/copy_path_light.png"
|
|
49
|
+
/>
|
|
50
|
+
</picture>
|
|
51
|
+
|
|
52
|
+
### Telemetry
|
|
53
|
+
To help us improve the developer experience, the CLI collects basic usage data about command invocations. For more details about UiPath's privacy practices, please review the [privacy statement](https://www.uipath.com/legal/privacy-policy).
|
|
54
|
+
|
|
55
|
+
Telemetry is enabled by default. You can opt out by setting the `UIPATH_TELEMETRY_ENABLED` environment variable to `false` in your `.env` file:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
UIPATH_TELEMETRY_ENABLED=false
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Runtime
|
|
62
|
+
|
|
63
|
+
When executing processes or starting jobs, you can configure environment variables through the UiPath Orchestrator interface. For sensitive information like API keys and secrets, we strongly recommend using secret assets instead of environment variables. Secret assets provide enhanced security and better management capabilities.
|
|
64
|
+
|
|
65
|
+
### Secret Assets
|
|
66
|
+
To use a secret asset in your environment variables, reference it using the following format:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
NAME=%ASSETS/your-secret-asset-name%
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
<picture data-light="../assets/cloud_env_var_light.gif" data-dark="../assets/cloud_env_var_dark.gif">
|
|
73
|
+
<source
|
|
74
|
+
media="(prefers-color-scheme: dark)"
|
|
75
|
+
srcset="
|
|
76
|
+
../assets/cloud_env_var_dark.gif
|
|
77
|
+
"
|
|
78
|
+
/>
|
|
79
|
+
<img
|
|
80
|
+
src="../assets/cloud_env_var_light.gif"
|
|
81
|
+
/>
|
|
82
|
+
</picture>
|
|
83
|
+
|
|
84
|
+
### Sensitive Variables
|
|
85
|
+
If you must use environment variables for sensitive information (not recommended), variables containing `API_KEY` or `SECRET` in their names will have their values masked as `****` in the interface for security purposes.
|
|
86
|
+
|
|
87
|
+
<picture data-light="../assets/cloud_env_var_secret_light.png" data-dark="../assets/cloud_env_var_secret_dark.png">
|
|
88
|
+
<source
|
|
89
|
+
media="(prefers-color-scheme: dark)"
|
|
90
|
+
srcset="
|
|
91
|
+
../assets/cloud_env_var_secret_dark.png
|
|
92
|
+
"
|
|
93
|
+
/>
|
|
94
|
+
<img
|
|
95
|
+
src="../assets/cloud_env_var_secret_light.png"
|
|
96
|
+
/>
|
|
97
|
+
</picture>
|
|
98
|
+
|
|
99
|
+
### Log Level
|
|
100
|
+
The `LOG_LEVEL` environment variable controls the verbosity of logging in the Orchestrator UI's Log tab during runtime execution. This setting determines which log messages are displayed in the interface.
|
|
101
|
+
|
|
102
|
+
| Level | Description |
|
|
103
|
+
|-------|-------------|
|
|
104
|
+
| TRACE | Most detailed logging level, shows all possible information |
|
|
105
|
+
| DEBUG | Detailed information for debugging purposes |
|
|
106
|
+
| INFORMATION | General operational information |
|
|
107
|
+
| WARNING | Warning messages for potentially harmful situations |
|
|
108
|
+
| ERROR | Error events that might still allow the application to continue |
|
|
109
|
+
| CRITICAL | Critical events that may lead to application failure |
|
|
110
|
+
| NONE | No logging |
|
|
111
|
+
|
|
112
|
+
The default value is `INFORMATION`
|
|
113
|
+
|
|
114
|
+
### Builtin Variables
|
|
115
|
+
The runtime environment automatically includes certain variables (such as `UIPATH_FOLDER_KEY`, `UIPATH_ROBOT_KEY`), eliminating the need for manual configuration.
|
|
@@ -87,6 +87,14 @@ uipath version 2.0.29
|
|
|
87
87
|
|
|
88
88
|
////
|
|
89
89
|
|
|
90
|
+
### Telemetry
|
|
91
|
+
|
|
92
|
+
To help us improve the developer experience, the CLI collects basic usage data about commands invocation. For more details about UiPath’s privacy practices, please review the [privacy statement](https://www.uipath.com/legal/privacy-policy).
|
|
93
|
+
|
|
94
|
+
#### Disabling telemetry data
|
|
95
|
+
|
|
96
|
+
Telemetry is enabled by default, yet it is possible to opt-out by setting to `false` the `UIPATH_TELEMETRY_ENABLED` environment variable.
|
|
97
|
+
|
|
90
98
|
### Authentication
|
|
91
99
|
|
|
92
100
|
To debug your script locally and publish your project, you need to authenticate with UiPath:
|
|
@@ -59,6 +59,7 @@ nav:
|
|
|
59
59
|
- Sample Agents: https://github.com/UiPath/uipath-langchain-python/tree/main/samples
|
|
60
60
|
- UiPath SDK:
|
|
61
61
|
- Getting Started: core/getting_started.md
|
|
62
|
+
- Environment Variables: core/environment_variables.md
|
|
62
63
|
- CLI Reference: cli/index.md
|
|
63
64
|
- Services:
|
|
64
65
|
- Actions: core/actions.md
|
|
@@ -70,6 +71,7 @@ nav:
|
|
|
70
71
|
- Queues: core/queues.md
|
|
71
72
|
- Processes: core/processes.md
|
|
72
73
|
- How To Contribute: CONTRIBUTING.md
|
|
74
|
+
- FAQ: FAQ.md
|
|
73
75
|
- Release Policy: release_policy.md
|
|
74
76
|
|
|
75
77
|
plugins:
|
|
@@ -134,4 +136,4 @@ markdown_extensions:
|
|
|
134
136
|
alternate_style: true
|
|
135
137
|
- toc:
|
|
136
138
|
title: On this page
|
|
137
|
-
permalink: true
|
|
139
|
+
permalink: true
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "uipath"
|
|
3
|
-
version = "2.0.
|
|
3
|
+
version = "2.0.54"
|
|
4
4
|
description = "Python SDK and CLI for UiPath Platform, enabling programmatic interaction with automation services, process management, and deployment tools."
|
|
5
5
|
readme = { file = "README.md", content-type = "text/markdown" }
|
|
6
6
|
requires-python = ">=3.10"
|
|
@@ -59,6 +59,11 @@ dev = [
|
|
|
59
59
|
"mkdocs-click>=0.9.0",
|
|
60
60
|
"pytest-asyncio>=0.26.0",
|
|
61
61
|
"mkdocs-open-in-new-tab>=1.0.8",
|
|
62
|
+
"toml>=0.10.2",
|
|
63
|
+
"inflection>=0.5.1",
|
|
64
|
+
"pytest-httpx>=0.35.0",
|
|
65
|
+
"pytest-trio>=0.8.0",
|
|
66
|
+
"types-toml>=0.10.8",
|
|
62
67
|
]
|
|
63
68
|
|
|
64
69
|
[project.optional-dependencies]
|
|
@@ -115,5 +120,11 @@ warn_required_dynamic_aliases = true
|
|
|
115
120
|
[tool.pytest.ini_options]
|
|
116
121
|
testpaths = ["tests"]
|
|
117
122
|
python_files = "test_*.py"
|
|
118
|
-
addopts = "-ra -q"
|
|
123
|
+
addopts = "-ra -q --cov"
|
|
124
|
+
asyncio_default_fixture_loop_scope = "function"
|
|
119
125
|
|
|
126
|
+
[tool.coverage.report]
|
|
127
|
+
show_missing = true
|
|
128
|
+
|
|
129
|
+
[tool.coverage.run]
|
|
130
|
+
source = ["src"]
|
|
@@ -20,7 +20,7 @@ from ._utils._folders import get_personal_workspace_info
|
|
|
20
20
|
from ._utils._processes import get_release_info
|
|
21
21
|
|
|
22
22
|
logger = logging.getLogger(__name__)
|
|
23
|
-
load_dotenv()
|
|
23
|
+
load_dotenv(override=True)
|
|
24
24
|
console = ConsoleLogger()
|
|
25
25
|
client = httpx.Client(follow_redirects=True, timeout=30.0)
|
|
26
26
|
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import inspect
|
|
2
|
+
from logging import getLogger
|
|
3
|
+
from typing import Any, Literal, Union
|
|
4
|
+
|
|
5
|
+
from httpx import (
|
|
6
|
+
URL,
|
|
7
|
+
AsyncClient,
|
|
8
|
+
Client,
|
|
9
|
+
ConnectTimeout,
|
|
10
|
+
Headers,
|
|
11
|
+
Response,
|
|
12
|
+
TimeoutException,
|
|
13
|
+
)
|
|
14
|
+
from tenacity import (
|
|
15
|
+
retry,
|
|
16
|
+
retry_if_exception,
|
|
17
|
+
retry_if_result,
|
|
18
|
+
wait_exponential,
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
from uipath._utils._read_overwrites import OverwritesManager
|
|
22
|
+
|
|
23
|
+
from .._config import Config
|
|
24
|
+
from .._execution_context import ExecutionContext
|
|
25
|
+
from .._utils import UiPathUrl, user_agent_value
|
|
26
|
+
from .._utils.constants import HEADER_USER_AGENT
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def is_retryable_exception(exception: BaseException) -> bool:
|
|
30
|
+
return isinstance(exception, (ConnectTimeout, TimeoutException))
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def is_retryable_status_code(response: Response) -> bool:
|
|
34
|
+
return response.status_code >= 500 and response.status_code < 600
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class BaseService:
|
|
38
|
+
def __init__(self, config: Config, execution_context: ExecutionContext) -> None:
|
|
39
|
+
self._logger = getLogger("uipath")
|
|
40
|
+
self._config = config
|
|
41
|
+
self._execution_context = execution_context
|
|
42
|
+
|
|
43
|
+
self._url = UiPathUrl(self._config.base_url)
|
|
44
|
+
|
|
45
|
+
self._client = Client(
|
|
46
|
+
base_url=self._url.base_url,
|
|
47
|
+
headers=Headers(self.default_headers),
|
|
48
|
+
timeout=30.0,
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
self._client_async = AsyncClient(
|
|
52
|
+
base_url=self._url.base_url,
|
|
53
|
+
headers=Headers(self.default_headers),
|
|
54
|
+
timeout=30.0,
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
self._overwrites_manager = OverwritesManager()
|
|
58
|
+
self._logger.debug(f"HEADERS: {self.default_headers}")
|
|
59
|
+
|
|
60
|
+
super().__init__()
|
|
61
|
+
|
|
62
|
+
@retry(
|
|
63
|
+
retry=(
|
|
64
|
+
retry_if_exception(is_retryable_exception)
|
|
65
|
+
| retry_if_result(is_retryable_status_code)
|
|
66
|
+
),
|
|
67
|
+
wait=wait_exponential(multiplier=1, min=1, max=10),
|
|
68
|
+
)
|
|
69
|
+
def request(
|
|
70
|
+
self,
|
|
71
|
+
method: str,
|
|
72
|
+
url: Union[URL, str],
|
|
73
|
+
*,
|
|
74
|
+
scoped: Literal["org", "tenant"] = "tenant",
|
|
75
|
+
**kwargs: Any,
|
|
76
|
+
) -> Response:
|
|
77
|
+
self._logger.debug(f"Request: {method} {url}")
|
|
78
|
+
self._logger.debug(f"HEADERS: {kwargs.get('headers', self._client.headers)}")
|
|
79
|
+
|
|
80
|
+
try:
|
|
81
|
+
stack = inspect.stack()
|
|
82
|
+
|
|
83
|
+
# use the third frame because of the retry decorator
|
|
84
|
+
caller_frame = stack[3].frame
|
|
85
|
+
function_name = caller_frame.f_code.co_name
|
|
86
|
+
|
|
87
|
+
if "self" in caller_frame.f_locals:
|
|
88
|
+
module_name = type(caller_frame.f_locals["self"]).__name__
|
|
89
|
+
elif "cls" in caller_frame.f_locals:
|
|
90
|
+
module_name = caller_frame.f_locals["cls"].__name__
|
|
91
|
+
else:
|
|
92
|
+
module_name = ""
|
|
93
|
+
except Exception:
|
|
94
|
+
function_name = ""
|
|
95
|
+
module_name = ""
|
|
96
|
+
|
|
97
|
+
specific_component = (
|
|
98
|
+
f"{module_name}.{function_name}" if module_name and function_name else ""
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
kwargs.setdefault("headers", {})
|
|
102
|
+
kwargs["headers"][HEADER_USER_AGENT] = user_agent_value(specific_component)
|
|
103
|
+
|
|
104
|
+
scoped_url = self._url.scope_url(str(url), scoped)
|
|
105
|
+
|
|
106
|
+
response = self._client.request(method, scoped_url, **kwargs)
|
|
107
|
+
response.raise_for_status()
|
|
108
|
+
|
|
109
|
+
return response
|
|
110
|
+
|
|
111
|
+
@retry(
|
|
112
|
+
retry=(
|
|
113
|
+
retry_if_exception(is_retryable_exception)
|
|
114
|
+
| retry_if_result(is_retryable_status_code)
|
|
115
|
+
),
|
|
116
|
+
wait=wait_exponential(multiplier=1, min=1, max=10),
|
|
117
|
+
)
|
|
118
|
+
async def request_async(
|
|
119
|
+
self,
|
|
120
|
+
method: str,
|
|
121
|
+
url: Union[URL, str],
|
|
122
|
+
*,
|
|
123
|
+
scoped: Literal["org", "tenant"] = "tenant",
|
|
124
|
+
**kwargs: Any,
|
|
125
|
+
) -> Response:
|
|
126
|
+
self._logger.debug(f"Request: {method} {url}")
|
|
127
|
+
self._logger.debug(
|
|
128
|
+
f"HEADERS: {kwargs.get('headers', self._client_async.headers)}"
|
|
129
|
+
)
|
|
130
|
+
|
|
131
|
+
kwargs.setdefault("headers", {})
|
|
132
|
+
kwargs["headers"][HEADER_USER_AGENT] = user_agent_value(
|
|
133
|
+
self._specific_component
|
|
134
|
+
)
|
|
135
|
+
|
|
136
|
+
scoped_url = self._url.scope_url(str(url), scoped)
|
|
137
|
+
|
|
138
|
+
response = await self._client_async.request(method, scoped_url, **kwargs)
|
|
139
|
+
response.raise_for_status()
|
|
140
|
+
|
|
141
|
+
return response
|
|
142
|
+
|
|
143
|
+
@property
|
|
144
|
+
def default_headers(self) -> dict[str, str]:
|
|
145
|
+
return {
|
|
146
|
+
"Accept": "application/json",
|
|
147
|
+
"Content-Type": "application/json",
|
|
148
|
+
**self.auth_headers,
|
|
149
|
+
**self.custom_headers,
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
@property
|
|
153
|
+
def auth_headers(self) -> dict[str, str]:
|
|
154
|
+
header = f"Bearer {self._config.secret}"
|
|
155
|
+
return {"Authorization": header}
|
|
156
|
+
|
|
157
|
+
@property
|
|
158
|
+
def custom_headers(self) -> dict[str, str]:
|
|
159
|
+
return {}
|
|
160
|
+
|
|
161
|
+
@property
|
|
162
|
+
def _specific_component(self) -> str:
|
|
163
|
+
try:
|
|
164
|
+
stack = inspect.stack()
|
|
165
|
+
|
|
166
|
+
caller_frame = stack[4].frame
|
|
167
|
+
function_name = caller_frame.f_code.co_name
|
|
168
|
+
|
|
169
|
+
if "self" in caller_frame.f_locals:
|
|
170
|
+
module_name = type(caller_frame.f_locals["self"]).__name__
|
|
171
|
+
elif "cls" in caller_frame.f_locals:
|
|
172
|
+
module_name = caller_frame.f_locals["cls"].__name__
|
|
173
|
+
else:
|
|
174
|
+
module_name = ""
|
|
175
|
+
except Exception:
|
|
176
|
+
function_name = ""
|
|
177
|
+
module_name = ""
|
|
178
|
+
|
|
179
|
+
specific_component = (
|
|
180
|
+
f"{module_name}.{function_name}" if module_name and function_name else ""
|
|
181
|
+
)
|
|
182
|
+
|
|
183
|
+
return specific_component
|
|
@@ -349,8 +349,12 @@ class ActionsService(FolderContext, BaseService):
|
|
|
349
349
|
raise Exception("appName or appKey is required")
|
|
350
350
|
spec = _retrieve_app_key_spec(app_name=app_name)
|
|
351
351
|
|
|
352
|
-
response = await self.
|
|
353
|
-
spec.method,
|
|
352
|
+
response = await self.request_async(
|
|
353
|
+
spec.method,
|
|
354
|
+
spec.endpoint,
|
|
355
|
+
params=spec.params,
|
|
356
|
+
headers=spec.headers,
|
|
357
|
+
scoped="org",
|
|
354
358
|
)
|
|
355
359
|
try:
|
|
356
360
|
deployed_app = self._extract_deployed_app(
|
|
@@ -382,8 +386,12 @@ class ActionsService(FolderContext, BaseService):
|
|
|
382
386
|
|
|
383
387
|
spec = _retrieve_app_key_spec(app_name=app_name)
|
|
384
388
|
|
|
385
|
-
response = self.
|
|
386
|
-
spec.method,
|
|
389
|
+
response = self.request(
|
|
390
|
+
spec.method,
|
|
391
|
+
spec.endpoint,
|
|
392
|
+
params=spec.params,
|
|
393
|
+
headers=spec.headers,
|
|
394
|
+
scoped="org",
|
|
387
395
|
)
|
|
388
396
|
|
|
389
397
|
try:
|
|
@@ -28,7 +28,7 @@ class ApiClient(FolderContext, BaseService):
|
|
|
28
28
|
) -> Response:
|
|
29
29
|
if kwargs.get("include_folder_headers", False):
|
|
30
30
|
kwargs["headers"] = {
|
|
31
|
-
**kwargs.get("headers", self.
|
|
31
|
+
**kwargs.get("headers", self._client.headers),
|
|
32
32
|
**self.folder_headers,
|
|
33
33
|
}
|
|
34
34
|
|
|
@@ -45,7 +45,7 @@ class ApiClient(FolderContext, BaseService):
|
|
|
45
45
|
) -> Response:
|
|
46
46
|
if kwargs.get("include_folder_headers", False):
|
|
47
47
|
kwargs["headers"] = {
|
|
48
|
-
**kwargs.get("headers", self.
|
|
48
|
+
**kwargs.get("headers", self._client_async.headers),
|
|
49
49
|
**self.folder_headers,
|
|
50
50
|
}
|
|
51
51
|
|
|
@@ -53,37 +53,3 @@ class ApiClient(FolderContext, BaseService):
|
|
|
53
53
|
del kwargs["include_folder_headers"]
|
|
54
54
|
|
|
55
55
|
return await super().request_async(method, url, **kwargs)
|
|
56
|
-
|
|
57
|
-
def request_org_scope(
|
|
58
|
-
self,
|
|
59
|
-
method: str,
|
|
60
|
-
url: Union[URL, str],
|
|
61
|
-
**kwargs: Any,
|
|
62
|
-
) -> Response:
|
|
63
|
-
if kwargs.get("include_folder_headers", False):
|
|
64
|
-
kwargs["headers"] = {
|
|
65
|
-
**kwargs.get("headers", self._org_scope_client.headers),
|
|
66
|
-
**self.folder_headers,
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
if "include_folder_headers" in kwargs:
|
|
70
|
-
del kwargs["include_folder_headers"]
|
|
71
|
-
|
|
72
|
-
return super().request_org_scope(method, url, **kwargs)
|
|
73
|
-
|
|
74
|
-
async def request_org_scope_async(
|
|
75
|
-
self,
|
|
76
|
-
method: str,
|
|
77
|
-
url: Union[URL, str],
|
|
78
|
-
**kwargs: Any,
|
|
79
|
-
) -> Response:
|
|
80
|
-
if kwargs.get("include_folder_headers", False):
|
|
81
|
-
kwargs["headers"] = {
|
|
82
|
-
**kwargs.get("headers", self._org_scope_client_async.headers),
|
|
83
|
-
**self.folder_headers,
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
if "include_folder_headers" in kwargs:
|
|
87
|
-
del kwargs["include_folder_headers"]
|
|
88
|
-
|
|
89
|
-
return await super().request_org_scope_async(method, url, **kwargs)
|