Skip to content

Commit 6de761c

Browse files
acrocasicoyle
authored andcommitted
Added support for python 3.14 and done some pending 3.9 removals (#916)
Signed-off-by: Albert Callarisa <albert@diagrid.io> Co-authored-by: Sam <sam@diagrid.io> (cherry picked from commit adbcf32)
1 parent 0f6e7f2 commit 6de761c

37 files changed

Lines changed: 97 additions & 104 deletions

File tree

.github/workflows/build-push-to-main.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
strategy:
3838
fail-fast: false
3939
matrix:
40-
python_ver: ["3.10", "3.11", "3.12", "3.13"]
40+
python_ver: ["3.10", "3.11", "3.12", "3.13", "3.14"]
4141
steps:
4242
- uses: actions/checkout@v6
4343
- name: Set up Python ${{ matrix.python_ver }}

.github/workflows/build-tag.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
strategy:
4444
fail-fast: false
4545
matrix:
46-
python_ver: ["3.10", "3.11", "3.12", "3.13"]
46+
python_ver: ["3.10", "3.11", "3.12", "3.13", "3.14"]
4747
steps:
4848
- uses: actions/checkout@v6
4949
- name: Set up Python ${{ matrix.python_ver }}

.github/workflows/build.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
strategy:
4444
fail-fast: false
4545
matrix:
46-
python_ver: ["3.10", "3.11", "3.12", "3.13"]
46+
python_ver: ["3.10", "3.11", "3.12", "3.13", "3.14"]
4747
steps:
4848
- uses: actions/checkout@v6
4949
- name: Set up Python ${{ matrix.python_ver }}

.github/workflows/validate_examples.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
strategy:
4949
fail-fast: false
5050
matrix:
51-
python_ver: ["3.10", "3.11", "3.12", "3.13"]
51+
python_ver: ["3.10", "3.11", "3.12", "3.13", "3.14"]
5252
steps:
5353
- name: Parse repository_dispatch payload
5454
if: github.event_name == 'repository_dispatch'

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ This includes the following packages:
3232
### Prerequisites
3333

3434
* [Install Dapr standalone mode](https://github.com/dapr/cli#install-dapr-on-your-local-machine-self-hosted)
35-
* [Install Python 3.9+](https://www.python.org/downloads/)
35+
* [Install Python 3.10+](https://www.python.org/downloads/)
3636

3737
### Install Dapr python sdk
3838

@@ -145,12 +145,10 @@ The generated files will be found in `docs/_build`.
145145

146146
```sh
147147
pip3 install -r tools/requirements.txt
148-
export DAPR_BRANCH=release-1.16 # Optional, defaults to master
148+
export DAPR_BRANCH=release-1.17 # Optional, defaults to master
149149
./tools/regen_grpcclient.sh
150150
```
151151

152-
> Note: The `grpcio-tools` version we're using doesn't support Python 3.13.
153-
154152
## Help & Feedback
155153

156154
Need help or have feedback on the SDK? Please open a GitHub issue or come chat with us in the `#python-sdk` channel of our Discord server ([click here to join](https://discord.gg/MySdVxrH)).

dapr/clients/grpc/_conversation_helpers.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
import inspect
1717
import random
1818
import string
19-
import types
2019
from dataclasses import fields, is_dataclass
2120
from enum import Enum
21+
from types import UnionType
2222
from typing import (
2323
Any,
2424
Callable,
@@ -37,10 +37,6 @@
3737

3838
from dapr.conf import settings
3939

40-
# Make mypy happy. Runtime handle: real class on 3.10+, else None.
41-
# TODO: Python 3.9 is about to be end-of-life, so we can drop this at some point next year (2026)
42-
UnionType: Any = getattr(types, 'UnionType', None)
43-
4440
# duplicated from conversation to avoid circular import
4541
Params = Union[Mapping[str, Any], Sequence[Any], None]
4642

@@ -857,9 +853,7 @@ def _coerce_literal(value: Any, lit_args: List[Any]) -> Any:
857853

858854
def _is_union(t) -> bool:
859855
origin = get_origin(t)
860-
if origin is Union:
861-
return True
862-
return UnionType is not None and origin is UnionType
856+
return origin is Union or origin is UnionType
863857

864858

865859
def _coerce_and_validate(value: Any, expected_type: Any) -> Any:

examples/configuration/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ It demonstrates the following APIs:
99
## Pre-requisites
1010

1111
- [Dapr CLI and initialized environment](https://docs.dapr.io/getting-started)
12-
- [Install Python 3.9+](https://www.python.org/downloads/)
12+
- [Install Python 3.10+](https://www.python.org/downloads/)
1313

1414
## Install Dapr python-SDK
1515

@@ -18,7 +18,7 @@ It demonstrates the following APIs:
1818
pip3 install dapr dapr-ext-grpc
1919
```
2020

21-
## Store the configuration in configurationstore
21+
## Store the configuration in configurationstore
2222
<!-- STEP
2323
name: Set configuration value
2424
expected_stdout_lines:
@@ -38,7 +38,7 @@ docker exec dapr_redis redis-cli SET orderId2 "200||1"
3838

3939
Change directory to this folder:
4040
```bash
41-
cd examples/configuration
41+
cd examples/configuration
4242
```
4343

4444
To run this example, use the following command:

examples/crypto/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ It creates a client using `DaprClient`, uses a local store defined in
1111
## Pre-requisites
1212

1313
- [Dapr CLI and initialized environment](https://docs.dapr.io/getting-started)
14-
- [Install Python 3.9+](https://www.python.org/downloads/)
14+
- [Install Python 3.10+](https://www.python.org/downloads/)
1515

1616
> In order to run this sample, make sure that OpenSSL is available on your system.
1717

examples/demo_actor/README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ This document describes how to create an Actor(DemoActor) and invoke its methods
1111
## Pre-requisites
1212

1313
- [Dapr CLI and initialized environment](https://docs.dapr.io/getting-started)
14-
- [Install Python 3.9+](https://www.python.org/downloads/)
14+
- [Install Python 3.10+](https://www.python.org/downloads/)
1515

1616
### Install requirements
1717

@@ -138,7 +138,7 @@ expected_stdout_lines:
138138
139139
2. Follow [these steps](https://docs.dapr.io/getting-started/tutorials/configure-state-pubsub/#step-1-create-a-redis-store) to create a Redis store.
140140

141-
3. Once your store is created, confirm validate `redis.yml` file in the `deploy` directory.
141+
3. Once your store is created, confirm validate `redis.yml` file in the `deploy` directory.
142142
> **Note:** the `redis.yml` uses the secret created by `bitmany/redis` Helm chat to securely inject the password.
143143
144144
4. Apply the `redis.yml` file: `kubectl apply -f ./deploy/redis.yml` and observe that your state store was successfully configured!
@@ -162,17 +162,17 @@ expected_stdout_lines:
162162
```
163163
dapr logs -a demoactor -k
164164
```
165-
165+
166166
Logs for actor service app:
167167
```
168168
kubectl logs -l app="demoactor" -c demoactor
169169
```
170-
170+
171171
Logs for actor client sidecar:
172172
```
173173
dapr logs -a demoactor-client -k
174174
```
175-
175+
176176
Logs for actor service app:
177177
```
178178
kubectl logs -l app="demoactor-client" -c demoactor-client
@@ -209,9 +209,9 @@ timeout_seconds: 60
209209
cd demo_actor
210210
python -m unittest test_demo_actor.py
211211
```
212-
212+
213213
Expected output (note that the unit test print outputs might not necessarily be in this order - what really matters is that all tests pass anyway):
214-
214+
215215
```
216216
set_my_data: {'state': 5}
217217
has_value: True
@@ -226,7 +226,7 @@ timeout_seconds: 60
226226
has_value: True
227227
----------------------------------------------------------------------
228228
Ran 5 tests in 0.052s
229-
229+
230230
OK
231231
```
232232

examples/demo_actor/demo_actor/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
# See the License for the specific language governing permissions and
1010
# limitations under the License.
1111

12-
FROM python:3.9-slim-buster
12+
FROM python:3.10-slim-buster
1313

1414
WORKDIR /app
15-
COPY . .
15+
COPY . .
1616

1717
RUN pip install -r requirements.txt
1818

0 commit comments

Comments
 (0)