From 668ce7384e6129d785c3f690f963202de42d6964 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 8 Sep 2024 13:00:34 +0000 Subject: [PATCH 1/3] Bump ruff from 0.4.10 to 0.6.4 Bumps [ruff](https://github.com/astral-sh/ruff) from 0.4.10 to 0.6.4. - [Release notes](https://github.com/astral-sh/ruff/releases) - [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md) - [Commits](https://github.com/astral-sh/ruff/compare/v0.4.10...0.6.4) --- updated-dependencies: - dependency-name: ruff dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- poetry.lock | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/poetry.lock b/poetry.lock index 28e73c4..1b9d2a3 100644 --- a/poetry.lock +++ b/poetry.lock @@ -3195,28 +3195,29 @@ httpx = ">=0.21.0" [[package]] name = "ruff" -version = "0.4.10" +version = "0.6.4" description = "An extremely fast Python linter and code formatter, written in Rust." optional = false python-versions = ">=3.7" files = [ - {file = "ruff-0.4.10-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:5c2c4d0859305ac5a16310eec40e4e9a9dec5dcdfbe92697acd99624e8638dac"}, - {file = "ruff-0.4.10-py3-none-macosx_11_0_arm64.whl", hash = "sha256:a79489607d1495685cdd911a323a35871abfb7a95d4f98fc6f85e799227ac46e"}, - {file = "ruff-0.4.10-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b1dd1681dfa90a41b8376a61af05cc4dc5ff32c8f14f5fe20dba9ff5deb80cd6"}, - {file = "ruff-0.4.10-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:c75c53bb79d71310dc79fb69eb4902fba804a81f374bc86a9b117a8d077a1784"}, - {file = "ruff-0.4.10-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:18238c80ee3d9100d3535d8eb15a59c4a0753b45cc55f8bf38f38d6a597b9739"}, - {file = "ruff-0.4.10-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:d8f71885bce242da344989cae08e263de29752f094233f932d4f5cfb4ef36a81"}, - {file = "ruff-0.4.10-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:330421543bd3222cdfec481e8ff3460e8702ed1e58b494cf9d9e4bf90db52b9d"}, - {file = "ruff-0.4.10-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9e9b6fb3a37b772628415b00c4fc892f97954275394ed611056a4b8a2631365e"}, - {file = "ruff-0.4.10-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0f54c481b39a762d48f64d97351048e842861c6662d63ec599f67d515cb417f6"}, - {file = "ruff-0.4.10-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:67fe086b433b965c22de0b4259ddfe6fa541c95bf418499bedb9ad5fb8d1c631"}, - {file = "ruff-0.4.10-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:acfaaab59543382085f9eb51f8e87bac26bf96b164839955f244d07125a982ef"}, - {file = "ruff-0.4.10-py3-none-musllinux_1_2_i686.whl", hash = "sha256:3cea07079962b2941244191569cf3a05541477286f5cafea638cd3aa94b56815"}, - {file = "ruff-0.4.10-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:338a64ef0748f8c3a80d7f05785930f7965d71ca260904a9321d13be24b79695"}, - {file = "ruff-0.4.10-py3-none-win32.whl", hash = "sha256:ffe3cd2f89cb54561c62e5fa20e8f182c0a444934bf430515a4b422f1ab7b7ca"}, - {file = "ruff-0.4.10-py3-none-win_amd64.whl", hash = "sha256:67f67cef43c55ffc8cc59e8e0b97e9e60b4837c8f21e8ab5ffd5d66e196e25f7"}, - {file = "ruff-0.4.10-py3-none-win_arm64.whl", hash = "sha256:dd1fcee327c20addac7916ca4e2653fbbf2e8388d8a6477ce5b4e986b68ae6c0"}, - {file = "ruff-0.4.10.tar.gz", hash = "sha256:3aa4f2bc388a30d346c56524f7cacca85945ba124945fe489952aadb6b5cd804"}, + {file = "ruff-0.6.4-py3-none-linux_armv6l.whl", hash = "sha256:c4b153fc152af51855458e79e835fb6b933032921756cec9af7d0ba2aa01a258"}, + {file = "ruff-0.6.4-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:bedff9e4f004dad5f7f76a9d39c4ca98af526c9b1695068198b3bda8c085ef60"}, + {file = "ruff-0.6.4-py3-none-macosx_11_0_arm64.whl", hash = "sha256:d02a4127a86de23002e694d7ff19f905c51e338c72d8e09b56bfb60e1681724f"}, + {file = "ruff-0.6.4-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7862f42fc1a4aca1ea3ffe8a11f67819d183a5693b228f0bb3a531f5e40336fc"}, + {file = "ruff-0.6.4-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:eebe4ff1967c838a1a9618a5a59a3b0a00406f8d7eefee97c70411fefc353617"}, + {file = "ruff-0.6.4-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:932063a03bac394866683e15710c25b8690ccdca1cf192b9a98260332ca93408"}, + {file = "ruff-0.6.4-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:50e30b437cebef547bd5c3edf9ce81343e5dd7c737cb36ccb4fe83573f3d392e"}, + {file = "ruff-0.6.4-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c44536df7b93a587de690e124b89bd47306fddd59398a0fb12afd6133c7b3818"}, + {file = "ruff-0.6.4-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0ea086601b22dc5e7693a78f3fcfc460cceabfdf3bdc36dc898792aba48fbad6"}, + {file = "ruff-0.6.4-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0b52387d3289ccd227b62102c24714ed75fbba0b16ecc69a923a37e3b5e0aaaa"}, + {file = "ruff-0.6.4-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:0308610470fcc82969082fc83c76c0d362f562e2f0cdab0586516f03a4e06ec6"}, + {file = "ruff-0.6.4-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:803b96dea21795a6c9d5bfa9e96127cc9c31a1987802ca68f35e5c95aed3fc0d"}, + {file = "ruff-0.6.4-py3-none-musllinux_1_2_i686.whl", hash = "sha256:66dbfea86b663baab8fcae56c59f190caba9398df1488164e2df53e216248baa"}, + {file = "ruff-0.6.4-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:34d5efad480193c046c86608dbba2bccdc1c5fd11950fb271f8086e0c763a5d1"}, + {file = "ruff-0.6.4-py3-none-win32.whl", hash = "sha256:f0f8968feea5ce3777c0d8365653d5e91c40c31a81d95824ba61d871a11b8523"}, + {file = "ruff-0.6.4-py3-none-win_amd64.whl", hash = "sha256:549daccee5227282289390b0222d0fbee0275d1db6d514550d65420053021a58"}, + {file = "ruff-0.6.4-py3-none-win_arm64.whl", hash = "sha256:ac4b75e898ed189b3708c9ab3fc70b79a433219e1e87193b4f2b77251d058d14"}, + {file = "ruff-0.6.4.tar.gz", hash = "sha256:ac3b5bfbee99973f80aa1b7cbd1c9cbce200883bdd067300c22a6cc1c7fba212"}, ] [[package]] From c96460810853f8124bdf8eb86b3e1095ae5f94fe Mon Sep 17 00:00:00 2001 From: Larry Gregory Date: Sun, 8 Sep 2024 09:06:26 -0400 Subject: [PATCH 2/3] Fix existing lint errors --- tests/test_entity_details.py | 4 ++-- tests/test_es_publish_pipeline.py | 8 ++++---- tests/test_init.py | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/test_entity_details.py b/tests/test_entity_details.py index fa5168f..6c27d2a 100644 --- a/tests/test_entity_details.py +++ b/tests/test_entity_details.py @@ -285,7 +285,7 @@ async def test_entity_device_combinations( assert as_dict["device"]["labels"] is not None assert as_dict["device"]["labels"] == device_labels - assert { + assert snapshot == { "source_entity": { "entity_id": entity_object_id, "entity_area_name": entity_area_name, @@ -299,7 +299,7 @@ async def test_entity_device_combinations( "device_floor_name": device_floor_name, "device_labels": device_labels, }, - } == snapshot + } class Test_ExtendedDeviceEntry: diff --git a/tests/test_es_publish_pipeline.py b/tests/test_es_publish_pipeline.py index f88881d..640233b 100644 --- a/tests/test_es_publish_pipeline.py +++ b/tests/test_es_publish_pipeline.py @@ -234,10 +234,10 @@ async def test_init(self, manager, snapshot: SnapshotAssertion): assert manager._poller is not None assert manager._publisher is not None - assert { + assert snapshot == { "settings": manager._settings.to_dict(), "static_fields": manager._static_fields, - } == snapshot + } async def test_async_init(self, manager, config_entry): """Test the async initialization of the manager.""" @@ -817,10 +817,10 @@ async def test_state_to_attributes_objects(self, formatter, snapshot: SnapshotAs state = State("light.living_room", "on", orig_attributes) transformed_attributes = formatter._state_to_attributes(state) - assert { + assert snapshot == { "orig_attributes": orig_attributes, "transformed_attributes": transformed_attributes, - } == snapshot + } async def test_state_to_coerced_value_string(self, formatter): """Test converting a state to a coerced value.""" diff --git a/tests/test_init.py b/tests/test_init.py index dd5ee6c..d475ed6 100644 --- a/tests/test_init.py +++ b/tests/test_init.py @@ -147,14 +147,14 @@ def _test_config_data_options_migration_to_version( assert end_version == after_version - assert { + assert snapshot == { "before_data": dict(mock_entry.data), "before_options": dict(mock_entry.options), "before_version": mock_entry.version, "after_data": dict(migrated_data), "after_options": dict(migrated_options), "after_version": end_version, - } == snapshot + } return True @@ -941,10 +941,10 @@ async def test_setup_v1_to_publish( assert config_entry.state is ConfigEntryState.LOADED - assert { + assert snapshot == { "data": config_entry.data, "options": config_entry.options, - } == snapshot + } # Queue an entity state change hass.states.async_set(entity.entity_id, "value") From 6fe628ff2ab5b7ce911c5cc263dc4d5b6663f135 Mon Sep 17 00:00:00 2001 From: Larry Gregory Date: Sun, 8 Sep 2024 09:13:18 -0400 Subject: [PATCH 3/3] Fix lint CI check --- .github/workflows/pull.yml | 2 +- scripts/lint | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pull.yml b/.github/workflows/pull.yml index 1ef82e7..6262d3c 100644 --- a/.github/workflows/pull.yml +++ b/.github/workflows/pull.yml @@ -28,7 +28,7 @@ jobs: python-version: "3.12" - run: python3 -m pip install poetry~=1.8 - run: poetry install - - run: poetry run ./scripts/lint + - run: poetry run ./scripts/lint --no-fix tests: runs-on: "ubuntu-latest" diff --git a/scripts/lint b/scripts/lint index 5d68d15..703be4d 100755 --- a/scripts/lint +++ b/scripts/lint @@ -4,5 +4,10 @@ set -e cd "$(dirname "$0")/.." -ruff format . -ruff check . --fix +if [[ "$1" == "--no-fix" ]]; then + ruff format . --check + ruff check . +else + ruff format . + ruff check . --fix +fi