From 273deb0ba6231bba7b704dcf2d86ec0ba301861a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 10 Aug 2023 13:00:10 +0000 Subject: [PATCH 1/3] Bump ruff from 0.0.278 to 0.0.284 Bumps [ruff](https://github.com/astral-sh/ruff) from 0.0.278 to 0.0.284. - [Release notes](https://github.com/astral-sh/ruff/releases) - [Changelog](https://github.com/astral-sh/ruff/blob/main/BREAKING_CHANGES.md) - [Commits](https://github.com/astral-sh/ruff/compare/v0.0.278...v0.0.284) --- updated-dependencies: - dependency-name: ruff dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- poetry.lock | 38 +++++++++++++++++++------------------- pyproject.toml | 2 +- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/poetry.lock b/poetry.lock index 47986dd6..6b8d0610 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1166,28 +1166,28 @@ use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"] [[package]] name = "ruff" -version = "0.0.278" +version = "0.0.284" description = "An extremely fast Python linter, written in Rust." optional = false python-versions = ">=3.7" files = [ - {file = "ruff-0.0.278-py3-none-macosx_10_7_x86_64.whl", hash = "sha256:1a90ebd8f2a554db1ee8d12b2f3aa575acbd310a02cd1a9295b3511a4874cf98"}, - {file = "ruff-0.0.278-py3-none-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl", hash = "sha256:38ca1c0c8c1221fe64c0a66784c91501d09a8ed02a4dbfdc117c0ce32a81eefc"}, - {file = "ruff-0.0.278-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2c62a0bde4d20d087cabce2fa8b012d74c2e985da86d00fb3359880469b90e31"}, - {file = "ruff-0.0.278-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:7545bb037823cd63dca19280f75a523a68bd3e78e003de74609320d6822b5a52"}, - {file = "ruff-0.0.278-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8cb380d2d6fdb60656a0b5fa78305535db513fc72ce11f4532cc1641204ef380"}, - {file = "ruff-0.0.278-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:d11149c7b186f224f2055e437a030cd83b164a43cc0211314c33ad1553ed9c4c"}, - {file = "ruff-0.0.278-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:666e739fb2685277b879d493848afe6933e3be30d40f41fe0e571ad479d57d77"}, - {file = "ruff-0.0.278-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:ec8b0469b54315803aaf1fbf9a37162a3849424cab6182496f972ad56e0ea702"}, - {file = "ruff-0.0.278-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c25b96602695a147d62a572865b753ef56aff1524abab13b9436724df30f9bd7"}, - {file = "ruff-0.0.278-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:a48621f5f372d5019662db5b3dbfc5f1450f927683d75f1153fe0ebf20eb9698"}, - {file = "ruff-0.0.278-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:1078125123a3c68e92463afacedb7e41b15ccafc09e510c6c755a23087afc8de"}, - {file = "ruff-0.0.278-py3-none-musllinux_1_2_i686.whl", hash = "sha256:3ce0d620e257b4cad16e2f0c103b2f43a07981668a3763380542e8a131d11537"}, - {file = "ruff-0.0.278-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:1cae4c07d334eb588f171f1363fa89a8911047eb93184276be11a24dbbc996c7"}, - {file = "ruff-0.0.278-py3-none-win32.whl", hash = "sha256:70d39f5599d8449082ab8ce542fa98e16413145eb411dd1dc16575b44565d52d"}, - {file = "ruff-0.0.278-py3-none-win_amd64.whl", hash = "sha256:e131595ab7f4ce61a1650463bd2fe304b49e7d0deb0dfa664b92817c97cdba5f"}, - {file = "ruff-0.0.278-py3-none-win_arm64.whl", hash = "sha256:737a0cfb6c36aaa92d97a46957dfd5e55329299074ad06ed12663b98e0c6fc82"}, - {file = "ruff-0.0.278.tar.gz", hash = "sha256:1a9f1d925204cfba81b18368b7ac943befcfccc3a41e170c91353b674c6b7a66"}, + {file = "ruff-0.0.284-py3-none-macosx_10_7_x86_64.whl", hash = "sha256:8b949084941232e2c27f8d12c78c5a6a010927d712ecff17231ee1a8371c205b"}, + {file = "ruff-0.0.284-py3-none-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl", hash = "sha256:a3930d66b35e4dc96197422381dff2a4e965e9278b5533e71ae8474ef202fab0"}, + {file = "ruff-0.0.284-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1d1f7096038961d8bc3b956ee69d73826843eb5b39a5fa4ee717ed473ed69c95"}, + {file = "ruff-0.0.284-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:bcaf85907fc905d838f46490ee15f04031927bbea44c478394b0bfdeadc27362"}, + {file = "ruff-0.0.284-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b3660b85a9d84162a055f1add334623ae2d8022a84dcd605d61c30a57b436c32"}, + {file = "ruff-0.0.284-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:0a3218458b140ea794da72b20ea09cbe13c4c1cdb7ac35e797370354628f4c05"}, + {file = "ruff-0.0.284-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b2fe880cff13fffd735387efbcad54ba0ff1272bceea07f86852a33ca71276f4"}, + {file = "ruff-0.0.284-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d1d098ea74d0ce31478765d1f8b4fbdbba2efc532397b5c5e8e5ea0c13d7e5ae"}, + {file = "ruff-0.0.284-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c4c79ae3308e308b94635cd57a369d1e6f146d85019da2fbc63f55da183ee29b"}, + {file = "ruff-0.0.284-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:f86b2b1e7033c00de45cc176cf26778650fb8804073a0495aca2f674797becbb"}, + {file = "ruff-0.0.284-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:e37e086f4d623c05cd45a6fe5006e77a2b37d57773aad96b7802a6b8ecf9c910"}, + {file = "ruff-0.0.284-py3-none-musllinux_1_2_i686.whl", hash = "sha256:d29dfbe314e1131aa53df213fdfea7ee874dd96ea0dd1471093d93b59498384d"}, + {file = "ruff-0.0.284-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:88295fd649d0aa1f1271441df75bf06266a199497afd239fd392abcfd75acd7e"}, + {file = "ruff-0.0.284-py3-none-win32.whl", hash = "sha256:735cd62fccc577032a367c31f6a9de7c1eb4c01fa9a2e60775067f44f3fc3091"}, + {file = "ruff-0.0.284-py3-none-win_amd64.whl", hash = "sha256:f67ed868d79fbcc61ad0fa034fe6eed2e8d438d32abce9c04b7c4c1464b2cf8e"}, + {file = "ruff-0.0.284-py3-none-win_arm64.whl", hash = "sha256:1292cfc764eeec3cde35b3a31eae3f661d86418b5e220f5d5dba1c27a6eccbb6"}, + {file = "ruff-0.0.284.tar.gz", hash = "sha256:ebd3cc55cd499d326aac17a331deaea29bea206e01c08862f9b5c6e93d77a491"}, ] [[package]] @@ -1588,4 +1588,4 @@ testing = ["flake8 (<5)", "func-timeout", "jaraco.functools", "jaraco.itertools" [metadata] lock-version = "2.0" python-versions = ">=3.8.1,<4" -content-hash = "2de8b8a1e6bfb5c95d8c884ba3db4833b7c13d7448f08dd12002d276ce4eca08" +content-hash = "eeb797d3d7d75c70c00a551953f83323b458e808db40842ddeb8202d6b04c6fa" diff --git a/pyproject.toml b/pyproject.toml index 9c9e4942..5d7aea1e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,7 +47,7 @@ pytest-cov = ">=3,<5" pytest-httpx = { version = "^0.23.1", python = ">=3.9,<4" } [tool.poetry.group.lint.dependencies] -ruff = "^0.0.278" +ruff = ">=0.0.278,<0.0.285" black = ">=22.3,<24.0" isort = "^5.10.1" pyright = "^1.1.313" From ee33162cc6f5c5471628495792a8cc65f19ed09e Mon Sep 17 00:00:00 2001 From: ItsDrike Date: Thu, 10 Aug 2023 15:10:05 +0200 Subject: [PATCH 2/3] Ignore PLR1714 for __getattribute__ in SynchronizedMixin --- tests/helpers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/helpers.py b/tests/helpers.py index a41683f4..cac38ee7 100644 --- a/tests/helpers.py +++ b/tests/helpers.py @@ -59,7 +59,7 @@ def __getattribute__(self, __name: str) -> Any: be delegated to the wrapped attribute. If the wrapped object doesn't have given attribute, the lookup will fallback to regular lookup for variables belonging to this class. """ - if __name == "_WRAPPED_ATTRIBUTE" or __name == self._WRAPPED_ATTRIBUTE: + if __name == "_WRAPPED_ATTRIBUTE" or __name == self._WRAPPED_ATTRIBUTE: # noqa: PLR1714 # Order is important return super().__getattribute__(__name) wrapped = getattr(self, self._WRAPPED_ATTRIBUTE) From 4cdbb0129e55a94763083a0f969fed07791d3703 Mon Sep 17 00:00:00 2001 From: ItsDrike Date: Thu, 10 Aug 2023 15:17:12 +0200 Subject: [PATCH 3/3] Ignore E721 in type(x) is bytes checks, isinstance won't work --- mcproto/connection.py | 4 ++-- mcproto/encryption.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mcproto/connection.py b/mcproto/connection.py index 325743fd..11f2b076 100644 --- a/mcproto/connection.py +++ b/mcproto/connection.py @@ -57,7 +57,7 @@ def enable_encryption(self, shared_secret: bytes) -> None: # subclass. This is needed since the cryptography library calls some C # code in the back, which relies on this being bytes. If it's not a bytes # instance, convert it. - if type(shared_secret) is not bytes: + if type(shared_secret) is not bytes: # noqa: E721 # we don't want isinstance shared_secret = bytes(shared_secret) self.encryption_enabled = True @@ -169,7 +169,7 @@ def enable_encryption(self, shared_secret: bytes) -> None: # subclass. This is needed since the cryptography library calls some C # code in the back, which relies on this being bytes. If it's not a bytes # instance, convert it. - if type(shared_secret) is not bytes: + if type(shared_secret) is not bytes: # noqa: E721 # we don't want isinstance shared_secret = bytes(shared_secret) self.encryption_enabled = True diff --git a/mcproto/encryption.py b/mcproto/encryption.py index e7b554fe..65da8c82 100644 --- a/mcproto/encryption.py +++ b/mcproto/encryption.py @@ -48,9 +48,9 @@ def encrypt_token_and_secret( # of the bytes class, not any subclass. This is needed since the cryptography # library calls some C code in the back, which relies on this being bytes. If # it's not a bytes instance, convert it. - if type(verification_token) is not bytes: + if type(verification_token) is not bytes: # noqa: E721 # we don't want isinstance verification_token = bytes(verification_token) - if type(shared_secret) is not bytes: + if type(shared_secret) is not bytes: # noqa: E721 # we don't want isinstance shared_secret = bytes(shared_secret) encrypted_token = public_key.encrypt(verification_token, PKCS1v15())