File tree Expand file tree Collapse file tree 4 files changed +34
-8
lines changed
Expand file tree Collapse file tree 4 files changed +34
-8
lines changed Original file line number Diff line number Diff line change @@ -24,8 +24,7 @@ dependencies = [
2424
2525[project .optional-dependencies ]
2626dev = [
27- " black==22.3.0" ,
28- " isort==5.10.1" ,
27+ " ruff==0.11.13" ,
2928]
3029
3130[project .urls ]
@@ -41,3 +40,31 @@ include = [
4140 " /pyuptimekuma" ,
4241]
4342
43+ [tool .ruff ]
44+ target-version = " py312"
45+ line-length = 88
46+
47+ [tool .ruff .lint ]
48+ preview = true
49+ ignore = [" TRY003" , " N818" ]
50+
51+
52+ [tool .ruff .lint .isort ]
53+ force-sort-within-sections = true
54+ known-first-party = [" pyuptimekuma" ]
55+ combine-as-imports = true
56+ split-on-trailing-comma = false
57+
58+ [tool .ruff .lint .pydocstyle ]
59+ convention = " numpy"
60+
61+ [tool .ruff .format ]
62+ preview = true
63+ quote-style = " double"
64+ indent-style = " space"
65+
66+ [tool .ruff .lint .mccabe ]
67+ max-complexity = 25
68+
69+
70+
Original file line number Diff line number Diff line change 77from .models import MonitorType , UptimeKumaApiResponse , UptimeKumaMonitor
88from .uptimekuma import UptimeKuma
99
10- __version__ = ' 0.0.0'
10+ __version__ = " 0.0.0"
1111
1212__all__ = [
1313 "MonitorType" ,
1717 "UptimeKumaConnectionException" ,
1818 "UptimeKumaException" ,
1919 "UptimeKumaMonitor" ,
20- ]
20+ ]
Original file line number Diff line number Diff line change 11"""Decorator for Uptime Kuma"""
22from __future__ import annotations
33
4- import asyncio
54from typing import TYPE_CHECKING
65
76import aiohttp
@@ -45,7 +44,7 @@ async def wrapper(*args, **kwargs):
4544 f"Request exception for '{ url } ' with - { exception } "
4645 ) from exception
4746
48- except asyncio . TimeoutError :
47+ except TimeoutError :
4948 raise exceptions .UptimeKumaConnectionException (
5049 f"Request timeout for '{ url } '"
5150 ) from None
@@ -63,7 +62,6 @@ async def wrapper(*args, **kwargs):
6362
6463 LOGGER .debug ("Requesting %s returned %s" , url , result )
6564
66- # print(result)
6765 response = UptimeKumaApiResponse .from_prometheus (
6866 {"monitors" : result , "_api_path" : api_path , "_method" : method }
6967 )
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ class MonitorType(StrEnum):
2222 SQL = "sqlserver"
2323 JSON_QUERY = "json-query"
2424 GROUP = "group"
25- DOCKER = "docker"
25+ DOCKER = "docker"
2626 GRPC_KEYWORD = "grpc-keyword"
2727 REAL_BROWSER = "real-browser"
2828 GAMEDIG = "gamedig"
@@ -34,6 +34,7 @@ class MonitorType(StrEnum):
3434 REDIS = "redis"
3535 TAILSCALE_PING = "tailscale-ping"
3636
37+
3738class UptimeKumaBaseModel :
3839 """UptimeKumaBaseModel."""
3940
You can’t perform that action at this time.
0 commit comments