Skip to content

Commit cc005ae

Browse files
committed
Bump durabletask version, fix metadata
1 parent 209443e commit cc005ae

File tree

4 files changed

+132
-2
lines changed

4 files changed

+132
-2
lines changed
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
name: Durable Task Scheduler SDK (durabletask-azurefunctions)
2+
3+
on:
4+
push:
5+
branches:
6+
- "main"
7+
tags:
8+
- "azurefunctions-v*" # Only run for tags starting with "azurefunctions-v"
9+
pull_request:
10+
branches:
11+
- "main"
12+
13+
jobs:
14+
lint:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
- name: Set up Python 3.14
19+
uses: actions/setup-python@v5
20+
with:
21+
python-version: 3.14
22+
- name: Install dependencies
23+
working-directory: durabletask-azurefunctions
24+
run: |
25+
python -m pip install --upgrade pip
26+
pip install setuptools wheel tox
27+
pip install flake8
28+
- name: Run flake8 Linter
29+
working-directory: durabletask-azurefunctions
30+
run: flake8 .
31+
- name: Run flake8 Linter
32+
working-directory: tests/durabletask-azurefunctions
33+
run: flake8 .
34+
35+
run-docker-tests:
36+
strategy:
37+
fail-fast: false
38+
matrix:
39+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
40+
env:
41+
EMULATOR_VERSION: "latest"
42+
needs: lint
43+
runs-on: ubuntu-latest
44+
steps:
45+
- name: Checkout repository
46+
uses: actions/checkout@v4
47+
48+
- name: Pull Docker image
49+
run: docker pull mcr.microsoft.com/dts/dts-emulator:$EMULATOR_VERSION
50+
51+
- name: Run Docker container
52+
run: |
53+
docker run --name dtsemulator -d -p 8080:8080 mcr.microsoft.com/dts/dts-emulator:$EMULATOR_VERSION
54+
55+
- name: Wait for container to be ready
56+
run: sleep 10 # Adjust if your service needs more time to start
57+
58+
- name: Set environment variables
59+
run: |
60+
echo "TASKHUB=default" >> $GITHUB_ENV
61+
echo "ENDPOINT=http://localhost:8080" >> $GITHUB_ENV
62+
63+
- name: Install durabletask dependencies
64+
run: |
65+
python -m pip install --upgrade pip
66+
pip install flake8 pytest
67+
pip install -r requirements.txt
68+
69+
- name: Install durabletask-azurefunctions dependencies
70+
working-directory: examples
71+
run: |
72+
python -m pip install --upgrade pip
73+
pip install -r requirements.txt
74+
75+
- name: Install durabletask-azurefunctions locally
76+
working-directory: durabletask-azurefunctions
77+
run: |
78+
pip install . --no-deps --force-reinstall
79+
80+
- name: Install durabletask locally
81+
run: |
82+
pip install . --no-deps --force-reinstall
83+
84+
- name: Run the tests
85+
working-directory: tests/durabletask-azurefunctions
86+
run: |
87+
pytest -m "dts" --verbose
88+
89+
publish:
90+
if: startsWith(github.ref, 'refs/tags/azurefunctions-v') # Only run if a matching tag is pushed
91+
needs: run-docker-tests
92+
runs-on: ubuntu-latest
93+
steps:
94+
- name: Checkout code
95+
uses: actions/checkout@v4
96+
97+
- name: Extract version from tag
98+
run: echo "VERSION=${GITHUB_REF#refs/tags/azurefunctions-v}" >> $GITHUB_ENV # Extract version from the tag
99+
100+
- name: Set up Python
101+
uses: actions/setup-python@v5
102+
with:
103+
python-version: "3.14" # Adjust Python version as needed
104+
105+
- name: Install dependencies
106+
run: |
107+
python -m pip install --upgrade pip
108+
pip install build twine
109+
110+
- name: Build package from directory durabletask-azurefunctions
111+
working-directory: durabletask-azurefunctions
112+
run: |
113+
python -m build
114+
115+
- name: Check package
116+
working-directory: durabletask-azurefunctions
117+
run: |
118+
twine check dist/*
119+
120+
- name: Publish package to PyPI
121+
env:
122+
TWINE_USERNAME: __token__
123+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN_AZUREFUNCTIONS }} # Store your PyPI API token in GitHub Secrets
124+
working-directory: durabletask-azurefunctions
125+
run: |
126+
twine upload dist/*

durabletask-azurefunctions/durabletask/azurefunctions/decorators/metadata.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ def __init__(self,
3131
durable_requires_grpc=True,
3232
) -> None:
3333
self.orchestration = orchestration
34+
self.durable_requires_grpc = durable_requires_grpc
3435
super().__init__(name=name)
3536

3637

@@ -57,6 +58,7 @@ def __init__(self,
5758
durable_requires_grpc=True,
5859
) -> None:
5960
self.activity = activity
61+
self.durable_requires_grpc = durable_requires_grpc
6062
super().__init__(name=name)
6163

6264

@@ -83,6 +85,7 @@ def __init__(self,
8385
durable_requires_grpc=True,
8486
) -> None:
8587
self.entity_name = entity_name
88+
self.durable_requires_grpc = durable_requires_grpc
8689
super().__init__(name=name)
8790

8891

@@ -111,4 +114,5 @@ def __init__(self,
111114
) -> None:
112115
self.task_hub = task_hub
113116
self.connection_name = connection_name
117+
self.durable_requires_grpc = durable_requires_grpc
114118
super().__init__(name=name)

durabletask-azurefunctions/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ requires-python = ">=3.9"
2727
license = {file = "LICENSE"}
2828
readme = "README.md"
2929
dependencies = [
30-
"durabletask>=0.5.0",
30+
"durabletask>=1.2.0dev0",
3131
"azure-identity>=1.19.0",
3232
"azure-functions>=1.11.0"
3333
]

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ build-backend = "setuptools.build_meta"
99

1010
[project]
1111
name = "durabletask"
12-
version = "1.0.0"
12+
version = "1.2.0dev0"
1313
description = "A Durable Task Client SDK for Python"
1414
keywords = [
1515
"durable",

0 commit comments

Comments
 (0)