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
19 changes: 9 additions & 10 deletions .github/workflows/python-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Python Test
on:
push:
branches:
- main
- master
- release/*
pull_request:
Expand All @@ -12,16 +13,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
python-version: '3.10'
enable-cache: true
- name: Set up Python
run: uv python install 3.10
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .
run: uv sync --frozen --extra dev
- name: Run tests
run: |
cd tests/release/integration
python -m unittest test_wrapper.py
run: uv run --project ${{ github.workspace }} python -m pytest tests -v
63 changes: 63 additions & 0 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Development

This project uses [`uv`](https://docs.astral.sh/uv/) for dependency management and packaging.

## Prerequisites

Install uv (see the [official installation guide](https://docs.astral.sh/uv/getting-started/installation/)):

```sh
# macOS / Linux
curl -LsSf https://astral.sh/uv/install.sh | sh

# Windows (PowerShell)
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
```

## Set up a dev environment

```sh
# Installs runtime + dev dependencies into a managed virtual environment
uv sync --extra dev
```

## Build

The wheel packages the `digitalai` tree.

```sh
# Build both sdist and wheel into ./dist
uv build

# Or build a single artifact
uv build --wheel
uv build --sdist
```

## Run tests

```sh
# Run the tests
cd tests/release/integration
uv run python -m unittest test_wrapper.py
```

## Publish to PyPI

```sh
# Publish the distribution (uploads everything in dist/ to PyPI)
uv publish --token <pypi-token>
```

## Dependency management

```sh
# Add a runtime dependency
uv add <package>

# Add a development-only dependency
uv add --dev <package>

# Update the lockfile
uv lock
```
22 changes: 18 additions & 4 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,7 +1,21 @@
Copyright 2023 Digital.ai
MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
Copyright (c) 2026 Digital.ai

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
47 changes: 34 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ The **Digital.ai Release Python SDK** (`digitalai-release-sdk`) provides a set o

## Features
- Define custom tasks using the `BaseTask` abstract class.
- Subclass `ApiBaseTask` to get every Release v1 API as a cached property (`releaseApi`, `phaseApi`, `taskApi`, ...), all sharing one pre-configured client built from the task's "Run as user" context.
- Easily manage input and output properties.
- Interact with the Digital.ai Release environment seamlessly.
- Simplified API client for efficient communication with Release API.


## Installation
Expand All @@ -16,6 +16,8 @@ Install the SDK using `pip`:
pip install digitalai-release-sdk
```

> **Note:** The SDK depends on [`digitalai-release-api-client`](https://pypi.org/project/digitalai-release-api-client/), which is installed automatically.

## Getting Started

### Example Task: `hello.py`
Expand Down Expand Up @@ -43,27 +45,46 @@ class Hello(BaseTask):
self.set_output_property('greeting', greeting)
```

## Changelog
### Example Task using the Release API: `ApiBaseTask`

### Version 26.1.0
Subclass `ApiBaseTask` to call the Release v1 REST API without building a client
yourself. Every API is exposed as a lazily created, cached property, all sharing
a single client built from the task's "Run as user" context:

#### 🛠️ Enhancements
```python
from digitalai.release.integration.api_base_task import ApiBaseTask

- Updated minimum Python version requirement to **3.10**.
- Updated dependency versions to enhance compatibility and security.
- Added support for the **scriptLocation** hidden property to explicitly define the task script path, improving performance and file organization.

---
class ShowVersion(ApiBaseTask):

def execute(self) -> None:
release = self.releaseApi.getRelease(self.get_release_id())
self.add_comment(f"Working on {release.title}")
```

## 🔗 Related Resources

- 🧪 **Python Template Project**: [release-integration-template-python](https://github.com/digital-ai/release-integration-template-python)
- **[Digital.ai Python SDK Documentation](https://docs.digital.ai/release/docs/how-to/overview-python-sdk)**:
Comprehensive guide to using the Python SDK and building custom tasks.

- **[SDK Template Project for integration plugins](https://github.com/digital-ai/release-integration-template-python)**:
A starting point for building custom integrations using Digital.ai Release and Python.

- 📘 **Official Documentation**: [Digital.ai Release Python SDK Docs](https://docs.digital.ai/release/docs/category/python-sdk)
Comprehensive guide to using the Python SDK and building custom tasks.
- **[Digital.ai Release Python SDK](https://pypi.org/project/digitalai-release-sdk/)**:
The official SDK package for integrating with Digital.ai Release on Pypi.


## Changelog

- 📦 **Digital.ai Release Python SDK**: [digitalai-release-sdk on PyPI](https://pypi.org/project/digitalai-release-sdk/)
The official SDK package for integrating with Digital.ai Release.
### Version 26.3.0 (Beta)

#### 🚀 Features

- Added the `ApiBaseTask` base class, exposing every Release v1 API as a lazily created, cached property.
- `get_release_api_client()` now supports optional credentials/server URL and `requests` library arguments.
- Added `get_phase_id()` and `get_folder_id()` helper methods to `BaseTask`.

#### 🛠️ Enhancements

- Improved stability and error handling for API requests and Kubernetes tasks.

1 change: 1 addition & 0 deletions digitalai/release/integration/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from .base_task import BaseTask
from .api_base_task import ApiBaseTask
from .input_context import InputContext
from .output_context import OutputContext
from .exceptions import AbortException
Expand Down
Loading
Loading