Skip to content

Commit 3225f41

Browse files
committed
bump to python 3.11 and updated test requirements
1 parent 4ddfefc commit 3225f41

File tree

4 files changed

+14
-8
lines changed

4 files changed

+14
-8
lines changed

.github/workflows/validate.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- uses: "actions/checkout@v2"
1919
- uses: "actions/setup-python@v1"
2020
with:
21-
python-version: "3.10"
21+
python-version: "3.11"
2222
- run: python3 -m pip install black
2323
- run: black .
2424

@@ -29,7 +29,7 @@ jobs:
2929
- uses: "actions/checkout@v2"
3030
- uses: "actions/setup-python@v1"
3131
with:
32-
python-version: "3.10"
32+
python-version: "3.11"
3333
- run: python3 -m pip install -r tests/requirements_test.txt
3434
- run: pytest --cov=custom_components
3535

@@ -40,7 +40,7 @@ jobs:
4040
- uses: "actions/checkout@v2"
4141
- uses: "actions/setup-python@v1"
4242
with:
43-
python-version: "3.10"
43+
python-version: "3.11"
4444
- run: python3 -m pip install -r tests/requirements_test.txt
4545
- run: pylint custom_components/pyscript/*.py tests/*.py
4646

@@ -51,6 +51,6 @@ jobs:
5151
- uses: "actions/checkout@v2"
5252
- uses: "actions/setup-python@v1"
5353
with:
54-
python-version: "3.10"
54+
python-version: "3.11"
5555
- run: python3 -m pip install -r tests/requirements_test.txt
5656
- run: mypy custom_components/pyscript/*.py tests/*.py

custom_components/pyscript/__init__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,12 +366,17 @@ async def hass_stop(event: HAEvent) -> None:
366366
async def async_unload_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> bool:
367367
"""Unload a config entry."""
368368
_LOGGER.info("Unloading all scripts")
369-
await unload_scripts()
369+
await unload_scripts(unload_all=True)
370370

371371
for unsub_listener in hass.data[DOMAIN][UNSUB_LISTENERS]:
372372
unsub_listener()
373373
hass.data[DOMAIN][UNSUB_LISTENERS] = []
374374

375+
# sync with waiter, and then tell waiter and reaper tasks to exit
376+
await Function.waiter_sync()
377+
await Function.waiter_stop()
378+
await Function.reaper_stop()
379+
375380
return True
376381

377382

setup.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ norecursedirs = .git
2020
log_level=INFO
2121
addopts =
2222
--strict-markers
23+
--asyncio-mode=auto
2324

2425
[flake8]
2526
exclude = .venv,.git,.tox,docs,venv,bin,lib,deps,build

tests/requirements_test.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
coverage==7.2.1
1+
coverage==7.2.4
22
croniter==1.3.8
33
watchdog==2.1.9
44
mock-open==1.4.0
55
mypy==1.3.0
66
pre-commit==3.2.1
7-
pytest==7.2.2
7+
pytest==7.3.1
88
pytest-cov==3.0.0
9-
pytest-homeassistant-custom-component==0.13.23
9+
pytest-homeassistant-custom-component==0.13.34
1010
pylint==2.17.4
1111
pylint-strict-informational==0.1

0 commit comments

Comments
 (0)