Skip to content

Commit 4d8b557

Browse files
committed
Upgrade dependencies and fix issues
1 parent 0df29cc commit 4d8b557

File tree

6 files changed

+22
-21
lines changed

6 files changed

+22
-21
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.11"
21+
python-version: "3.12"
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.11"
32+
python-version: "3.12"
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.11"
43+
python-version: "3.12"
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.11"
54+
python-version: "3.12"
5555
- run: python3 -m pip install -r tests/requirements_test.txt
5656
- run: mypy custom_components/pyscript/*.py tests/*.py

custom_components/pyscript/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"homekit": {},
1111
"iot_class": "local_push",
1212
"issue_tracker": "https://github.com/custom-components/pyscript/issues",
13-
"requirements": ["croniter==2.0.2", "watchdog==2.3.1"],
13+
"requirements": ["croniter==2.0.5", "watchdog==4.0.1"],
1414
"ssdp": [],
1515
"version": "1.5.0",
1616
"zeroconf": []

tests/requirements_test.txt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
coverage==7.2.4
2-
croniter==1.3.8
3-
watchdog==2.1.9
1+
coverage==7.5.0
2+
croniter==2.0.5
3+
watchdog==4.0.1
44
mock-open==1.4.0
5-
mypy==1.3.0
6-
pre-commit==3.2.1
7-
pytest==7.3.1
8-
pytest-cov==3.0.0
9-
pytest-homeassistant-custom-component==0.13.45
10-
pylint==2.17.4
5+
mypy==1.10.0
6+
pre-commit==3.7.1
7+
pytest==8.2.0
8+
pytest-cov==5.0.0
9+
pytest-homeassistant-custom-component==0.13.135
10+
pylint==3.2.3
1111
pylint-strict-informational==0.1

tests/test_function.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from custom_components.pyscript.const import CONF_ALLOW_ALL_IMPORTS, CONF_HASS_IS_GLOBAL, DOMAIN, FOLDER
1414
from custom_components.pyscript.function import Function
1515
from homeassistant.const import EVENT_HOMEASSISTANT_STARTED, EVENT_STATE_CHANGED
16-
from homeassistant.core import Context
16+
from homeassistant.core import Context, ServiceRegistry
1717
from homeassistant.setup import async_setup_component
1818

1919

@@ -95,7 +95,7 @@ async def test_func_completions(
9595
@pytest.mark.asyncio
9696
async def test_service_completions(root, expected, hass, services): # pylint: disable=redefined-outer-name
9797
"""Test service name completion."""
98-
with patch.object(hass.services, "async_services", return_value=services), patch.object(
98+
with patch.object(ServiceRegistry, "async_services", return_value=services), patch.object(
9999
Function, "hass", hass
100100
):
101101
words = await Function.service_completions(root)
@@ -1247,10 +1247,10 @@ def service_call_exception():
12471247
@pytest.mark.asyncio
12481248
async def test_service_call_params(hass):
12491249
"""Test that hass params get set properly on service calls."""
1250-
with patch.object(hass.services, "async_call") as call, patch.object(
1250+
with patch.object(ServiceRegistry, "async_call") as call, patch.object(
12511251
Function, "service_has_service", return_value=True
12521252
), patch.object(
1253-
hass.services,
1253+
ServiceRegistry,
12541254
"supports_response",
12551255
return_value="none",
12561256
):

tests/test_state.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
from custom_components.pyscript.function import Function
88
from custom_components.pyscript.state import State
9-
from homeassistant.core import Context
9+
from homeassistant.core import Context, ServiceRegistry, StateMachine
1010
from homeassistant.helpers.state import State as HassState
1111

1212

@@ -20,8 +20,8 @@ async def test_service_call(hass):
2020
"test": {"description": None, "fields": {"entity_id": "blah", "other_service_data": "blah"}}
2121
}
2222
},
23-
), patch.object(hass.states, "get", return_value=HassState("test.entity", "True")), patch.object(
24-
hass.services, "async_call"
23+
), patch.object(StateMachine, "get", return_value=HassState("test.entity", "True")), patch.object(
24+
ServiceRegistry, "async_call"
2525
) as call:
2626
State.init(hass)
2727
Function.init(hass)

tests/test_unit_eval.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1458,6 +1458,7 @@ async def test_eval(hass):
14581458
"syntax error invalid syntax (<fstring>, line 1)", # < 3.9
14591459
"syntax error f-string: invalid syntax (test, line 1)", # >= 3.9
14601460
"syntax error f-string: invalid syntax. Perhaps you forgot a comma? (test, line 1)", # >= 3.10
1461+
"syntax error invalid syntax. Perhaps you forgot a comma? (test, line 1)", # >= 3.12
14611462
},
14621463
],
14631464
["del xx", "Exception in test line 1 column 0: name 'xx' is not defined"],

0 commit comments

Comments
 (0)