Skip to content

Commit dcf2058

Browse files
authored
Compatible with 3.7 onwards (#10)
1 parent dfa6fe0 commit dcf2058

4 files changed

Lines changed: 11 additions & 10 deletions

File tree

.github/workflows/pr-validation.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
strategy:
1717
fail-fast: false
1818
matrix:
19-
python-version: ["3.9","3.10", "3.11"]
19+
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
2020

2121
steps:
2222
- uses: actions/checkout@v3
@@ -32,6 +32,7 @@ jobs:
3232
- name: Lint with flake8
3333
run: |
3434
flake8 . --count --show-source --statistics --exit-zero
35+
if: matrix.python-version != '3.7'
3536
- name: Pytest unit tests
3637
run: |
3738
pytest -m "not e2e" --verbose

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ Orchestrations can specify retry policies for activities and sub-orchestrations.
133133

134134
### Prerequisites
135135

136-
- Python 3.10 or higher
136+
- Python 3.7 or higher (Python 3.8 or higher is recommended when running tests or making contributions)
137137
- A Durable Task-compatible sidecar, like [Dapr Workflow](https://docs.dapr.io/developing-applications/building-blocks/workflow/workflow-overview/)
138138

139139
### Installing the Durable Task Python client SDK

durabletask/worker.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ class _Registry:
2828
activities: Dict[str, task.Activity]
2929

3030
def __init__(self):
31-
self.orchestrators = dict[str, task.Orchestrator]()
32-
self.activities = dict[str, task.Activity]()
31+
self.orchestrators = {}
32+
self.activities = {}
3333

3434
def add_orchestrator(self, fn: task.Orchestrator) -> str:
3535
if fn is None:
@@ -228,8 +228,8 @@ def __init__(self, instance_id: str):
228228
self._is_replaying = True
229229
self._is_complete = False
230230
self._result = None
231-
self._pending_actions = dict[int, pb.OrchestratorAction]()
232-
self._pending_tasks = dict[int, task.CompletableTask]()
231+
self._pending_actions: Dict[int, pb.OrchestratorAction] = {}
232+
self._pending_tasks: Dict[int, task.CompletableTask] = {}
233233
self._sequence_number = 0
234234
self._current_utc_datetime = datetime(1000, 1, 1)
235235
self._instance_id = instance_id
@@ -736,7 +736,7 @@ def _get_new_event_summary(new_events: Sequence[pb.HistoryEvent]) -> str:
736736
elif len(new_events) == 1:
737737
return f"[{new_events[0].WhichOneof('eventType')}]"
738738
else:
739-
counts = dict[str, int]()
739+
counts: Dict[str, int] = {}
740740
for event in new_events:
741741
event_type = event.WhichOneof('eventType')
742742
counts[event_type] = counts.get(event_type, 0) + 1
@@ -750,7 +750,7 @@ def _get_action_summary(new_actions: Sequence[pb.OrchestratorAction]) -> str:
750750
elif len(new_actions) == 1:
751751
return f"[{new_actions[0].WhichOneof('orchestratorActionType')}]"
752752
else:
753-
counts = dict[str, int]()
753+
counts: Dict[str, int] = {}
754754
for action in new_actions:
755755
action_type = action.WhichOneof('orchestratorActionType')
756756
counts[action_type] = counts.get(action_type, 0) + 1

pyproject.toml

Lines changed: 2 additions & 2 deletions
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 = "0.1.0"
12+
version = "0.1.0-alpha.3"
1313
description = "A Durable Task Client SDK for Python"
1414
keywords = [
1515
"durable",
@@ -21,7 +21,7 @@ classifiers = [
2121
"Programming Language :: Python :: 3",
2222
"License :: OSI Approved :: MIT License",
2323
]
24-
requires-python = ">=3.9"
24+
requires-python = ">=3.7"
2525
license = {file = "LICENSE"}
2626
readme = "README.md"
2727
dependencies = [

0 commit comments

Comments
 (0)