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
31 changes: 29 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ dependencies = [

[project.optional-dependencies]
dev = [
"black==22.3.0",
"isort==5.10.1",
"ruff==0.11.13",
]

[project.urls]
Expand All @@ -41,3 +40,31 @@ include = [
"/pyuptimekuma",
]

[tool.ruff]
target-version = "py312"
line-length = 88

[tool.ruff.lint]
preview = true
ignore = ["TRY003", "N818"]


[tool.ruff.lint.isort]
force-sort-within-sections = true
known-first-party = ["pyuptimekuma"]
combine-as-imports = true
split-on-trailing-comma = false

[tool.ruff.lint.pydocstyle]
convention = "numpy"

[tool.ruff.format]
preview = true
quote-style = "double"
indent-style = "space"

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



4 changes: 2 additions & 2 deletions pyuptimekuma/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from .models import MonitorType, UptimeKumaApiResponse, UptimeKumaMonitor
from .uptimekuma import UptimeKuma

__version__ = '0.0.0'
__version__ = "0.0.0"

__all__ = [
"MonitorType",
Expand All @@ -17,4 +17,4 @@
"UptimeKumaConnectionException",
"UptimeKumaException",
"UptimeKumaMonitor",
]
]
4 changes: 1 addition & 3 deletions pyuptimekuma/decorator.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""Decorator for Uptime Kuma"""
from __future__ import annotations

import asyncio
from typing import TYPE_CHECKING

import aiohttp
Expand Down Expand Up @@ -45,7 +44,7 @@ async def wrapper(*args, **kwargs):
f"Request exception for '{url}' with - {exception}"
) from exception

except asyncio.TimeoutError:
except TimeoutError:
raise exceptions.UptimeKumaConnectionException(
f"Request timeout for '{url}'"
) from None
Expand All @@ -63,7 +62,6 @@ async def wrapper(*args, **kwargs):

LOGGER.debug("Requesting %s returned %s", url, result)

# print(result)
response = UptimeKumaApiResponse.from_prometheus(
{"monitors": result, "_api_path": api_path, "_method": method}
)
Expand Down
3 changes: 2 additions & 1 deletion pyuptimekuma/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class MonitorType(StrEnum):
SQL = "sqlserver"
JSON_QUERY = "json-query"
GROUP = "group"
DOCKER ="docker"
DOCKER = "docker"
GRPC_KEYWORD = "grpc-keyword"
REAL_BROWSER = "real-browser"
GAMEDIG = "gamedig"
Expand All @@ -34,6 +34,7 @@ class MonitorType(StrEnum):
REDIS = "redis"
TAILSCALE_PING = "tailscale-ping"


class UptimeKumaBaseModel:
"""UptimeKumaBaseModel."""

Expand Down
Loading