Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/ruff.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This extend our general Ruff rules specifically for the examples
extend = "../pyproject.toml"

extend-ignore = [
lint.extend-ignore = [
"T201", # Allow the use of print() in examples
]
38 changes: 19 additions & 19 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ pylint = "3.0.3"
pytest = "7.4.4"
pytest-asyncio = "0.23.4"
pytest-cov = "4.1.0"
ruff = "0.1.14"
ruff = "0.2.0"
safety = "3.0.1"
yamllint = "1.33.0"

Expand Down Expand Up @@ -113,6 +113,7 @@ max-attributes = 8
disable = [
"format",
"unsubscriptable-object",
"wrong-import-order"
]

[tool.pylint.SIMILARITIES]
Expand All @@ -125,8 +126,7 @@ max-line-length = 88
addopts = "--cov"
asyncio_mode = "auto"

[tool.ruff]
target-version = "py311"
[tool.ruff.lint]
ignore = [
"ANN101", # Self... explanatory
"ANN401", # Opinioated warning on disallowing dynamically typed expressions
Expand All @@ -141,14 +141,14 @@ 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 = ["twentemilieu"]

[tool.ruff.mccabe]
[tool.ruff.lint.mccabe]
max-complexity = 25

[build-system]
Expand Down
7 changes: 6 additions & 1 deletion src/twentemilieu/twentemilieu.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
from enum import IntEnum
from importlib import metadata
from typing import Any, Self
from zoneinfo import ZoneInfo

import aiohttp
from aiohttp.client import ClientSession
from attr import dataclass
from yarl import URL
from zoneinfo import ZoneInfo

from .exceptions import (
TwenteMilieuAddressError,
Expand Down Expand Up @@ -70,6 +70,7 @@ async def _request(self, uri: str, *, data: dict[str, Any] | None = None) -> Any
the Twente Milieu API.
TwenteMilieuError: Received an unexpected response from the Twente
Milieu API.

"""
url = URL.build(
scheme="https",
Expand Down Expand Up @@ -139,6 +140,7 @@ async def unique_id(self) -> int:
Raises
------
TwenteMilieuAddressError: Address could not be found.

"""
if self._unique_id is None:
response = await self._request(
Expand All @@ -162,6 +164,7 @@ async def update(self) -> dict[WasteType, list[date]]:
Returns
-------
A dictionary with the date for each waste type from Twente Milieu.

"""
await self.unique_id()

Expand Down Expand Up @@ -215,6 +218,7 @@ async def __aenter__(self) -> Self:
Returns
-------
The TwenteMilieu object.

"""
return self

Expand All @@ -224,5 +228,6 @@ async def __aexit__(self, *_exc_info: object) -> None:
Args:
----
_exc_info: Exec type.

"""
await self.close()
4 changes: 2 additions & 2 deletions tests/ruff.toml
Original file line number Diff line number Diff line change
@@ -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...
"SLF001", # Tests will access private/protected members...
"TCH002", # pytest doesn't like this one...
Expand Down