Skip to content

Commit 60b809a

Browse files
committed
build: prepare for Python 3.12, 3.13
- CI previously tested only on Python 3.11; updated to test 3.11, 3.12, 3.13. - asyncio.get_event_loop() behavior changed (Py 3.12+) - In Python 3.12, asyncio.get_event_loop() raises RuntimeError when no current event loop is set in the main thread. - Examples updated to explicitly create an event loop with asyncio.new_event_loop() and pass it to IntegrationAPI.
1 parent f10e1de commit 60b809a

File tree

6 files changed

+15
-8
lines changed

6 files changed

+15
-8
lines changed

.github/workflows/build.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,18 @@ permissions:
2020
jobs:
2121
test:
2222
runs-on: ubuntu-24.04
23+
strategy:
24+
matrix:
25+
python-version: ["3.11", "3.12", "3.13"]
2326
steps:
2427
- name: Checkout
2528
uses: actions/checkout@v5
2629

27-
- name: Set up Python
30+
- name: Set up Python ${{ matrix.python-version }}
2831
uses: actions/setup-python@v6
2932
with:
30-
python-version: "3.11"
33+
python-version: ${{ matrix.python-version }}
34+
cache: "pip"
3135

3236
- name: Install pip
3337
run: |

.github/workflows/python-code-format.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,18 @@ permissions:
2020
jobs:
2121
test:
2222
runs-on: ubuntu-24.04
23+
strategy:
24+
matrix:
25+
python-version: ["3.11", "3.12", "3.13"]
2326

2427
name: Check Python code formatting
2528
steps:
2629
- uses: actions/checkout@v5
2730

28-
- name: Set up Python
31+
- name: Set up Python ${{ matrix.python-version }}
2932
uses: actions/setup-python@v6
3033
with:
31-
python-version: "3.11"
34+
python-version: ${{ matrix.python-version }}
3235

3336
- name: Install dependencies
3437
run: |

examples/hello_integration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import ucapi
88

9-
loop = asyncio.get_event_loop()
9+
loop = asyncio.new_event_loop()
1010
api = ucapi.IntegrationAPI(loop)
1111

1212

examples/remote.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
create_ui_text,
2121
)
2222

23-
loop = asyncio.get_event_loop()
23+
loop = asyncio.new_event_loop()
2424
api = ucapi.IntegrationAPI(loop)
2525

2626
# Simple commands which are supported by this example remote-entity

examples/setup_flow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import ucapi
88

9-
loop = asyncio.get_event_loop()
9+
loop = asyncio.new_event_loop()
1010
api = ucapi.IntegrationAPI(loop)
1111

1212

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ classifiers = [
1818
"Topic :: Home Automation",
1919
"Programming Language :: Python :: 3.11",
2020
]
21-
requires-python = ">=3.10"
21+
requires-python = ">=3.11"
2222
dependencies = [
2323
"protobuf~=6.33.2",
2424
"pyee>=9.0",

0 commit comments

Comments
 (0)