Browse Source

test against python3.12 & declare compatibility

Fabian Peter Hammerle 1 month ago
parent
commit
9e6485f722
4 changed files with 9 additions and 3 deletions
  1. 4 1
      .github/workflows/python.yml
  2. 1 1
      CHANGELOG.md
  3. 1 0
      setup.py
  4. 3 1
      tests/test_actor_base.py

+ 4 - 1
.github/workflows/python.yml

@@ -1,3 +1,4 @@
+---
 # sync with https://github.com/fphammerle/ical2vdir/blob/master/.github/workflows/python.yml
 
 # https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions
@@ -36,6 +37,7 @@ jobs:
         python-version:
         - '3.10'
         - '3.11'
+        - '3.12'
       fail-fast: false
     steps:
     - uses: actions/checkout@v5
@@ -55,7 +57,8 @@ jobs:
       env:
         PYTHON_VERSION: ${{ matrix.python-version }}
     - run: pipenv graph
-    - run: pipenv run pytest --cov="$(cat *.egg-info/top_level.txt)" --cov-report=term-missing --cov-fail-under=100
+    - run: pipenv run pytest --cov="$(cat *.egg-info/top_level.txt)"
+        --cov-report=term-missing --cov-fail-under=100
     - run: pipenv run pylint "$(cat *.egg-info/top_level.txt)"
     # https://github.com/PyCQA/pylint/issues/352
     - run: pipenv run pylint --disable=duplicate-code tests/*

+ 1 - 1
CHANGELOG.md

@@ -6,7 +6,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 
 ## [Unreleased]
 ### Added
-- declare compatibility with `python3.11`
+- declare compatibility with `python3.11` & `python3.12`
 
 ### Changed
 - TLS now enabled by default (disable via `--mqtt-disable-tls`)

+ 1 - 0
setup.py

@@ -67,6 +67,7 @@ setuptools.setup(
         # .github/workflows/python.yml
         "Programming Language :: Python :: 3.10",
         "Programming Language :: Python :: 3.11",
+        "Programming Language :: Python :: 3.12",
         "Topic :: Home Automation",
     ],
     entry_points={"console_scripts": ["switchbot-mqtt = switchbot_mqtt._cli:_main"]},

+ 3 - 1
tests/test_actor_base.py

@@ -75,7 +75,9 @@ async def test_execute_command_abstract() -> None:
         )
     exc_info.match(
         r"^Can't instantiate abstract class _MQTTControlledActor"
-        r" with abstract methods __init__, _get_device, execute_command$"
+        r" (with abstract methods __init__, _get_device, execute_command"
+        r"|without an implementation for abstract methods '__init__'"
+        r", '_get_device', 'execute_command')$"
     )
     actor = _ActorMock(device=unittest.mock.Mock(), retry_count=42, password=None)
     with pytest.raises(NotImplementedError):