Skip to content

Commit b148768

Browse files
authoredJan 5, 2023
Support python 3.11 (#157)
2 parents 5ddf1f2 + 82fc84d commit b148768

File tree

6 files changed

+38
-25
lines changed

6 files changed

+38
-25
lines changed
 

‎.github/workflows/ci.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ jobs:
1313
- "3.8"
1414
- "3.9"
1515
- "3.10"
16+
- "3.11"
1617
runs-on: ${{ matrix.os }}
1718

1819
steps:
@@ -49,7 +50,7 @@ jobs:
4950
- name: Set up Python
5051
uses: actions/setup-python@v4
5152
with:
52-
python-version: "3.10"
53+
python-version: "3.11"
5354

5455
- name: Install build dependencies
5556
run: |

‎RELEASE_NOTES.md

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## Summary
44

5+
The Frequenz SDK now supports Python 3.11.
6+
57
## Upgrading
68

79
## New Features

‎minimum-requirements-ci.txt

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# CI must ensure these dependency versions are supported
22
frequenz-api-microgrid==0.11.0
33
frequenz-channels==0.11.0
4-
google-api-python-client==2.15
5-
grpcio==1.47
6-
grpcio-tools==1.47
4+
google-api-python-client==2.71
5+
grpcio==1.51.1
6+
grpcio-tools==1.51.1
77
networkx==2.8
8-
pandas==1.3.5
9-
protobuf==3.20.2
10-
pyarrow==6.0.0
8+
pandas==1.5.2
9+
protobuf==4.21.12
10+
pyarrow==10.0.1
1111
pydantic==1.9.0
1212
sympy==1.10.1
1313
toml==0.10

‎pyproject.toml

+6-6
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ requires-python = ">= 3.8, < 4"
2727
dependencies = [
2828
"frequenz-api-microgrid >= 0.11.0, < 0.12.0",
2929
"frequenz-channels >= 0.11.0, < 0.12.0",
30-
"google-api-python-client >= 2.15, < 3",
31-
"grpcio >= 1.47, < 2",
32-
"grpcio-tools >= 1.47, < 2",
30+
"google-api-python-client >= 2.71, < 3",
31+
"grpcio >= 1.51.1, < 2",
32+
"grpcio-tools >= 1.51.1, < 2",
3333
"networkx >= 2.8, < 3",
34-
"pandas >= 1.3.5, < 2",
35-
"protobuf >= 3.20, < 4",
36-
"pyarrow >= 6.0.0, < 6.1",
34+
"pandas >= 1.5.2, < 2",
35+
"protobuf >= 4.21, < 5",
36+
"pyarrow >= 10.0.1, < 11",
3737
"pydantic >= 1.9",
3838
"sympy >= 1.10.1, < 2",
3939
"toml >= 0.10",

‎tests/actor/test_power_distributing.py

+20-10
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,8 @@ async def test_power_distributor_one_user(
266266
await client_handle.send(request)
267267

268268
done, pending = await asyncio.wait(
269-
[client_handle.receive()], timeout=SAFETY_TIMEOUT
269+
[asyncio.create_task(client_handle.receive())],
270+
timeout=SAFETY_TIMEOUT,
270271
)
271272
await distributor._stop() # type: ignore # pylint: disable=no-member
272273

@@ -337,7 +338,11 @@ async def test_power_distributor_two_users(
337338
await asyncio.gather(*[task1, task2])
338339

339340
done, pending = await asyncio.wait(
340-
[user1_handle.receive(), user2_handle.receive()], timeout=SAFETY_TIMEOUT
341+
[
342+
asyncio.create_task(user1_handle.receive()),
343+
asyncio.create_task(user2_handle.receive()),
344+
],
345+
timeout=SAFETY_TIMEOUT,
341346
)
342347
await distributor._stop() # type: ignore # pylint: disable=no-member
343348

@@ -394,7 +399,8 @@ async def test_power_distributor_invalid_battery_id(self) -> None:
394399
await user1_handle.send(request)
395400

396401
done, _ = await asyncio.wait(
397-
[user1_handle.receive()], timeout=SAFETY_TIMEOUT
402+
[asyncio.create_task(user1_handle.receive())],
403+
timeout=SAFETY_TIMEOUT,
398404
)
399405
await distributor._stop() # type: ignore # pylint: disable=no-member
400406

@@ -476,9 +482,9 @@ async def test_power_distributor_overlapping_batteries(self) -> None:
476482

477483
done, _ = await asyncio.wait(
478484
[
479-
user1_handle.receive(),
480-
user2_handle.receive(),
481-
user3_handle.receive(),
485+
asyncio.create_task(user1_handle.receive()),
486+
asyncio.create_task(user2_handle.receive()),
487+
asyncio.create_task(user3_handle.receive()),
482488
],
483489
timeout=SAFETY_TIMEOUT,
484490
)
@@ -552,7 +558,8 @@ async def test_power_distributor_one_user_adjust_power_consume(
552558
await user1_handle.send(request)
553559

554560
done, pending = await asyncio.wait(
555-
[user1_handle.receive()], timeout=SAFETY_TIMEOUT
561+
[asyncio.create_task(user1_handle.receive())],
562+
timeout=SAFETY_TIMEOUT,
556563
)
557564
await distributor._stop() # type: ignore # pylint: disable=no-member
558565

@@ -618,7 +625,8 @@ async def test_power_distributor_one_user_adjust_power_supply(
618625
await user1_handle.send(request)
619626

620627
done, pending = await asyncio.wait(
621-
[user1_handle.receive()], timeout=SAFETY_TIMEOUT
628+
[asyncio.create_task(user1_handle.receive())],
629+
timeout=SAFETY_TIMEOUT,
622630
)
623631
await distributor._stop() # type: ignore # pylint: disable=no-member
624632

@@ -684,7 +692,8 @@ async def test_power_distributor_one_user_adjust_power_success(
684692
await user1_handle.send(request)
685693

686694
done, pending = await asyncio.wait(
687-
[user1_handle.receive()], timeout=SAFETY_TIMEOUT
695+
[asyncio.create_task(user1_handle.receive())],
696+
timeout=SAFETY_TIMEOUT,
688697
)
689698
await distributor._stop() # type: ignore # pylint: disable=no-member
690699

@@ -743,7 +752,8 @@ async def test_not_all_batteries_are_working(
743752
await client_handle.send(request)
744753

745754
done, pending = await asyncio.wait(
746-
[client_handle.receive()], timeout=SAFETY_TIMEOUT
755+
[asyncio.create_task(client_handle.receive())],
756+
timeout=SAFETY_TIMEOUT,
747757
)
748758
await distributor._stop() # type: ignore # pylint: disable=no-member
749759

‎tests/microgrid/test_microgrid_api.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ async def test_microgrid_api(
115115
_microgrid.get()
116116

117117
tasks = [
118-
_microgrid.initialize("127.0.0.1", 10001),
119-
_microgrid.initialize("127.0.0.1", 10001),
118+
asyncio.create_task(_microgrid.initialize("127.0.0.1", 10001)),
119+
asyncio.create_task(_microgrid.initialize("127.0.0.1", 10001)),
120120
]
121121
initialize_task = asyncio.wait(tasks, return_when=ALL_COMPLETED)
122122

0 commit comments

Comments
 (0)
Please sign in to comment.