Skip to content

Commit

Permalink
Bump ruff from 0.8.6 to 0.9.2 (#1643)
Browse files Browse the repository at this point in the history
* Bump ruff from 0.8.6 to 0.9.2

Bumps [ruff](https://github.com/astral-sh/ruff) from 0.8.6 to 0.9.2.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](astral-sh/ruff@0.8.6...0.9.2)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* ignore `datetime` standard-lib module name shadowing

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: farmio <[email protected]>
  • Loading branch information
dependabot[bot] and farmio authored Jan 22, 2025
1 parent 9055a27 commit 1380dc2
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 19 deletions.
2 changes: 1 addition & 1 deletion examples/ip_secure_calculations.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ def main() -> None:
)
session_authenticate = bytes.fromhex(
"06 10 09 53 00 18 00 01"
"1f 1d 59 ea 9f 12 a1 52 e5 d9 72 7f 08 46 2c de" # MAC
+ "1f 1d 59 ea 9f 12 a1 52 e5 d9 72 7f 08 46 2c de" # MAC
)
mac_cbc_authenticate = calculate_message_authentication_code_cbc(
password_hash,
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -165,3 +165,6 @@ combine-as-imports = true
"RUF012",
"SLF", # private member access
] # Mutable class attributes should be annotated with `typing.ClassVar`

[tool.ruff.lint.flake8-builtins]
builtins-allowed-modules = ["datetime"]
2 changes: 1 addition & 1 deletion requirements/testing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pytest==8.3.4
pytest-asyncio==0.25.2
pytest-cov==6.0.0
pytest-icdiff==0.9
ruff==0.8.6
ruff==0.9.2
setuptools==75.8.0
tox==4.23.2
tox-gh-actions==3.2.0
11 changes: 7 additions & 4 deletions test/knxip_tests/connect_request_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,23 +126,26 @@ def test_from_knx_wrong_length_of_cri(self):
def test_from_knx_wrong_length_of_cri2(self):
"""Test parsing and streaming wrong ConnectRequest."""
raw = bytes.fromhex(
"06 10 02 05 00 18 08 01 C0 A8 2A 01 84 95 08 01 C0 A8 2A 01 CC A9 03 03"
"06 10 02 05 00 18 08 01 C0 A8 2A 01 84 95 08 01"
+ "C0 A8 2A 01 CC A9 03 03"
)
with pytest.raises(CouldNotParseKNXIP):
KNXIPFrame.from_knx(raw)

def test_from_knx_wrong_length_of_cri3(self):
"""Test parsing and streaming wrong ConnectRequest."""
raw = bytes.fromhex(
"06 10 02 05 00 18 08 01 C0 A8 2A 01 84 95 08 01 C0 A8 2A 01 CC A9 01 03"
"06 10 02 05 00 18 08 01 C0 A8 2A 01 84 95 08 01"
+ "C0 A8 2A 01 CC A9 01 03"
)
with pytest.raises(CouldNotParseKNXIP):
KNXIPFrame.from_knx(raw)

def test_from_knx_wrong_length_of_cri4(self):
"""Test parsing and streaming wrong ConnectRequest."""
raw = bytes.fromhex(
"06 10 02 05 00 19 08 01 C0 A8 2A 01 84 95 08 01 C0 A8 2A 01 CC A9 03 03 01"
"06 10 02 05 00 19 08 01 C0 A8 2A 01 84 95 08 01"
+ "C0 A8 2A 01 CC A9 03 03 01"
)
with pytest.raises(CouldNotParseKNXIP):
KNXIPFrame.from_knx(raw)
Expand All @@ -151,7 +154,7 @@ def test_from_knx_wrong_cri(self):
"""Test parsing and streaming wrong ConnectRequest."""
raw = bytes.fromhex(
"06 10 02 05 00 1A 08 01 C0 A8 2A 01 84 95 08 01"
"C0 A8 2A 01 CC A9 04 04 02"
+ "C0 A8 2A 01 CC A9 04 04 02"
)
with pytest.raises(CouldNotParseKNXIP):
KNXIPFrame.from_knx(raw)
2 changes: 1 addition & 1 deletion test/knxip_tests/session_authenticate_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def test_session_authenticate(self):
"e5 d9 72 7f 08 46 2c de"
)
raw = (
bytes.fromhex("06 10 09 53 00 18" "00 01") # KNXnet/IP header # User ID
bytes.fromhex("06 10 09 53 00 18 00 01") # KNXnet/IP header # User ID
+ message_authentication_code
)
knxipframe, _ = KNXIPFrame.from_knx(raw)
Expand Down
2 changes: 1 addition & 1 deletion test/knxip_tests/timer_notify_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class TestKNXIPTimerNotify:
def test_timer_notify(self):
"""Test parsing and streaming TimerNotify KNX/IP packet."""
message_authentication_code = bytes.fromhex(
"72 12 a0 3a aa e4 9d a8" "56 89 77 4c 1d 2b 4d a4"
"72 12 a0 3a aa e4 9d a8 56 89 77 4c 1d 2b 4d a4"
)
raw = (
bytes.fromhex(
Expand Down
6 changes: 1 addition & 5 deletions xknx/cemi/cemi_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,11 +478,7 @@ def from_knx(cls, raw: bytes) -> CEMIData:

def __repr__(self) -> str:
"""Return object as readable string."""
return (
f"CEMIMPropWriteRequest("
f"{self.property_info}"
f'data="{self.data.hex()}" )'
)
return f'CEMIMPropWriteRequest({self.property_info}data="{self.data.hex()}" )'


class CEMIMPropWriteResponse(CEMIData):
Expand Down
6 changes: 1 addition & 5 deletions xknx/knxip/connect_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,4 @@ def __repr__(self) -> str:
if self._is_tunnel_crd() and self.individual_address
else ""
)
return (
"<ConnectResponseData "
f'request_type="{self.request_type}" '
f"{_address}/>"
)
return f'<ConnectResponseData request_type="{self.request_type}" {_address}/>'
2 changes: 1 addition & 1 deletion xknx/knxip/description_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ def to_knx(self) -> bytes:
def __repr__(self) -> str:
"""Return object as readable string."""
_dibs_str = ",\n".join(dib.__repr__() for dib in self.dibs)
return "<DescriptionResponse " f'dibs="[\n{_dibs_str}\n]" />'
return f'<DescriptionResponse dibs="[\n{_dibs_str}\n]" />'

0 comments on commit 1380dc2

Please sign in to comment.