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
7 changes: 7 additions & 0 deletions .github/workflows/build-push-to-main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,10 @@ jobs:
cd ext/dapr-ext-strands
python setup.py sdist bdist_wheel
twine upload dist/*
- name: Build and publish DurableTask Python
env:
TWINE_PASSWORD: ${{ secrets.PYPI_UPLOAD_PASS }}
run: |
cd durabletask
python -m build
twine upload dist/*
8 changes: 8 additions & 0 deletions .github/workflows/build-tag.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,11 @@ jobs:
cd ext/dapr-ext-strands
python setup.py sdist bdist_wheel
twine upload dist/*
- name: Build and publish DurableTask Python
if: startsWith(github.ref_name, 'durabletask-v')
env:
TWINE_PASSWORD: ${{ secrets.PYPI_UPLOAD_PASS }}
run: |
cd durabletask
python -m build
twine upload dist/*
21 changes: 20 additions & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
run: |
tox -e ruff
statusResult=$(git status -u --porcelain)
if [ -z $statusResult ]
if [ -z "$statusResult" ]
then
exit 0
else
Expand Down Expand Up @@ -62,3 +62,22 @@ jobs:
tox -e py`echo "${{ matrix.python_ver }}" | sed 's/\.//g'`
- name: Upload test coverage
uses: codecov/codecov-action@v5
# Sidecar for running e2e tests requires Go SDK
- name: Install Go SDK for DurableTask Python checks
uses: actions/setup-go@v5
with:
go-version: 'stable'
# Install and run the durabletask-go sidecar for running e2e tests
- name: Pytest e2e tests for DurableTask Python
run: |
# TODO: use dapr run instead of durabletask-go as it provides a more reliable sidecar behavior for e2e tests
go install github.com/dapr/durabletask-go@main
durabletask-go --port 4001 &
pip install -e durabletask[dev]
pytest -m e2e durabletask_tests/
- name: Run examples
run: |
pip install mechanical-markdown
cd durabletask_examples
durabletask-go --port 4001 &
mm.py README.md
73 changes: 73 additions & 0 deletions .github/workflows/durabletask-validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: DurableTask Python Build Validation
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't durabletask be tested in the same steps as everything else?


on:
push:
branches: [ "main" ]
tags: ["v*"]
pull_request:
branches: [ "main" ]

jobs:
build:

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e durabletask[dev]
- name: Lint with ruff
run: |
ruff check durabletask/ durabletask_tests/
- name: Pytest unit tests
run: |
pytest -m "not e2e" durabletask_tests/
# Sidecar for running e2e tests requires Go SDK
- name: Install Go SDK
uses: actions/setup-go@v5
with:
go-version: 'stable'
# Install and run the durabletask-go sidecar for running e2e tests
- name: Pytest e2e tests
run: |
# TODO: use dapr run instead of durabletask-go as it provides a more reliable sidecar behavior for e2e tests
go install github.com/dapr/durabletask-go@main
durabletask-go --port 4001 &
pytest -m e2e durabletask_tests/
- name: Run examples
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should happen as part of the validate_examples step

run: |
pip install mechanical-markdown
cd durabletask_examples
durabletask-go --port 4001 &
mm.py README.md
publish:
needs: build
if: startswith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
env:
TWINE_USERNAME: "__token__"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine build
13 changes: 9 additions & 4 deletions .github/workflows/validate_examples.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,25 +58,30 @@ jobs:
with:
repository: ${{ env.CHECKOUT_REPO }}
ref: ${{ env.CHECKOUT_REF }}
- name: Determine latest Dapr Runtime version (including prerelease)
- name: Determine latest Dapr Runtime version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
MIN_RUNTIME_VERSION="1.17.0"
RUNTIME_VERSION=$(curl -fsS -H "Authorization: Bearer $GITHUB_TOKEN" \
"https://api.github.com/repos/dapr/dapr/releases?per_page=10" | \
jq -r 'sort_by(.created_at) | reverse | .[0].tag_name | ltrimstr("v")')
jq -r 'map(select(.prerelease == false)) | sort_by(.created_at) | reverse | .[0].tag_name | ltrimstr("v")')
if [ -z "$RUNTIME_VERSION" ] || [ "$RUNTIME_VERSION" = "null" ]; then
echo "Failed to resolve Dapr Runtime version" && exit 1
fi
if [ "$(printf '%s\n' "$MIN_RUNTIME_VERSION" "$RUNTIME_VERSION" | sort -V | head -n1)" != "$MIN_RUNTIME_VERSION" ]; then
echo "Resolved runtime version $RUNTIME_VERSION is below minimum $MIN_RUNTIME_VERSION, using minimum instead"
RUNTIME_VERSION="$MIN_RUNTIME_VERSION"
fi
echo "DAPR_RUNTIME_VER=$RUNTIME_VERSION" >> $GITHUB_ENV
echo "Found $RUNTIME_VERSION"
- name: Determine latest Dapr CLI version (including prerelease)
- name: Determine latest Dapr CLI version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
CLI_VERSION=$(curl -fsS -H "Authorization: Bearer $GITHUB_TOKEN" \
"https://api.github.com/repos/dapr/cli/releases?per_page=10" | \
jq -r 'sort_by(.created_at) | reverse | .[0].tag_name | ltrimstr("v")')
jq -r 'map(select(.prerelease == false)) | sort_by(.created_at) | reverse | .[0].tag_name | ltrimstr("v")')
if [ -z "$CLI_VERSION" ] || [ "$CLI_VERSION" = "null" ]; then
echo "Failed to resolve Dapr CLI version" && exit 1
fi
Expand Down
37 changes: 32 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
Expand All @@ -38,19 +40,17 @@ pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Editor config
.idea
.vscode

# Translations
*.mo
*.pot
Expand All @@ -59,6 +59,7 @@ coverage.xml
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
Expand All @@ -76,11 +77,26 @@ target/
# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# celery beat schedule file
# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py
Expand All @@ -106,6 +122,17 @@ venv.bak/

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# IDEs
.idea
.vscode

coverage.lcov

# macOS specific files
.DS_Store
86 changes: 86 additions & 0 deletions durabletask/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## v0.3.0

### New

- Added `ConcurrencyOptions` class for fine-grained concurrency control with separate limits for activities and orchestrations. The thread pool worker count can also be configured.

### Fixed

- Fixed an issue where a worker could not recover after its connection was interrupted or severed

## v0.2.1

### New

- Added `set_custom_status` orchestrator API ([#31](https://github.com/microsoft/durabletask-python/pull/31)) - contributed by [@famarting](https://github.com/famarting)
- Added `purge_orchestration` client API ([#34](https://github.com/microsoft/durabletask-python/pull/34)) - contributed by [@famarting](https://github.com/famarting)

### Changes

- Protos are compiled with gRPC 1.62.3 / protobuf 3.25.X instead of the latest release. This ensures compatibility with a wider range of grpcio versions for better compatibility with other packages / libraries ([#36](https://github.com/microsoft/durabletask-python/pull/36)) - by [@berndverst](https://github.com/berndverst)
- Http and grpc protocols and their secure variants are stripped from the host name parameter if provided. Secure mode is enabled if the protocol provided is https or grpcs ([#38](https://github.com/microsoft/durabletask-python/pull/38) - by [@berndverst)(https://github.com/berndverst)
- Improve ProtoGen by downloading proto file directly instead of using submodule ([#39](https://github.com/microsoft/durabletask-python/pull/39) - by [@berndverst](https://github.com/berndverst)

### Updates

- Updated `durabletask-protobuf` submodule reference to latest

## v0.1.1a1

### New

- Add recursive flag in terminate_orchestration to support cascade terminate ([#27](https://github.com/microsoft/durabletask-python/pull/27)) - contributed by [@shivamkm07](https://github.com/shivamkm07)

## v0.1.0

### New

- Retry policies for activities and sub-orchestrations ([#11](https://github.com/microsoft/durabletask-python/pull/11)) - contributed by [@DeepanshuA](https://github.com/DeepanshuA)

### Fixed

- Fix try/except in orchestrator functions not being handled correctly ([#21](https://github.com/microsoft/durabletask-python/pull/21)) - by [@cgillum](https://github.com/cgillum)
- Updated `durabletask-protobuf` submodule reference to latest distributed tracing commit - by [@cgillum](https://github.com/cgillum)

## v0.1.0a5

### New

- Adds support for secure channels ([#18](https://github.com/microsoft/durabletask-python/pull/18)) - contributed by [@elena-kolevska](https://github.com/elena-kolevska)

### Fixed

- Fix zero argument values sent to activities as None ([#13](https://github.com/microsoft/durabletask-python/pull/13)) - contributed by [@DeepanshuA](https://github.com/DeepanshuA)

## v0.1.0a3

### New

- Add gRPC metadata option ([#16](https://github.com/microsoft/durabletask-python/pull/16)) - contributed by [@DeepanshuA](https://github.com/DeepanshuA)

### Changes

- Removed Python 3.7 support due to EOL ([#14](https://github.com/microsoft/durabletask-python/pull/14)) - contributed by [@berndverst](https://github.com/berndverst)

## v0.1.0a2

### New

- Continue-as-new ([#9](https://github.com/microsoft/durabletask-python/pull/9))
- Support for Python 3.7+ ([#10](https://github.com/microsoft/durabletask-python/pull/10)) - contributed by [@DeepanshuA](https://github.com/DeepanshuA)

## v0.1.0a1

Initial release, which includes the following features:

- Orchestrations and activities
- Durable timers
- Sub-orchestrations
- Suspend, resume, and terminate client operations
21 changes: 21 additions & 0 deletions durabletask/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) Microsoft Corporation.

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 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
Loading
Loading