Skip to content

Commit

Permalink
bump to python 3.11 and updated test requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
craigbarratt committed Jun 4, 2023
1 parent 4ddfefc commit 3225f41
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- uses: "actions/checkout@v2"
- uses: "actions/setup-python@v1"
with:
python-version: "3.10"
python-version: "3.11"
- run: python3 -m pip install black
- run: black .

Expand All @@ -29,7 +29,7 @@ jobs:
- uses: "actions/checkout@v2"
- uses: "actions/setup-python@v1"
with:
python-version: "3.10"
python-version: "3.11"
- run: python3 -m pip install -r tests/requirements_test.txt
- run: pytest --cov=custom_components

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

Expand All @@ -51,6 +51,6 @@ jobs:
- uses: "actions/checkout@v2"
- uses: "actions/setup-python@v1"
with:
python-version: "3.10"
python-version: "3.11"
- run: python3 -m pip install -r tests/requirements_test.txt
- run: mypy custom_components/pyscript/*.py tests/*.py
7 changes: 6 additions & 1 deletion custom_components/pyscript/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,12 +366,17 @@ async def hass_stop(event: HAEvent) -> None:
async def async_unload_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> bool:
"""Unload a config entry."""
_LOGGER.info("Unloading all scripts")
await unload_scripts()
await unload_scripts(unload_all=True)

for unsub_listener in hass.data[DOMAIN][UNSUB_LISTENERS]:
unsub_listener()
hass.data[DOMAIN][UNSUB_LISTENERS] = []

# sync with waiter, and then tell waiter and reaper tasks to exit
await Function.waiter_sync()
await Function.waiter_stop()
await Function.reaper_stop()

return True


Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ norecursedirs = .git
log_level=INFO
addopts =
--strict-markers
--asyncio-mode=auto

[flake8]
exclude = .venv,.git,.tox,docs,venv,bin,lib,deps,build
Expand Down
6 changes: 3 additions & 3 deletions tests/requirements_test.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
coverage==7.2.1
coverage==7.2.4
croniter==1.3.8
watchdog==2.1.9
mock-open==1.4.0
mypy==1.3.0
pre-commit==3.2.1
pytest==7.2.2
pytest==7.3.1
pytest-cov==3.0.0
pytest-homeassistant-custom-component==0.13.23
pytest-homeassistant-custom-component==0.13.34
pylint==2.17.4
pylint-strict-informational==0.1

0 comments on commit 3225f41

Please sign in to comment.