diff --git a/aioelectricitymaps/electricitymaps.py b/aioelectricitymaps/electricitymaps.py index e33fff5..b07be91 100644 --- a/aioelectricitymaps/electricitymaps.py +++ b/aioelectricitymaps/electricitymaps.py @@ -48,7 +48,7 @@ async def _get(self, url: str, params: dict[str, Any] | None = None) -> str: params=params, ) response.raise_for_status() - except asyncio.TimeoutError as exception: + except TimeoutError as exception: msg = "Timeout occurred while connecting to the Electricity Maps API" raise ElectricityMapsConnectionTimeoutError(msg) from exception except ( diff --git a/pyproject.toml b/pyproject.toml index c8d8ead..3456c0d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -129,6 +129,9 @@ addopts = "--cov" asyncio_mode = "auto" [tool.ruff] +target-version = "py311" + +[tool.ruff.lint] ignore = [ "ANN101", # Self... explanatory "ANN102", # cls... just as useless @@ -141,17 +144,17 @@ ignore = [ ] select = ["ALL"] -[tool.ruff.flake8-pytest-style] +[tool.ruff.lint.flake8-pytest-style] fixture-parentheses = false mark-parentheses = false -[tool.ruff.isort] +[tool.ruff.lint.isort] known-first-party = ["aioelectricitymaps"] force-sort-within-sections = true split-on-trailing-comma = false combine-as-imports = true -[tool.ruff.mccabe] +[tool.ruff.lint.mccabe] max-complexity = 25 [build-system] diff --git a/tests/ruff.toml b/tests/ruff.toml index 1257561..b9916bc 100644 --- a/tests/ruff.toml +++ b/tests/ruff.toml @@ -1,11 +1,11 @@ # This extend our general Ruff rules specifically for tests extend = "../pyproject.toml" -extend-select = [ +lint.extend-select = [ "PT", # Use @pytest.fixture without parentheses ] -extend-ignore = [ +lint.extend-ignore = [ "S101", # Use of assert detected. As these are tests... "S105", # Detection of passwords... "S106", # Detection of passwords...