From 668f9c0e3bfde64c0d61b61ff6002cfc10df53f4 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Thu, 29 Aug 2024 09:58:03 -1000 Subject: [PATCH 1/5] Ensure we are testing on MacOS and Winows --- .github/workflows/ci.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 706dfb871..f919b32c9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,9 +27,24 @@ jobs: - "3.12" os: - ubuntu-latest + - windows-latest + - macos-latest extension: - "skip_cython" - "use_cython" + exclude: + - python-version: "3.9" + os: windows-latest + - python-version: "3.10" + os: windows-latest + - python-version: "3.11" + os: windows-latest + - python-version: "3.9" + os: macos-latest + - python-version: "3.10" + os: macos-latest + - python-version: "3.11" + os: macos-latest steps: - uses: actions/checkout@v4 - name: Set up Python From 1ad97595272a578dbc8d7ceb4c80c48f6846c798 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Thu, 29 Aug 2024 10:01:45 -1000 Subject: [PATCH 2/5] Ensure we are testing on MacOS and Win --- .github/workflows/ci.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f919b32c9..1606c8fd3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -55,6 +55,7 @@ jobs: - name: Get pip cache dir id: pip-cache + shell: bash run: | echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT - name: Restore PIP cache @@ -68,6 +69,7 @@ jobs: if: ${{ matrix.extension == 'skip_cython' }} env: SKIP_CYTHON: 1 + shell: bash run: | pip3 install -r requirements.txt -r requirements_test.txt pip3 install -e . @@ -75,10 +77,12 @@ jobs: if: ${{ matrix.extension == 'use_cython' }} env: REQUIRE_CYTHON: 1 + shell: bash run: | pip3 install -r requirements.txt -r requirements_test.txt pip3 install -e . - name: Register problem matchers + shell: bash run: | echo "::add-matcher::.github/workflows/matchers/flake8.json" echo "::add-matcher::.github/workflows/matchers/pylint.json" @@ -87,16 +91,16 @@ jobs: - run: flake8 aioesphomeapi name: Lint with flake8 - if: ${{ matrix.python-version == '3.12' && matrix.extension == 'skip_cython' }} + if: ${{ matrix.python-version == '3.12' && matrix.extension == 'skip_cython' && matrix.os == 'ubuntu-latest' }} - run: pylint aioesphomeapi name: Lint with pylint - if: ${{ matrix.python-version == '3.12' && matrix.extension == 'skip_cython' }} + if: ${{ matrix.python-version == '3.12' && matrix.extension == 'skip_cython' && matrix.os == 'ubuntu-latest' }} - run: black --check --diff --color aioesphomeapi tests name: Check formatting with black - if: ${{ matrix.python-version == '3.12' && matrix.extension == 'skip_cython' }} + if: ${{ matrix.python-version == '3.12' && matrix.extension == 'skip_cython' && matrix.os == 'ubuntu-latest' }} - run: mypy aioesphomeapi name: Check typing with mypy - if: ${{ matrix.python-version == '3.12' && matrix.extension == 'skip_cython' }} + if: ${{ matrix.python-version == '3.12' && matrix.extension == 'skip_cython' && matrix.os == 'ubuntu-latest' }} - run: pytest -vv --cov=aioesphomeapi --cov-report=xml --tb=native tests name: Run tests with pytest - name: Upload coverage to Codecov @@ -113,4 +117,4 @@ jobs: exit 1 fi name: Check protobuf files match - if: ${{ matrix.python-version == '3.12' && matrix.extension == 'skip_cython' }} + if: ${{ matrix.python-version == '3.12' && matrix.extension == 'skip_cython' && matrix.os == 'ubuntu-latest' }} From ac3ee0e76f34c72e274fb8e2ce86345d0b6b9746 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Thu, 29 Aug 2024 10:04:54 -1000 Subject: [PATCH 3/5] Ensure we are testing on MacOS and Win --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1606c8fd3..5baff9d8e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,6 +45,10 @@ jobs: os: macos-latest - python-version: "3.11" os: macos-latest + - extension: "use_cython" + os: windows-latest + - extension: "use_cython" + os: macos-latest steps: - uses: actions/checkout@v4 - name: Set up Python From e33ed155533d65c5c74147375b378e9b9daa282a Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Thu, 29 Aug 2024 10:15:27 -1000 Subject: [PATCH 4/5] fix crash on debug logging in windows --- aioesphomeapi/connection.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/aioesphomeapi/connection.py b/aioesphomeapi/connection.py index 65acf6800..ff9d58913 100644 --- a/aioesphomeapi/connection.py +++ b/aioesphomeapi/connection.py @@ -711,9 +711,7 @@ def send_messages(self, msgs: tuple[message.Message, ...]) -> None: if debug_enabled := self._debug_enabled: for msg in msgs: - _LOGGER.debug( - "%s: Sending %s: %s", self.log_name, type(msg).__name__, msg - ) + _LOGGER.debug("%s: Sending %s", self.log_name, type(msg).__name__) if TYPE_CHECKING: assert self._frame_helper is not None From 361dc3a02bc580a1b73a2f9e9c7fc882a97c04b0 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Thu, 29 Aug 2024 10:19:44 -1000 Subject: [PATCH 5/5] one more place --- aioesphomeapi/connection.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/aioesphomeapi/connection.py b/aioesphomeapi/connection.py index ff9d58913..518397696 100644 --- a/aioesphomeapi/connection.py +++ b/aioesphomeapi/connection.py @@ -906,10 +906,7 @@ def process_packet(self, msg_type_proto: _int, data: _bytes) -> None: if debug_enabled: _LOGGER.debug( - "%s: Got message of type %s: %s", - self.log_name, - msg_type.__name__, - msg, + "%s: Got message of type %s", self.log_name, msg_type.__name__ ) if self._pong_timer is not None: