Skip to content
Merged
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
30 changes: 30 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Run linter on PR

on:
pull_request:
branches: [ master ]

jobs:
CheckLinting:
timeout-minutes: 5
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Install uv
run: |
curl -Ls https://astral.sh/uv/install.sh | sh
echo "$HOME/.cargo/bin" >> $GITHUB_PATH

- name: Create virtual environment and install dependencies
run: |
uv venv
source .venv/bin/activate
uv pip install -e ".[dev]"

- name: Lint
run: |
source .venv/bin/activate
make lint

6 changes: 0 additions & 6 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,6 @@ jobs:
source .venv/bin/activate
uv pip install -e ".[dev]"

- name: Lint
continue-on-error: true
run: |
source .venv/bin/activate
make lint

- name: Start prism
run: |
make prism-start
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

## Version 0.6.0 - 2026-01-27

- Add update_validation method
- Add get_validation_task method
- Add update_agent_run method
- Add create_hook_run method
- Add update_hook_run method
- Add update_action_run method
- Change input parameter name from validation_task_id to task_id in update_validation_task method

## Version 0.5.0 - 2026-01-16

- Add access_token and access_token_expiration as input arguments to Credentials constructor
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ prism-start:
--detach \
-p 4010:4010 \
stoplight/prism:5.5.0 mock -d -h 0.0.0.0 \
https://raw.githubusercontent.com/LucidtechAI/cradl-docs/master/static/oas.json \
https://public.cradl.ai/api/openapi.json \
> /tmp/prism.cid


Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "cradl"
version = "0.5.0"
version = "0.6.0"
description = "Python SDK for Cradl"
authors = [{ name = "Cradl", email = "hello@cradl.ai" }]
readme = "README.md"
Expand Down
11 changes: 7 additions & 4 deletions src/cradl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,13 @@

def transition_handler(f):
"""
Decorator used to manage transition states. The decorator assumes that the environment variables TRANSITION_ID and EXECUTION_ID exist,
and ensures that the transition execution is updated after the handler is invoked. The return value of the handler can either be a `result`
or a tuple `(result, status)`. If no status is provided, the handler is assumed to have run successfully. If the handler throws an exception,
the status of the transition execution will be set to 'failed'. Status must be one of 'succeeded', 'rejected', 'retry' or 'failed'.
Decorator used to manage transition states.
The decorator assumes that the environment variables TRANSITION_ID and EXECUTION_ID exist,
and ensures that the transition execution is updated after the handler is invoked.
The return value of the handler can either be a `result` or a tuple `(result, status)`.
If no status is provided, the handler is assumed to have run successfully. If the handler throws an exception,
the status of the transition execution will be set to 'failed'.
Status must be one of 'succeeded', 'rejected', 'retry' or 'failed'.

>>> @transition_handler
>>> def my_handler(las_client: las.Client, event: dict):
Expand Down
6 changes: 3 additions & 3 deletions src/cradl/backoff.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import functools
import time
from typing import Union, Type, Callable
from typing import Optional, Union, Type, Callable


def exponential_backoff(
exceptions: Union[tuple[Type[Exception]], Type[Exception]],
base_wait: int = 1,
max_time: float = None,
max_tries: int = None,
max_time: Optional[float] = None,
max_tries: Optional[int] = None,
rate: int = 2,
giveup: Callable = lambda e: False,
) -> Callable:
Expand Down
Loading