diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml index a6d2b95a..5bca555b 100644 --- a/.github/workflows/publish-to-pypi.yml +++ b/.github/workflows/publish-to-pypi.yml @@ -13,10 +13,10 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Set up Python 3.8 + - name: Set up Python 3.9 uses: actions/setup-python@v4.7.1 with: - python-version: 3.8 + python-version: 3.9 - name: Install dependencies run: | python -m pip install --upgrade pip diff --git a/.github/workflows/publish-to-test-pypi.yml b/.github/workflows/publish-to-test-pypi.yml index 417d3f1f..af8e74d5 100644 --- a/.github/workflows/publish-to-test-pypi.yml +++ b/.github/workflows/publish-to-test-pypi.yml @@ -16,10 +16,10 @@ jobs: with: ref: development fetch-depth: 0 - - name: Set up Python 3.8 + - name: Set up Python 3.9 uses: actions/setup-python@v4.7.1 with: - python-version: 3.8 + python-version: 3.9 - name: Install dependencies run: | python -m pip install --upgrade pip diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index ff25969b..66e51fc9 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -16,7 +16,7 @@ jobs: strategy: max-parallel: 1 matrix: - python-version: [3.10.8] + python-version: [3.9] steps: - uses: actions/checkout@v4 @@ -39,7 +39,7 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: [3.10.8] + python-version: [3.9] steps: - uses: actions/checkout@v4 @@ -63,7 +63,7 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: [3.8, 3.9, 3.10.8] + python-version: [3.9, 3.10.8, 3.11.4] steps: - uses: actions/checkout@v4 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c058acd7..ac3d970a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,7 +10,7 @@ repos: rev: v3.15.0 hooks: - id: pyupgrade - args: [--py38-plus] + args: [--py39-plus] exclude: "external_src/int-tools" - repo: https://github.com/asottile/add-trailing-comma diff --git a/README.md b/README.md index 70a428bf..cfa02fdc 100644 --- a/README.md +++ b/README.md @@ -72,4 +72,4 @@ Another way to run the tests is by using `tox`. This runs the tests against the or by specifying a python version - tox -e py38 + tox -e py39 diff --git a/pyproject.toml b/pyproject.toml index df66b448..5ecd4104 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ requires = ["wheel", "setuptools", "attrs>=17.1"] build-backend = "setuptools.build_meta" [tool.pytest.ini_options] -minversion = "6.0" +minversion = "7.0" asyncio_mode = "auto" [tool.setuptools_scm] diff --git a/setup.cfg b/setup.cfg index d643327e..7e0bb9bd 100644 --- a/setup.cfg +++ b/setup.cfg @@ -12,7 +12,6 @@ classifiers = License :: OSI Approved :: MIT License Programming Language :: Python :: 3 Programming Language :: Python :: 3 :: Only - Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 Programming Language :: Python :: 3.11 @@ -28,7 +27,7 @@ install_requires = oauthlib~=3.1 requests~=2.24 requests-oauthlib~=1.3 -python_requires = >=3.8 +python_requires = >=3.9 include_package_data = True package_dir = =src setup_requires = diff --git a/src/pyatmo/camera.py b/src/pyatmo/camera.py index e1b24b16..a2b32770 100644 --- a/src/pyatmo/camera.py +++ b/src/pyatmo/camera.py @@ -1,7 +1,7 @@ """Support for Netatmo security devices (cameras, smoke detectors, sirens, window sensors, events and persons).""" from __future__ import annotations -import imghdr +import imghdr # pylint: disable=deprecated-module import time from abc import ABC from collections import defaultdict diff --git a/src/pyatmo/const.py b/src/pyatmo/const.py index 49b139a5..58538f76 100644 --- a/src/pyatmo/const.py +++ b/src/pyatmo/const.py @@ -1,7 +1,7 @@ """Common constants.""" from __future__ import annotations -from typing import Any, Dict +from typing import Any ERRORS: dict[int, str] = { 400: "Bad request", @@ -15,7 +15,7 @@ } # Special types -RawData = Dict[str, Any] +RawData = dict[str, Any] DEFAULT_BASE_URL: str = "https://api.netatmo.com/" @@ -51,7 +51,7 @@ AUTHORIZATION_HEADER = "Authorization" # Possible scops -ALL_SCOPES = [ +ALL_SCOPES: list[str] = [ "access_camera", # Netatmo camera products "access_doorbell", # Netatmo Smart Video Doorbell "access_presence", # Netatmo Smart Outdoor Camera diff --git a/src/pyatmo/modules/base_class.py b/src/pyatmo/modules/base_class.py index 511744ae..83edcb76 100644 --- a/src/pyatmo/modules/base_class.py +++ b/src/pyatmo/modules/base_class.py @@ -3,8 +3,9 @@ import logging from abc import ABC +from collections.abc import Iterable from dataclasses import dataclass -from typing import TYPE_CHECKING, Any, Iterable +from typing import TYPE_CHECKING, Any from pyatmo.const import RawData from pyatmo.modules.device_types import DeviceType diff --git a/src/pyatmo/modules/module.py b/src/pyatmo/modules/module.py index acfa4caf..2d0bbef6 100644 --- a/src/pyatmo/modules/module.py +++ b/src/pyatmo/modules/module.py @@ -4,7 +4,7 @@ import logging from datetime import datetime from enum import Enum -from typing import TYPE_CHECKING, Any, Dict +from typing import TYPE_CHECKING, Any from aiohttp import ClientConnectorError @@ -19,7 +19,7 @@ LOG = logging.getLogger(__name__) -ModuleT = Dict[str, Any] +ModuleT = dict[str, Any] # Hide from features list ATTRIBUTE_FILTER = { diff --git a/tox.ini b/tox.ini index 3b23687b..55fe03e1 100644 --- a/tox.ini +++ b/tox.ini @@ -1,13 +1,13 @@ [tox] -envlist = py38,py39,py310 +envlist = py39,py310,py311 isolated_build = True skip_missing_interpreters = True [gh-actions] python = - 3.8: py38 3.9: py39 3.10: py310 + 3.11: py311 [testenv] deps =