pythonkuma 0.0.0rc0__tar.gz → 0.0.0rc1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pythonkuma
3
- Version: 0.0.0rc0
3
+ Version: 0.0.0rc1
4
4
  Summary: Simple Python wrapper for Uptime Kuma
5
5
  Project-URL: Source, https://github.com/tr4nt0r/pythonkuma
6
6
  Author-email: Manfred Dennerlein Rodelo <manfred@dennerlein.name>, Jayakorn Karikan <jayakornk@gmail.com>
@@ -10,8 +10,12 @@ Classifier: Operating System :: OS Independent
10
10
  Classifier: Programming Language :: Python :: 3
11
11
  Requires-Python: >=3.12
12
12
  Requires-Dist: aiohttp>=3.12.9
13
+ Requires-Dist: mashumaro>=3.13.1
13
14
  Requires-Dist: prometheus-client>=0.21.0
14
15
  Provides-Extra: dev
16
+ Requires-Dist: aiohttp==3.12.12; extra == 'dev'
17
+ Requires-Dist: mashumaro==3.16; extra == 'dev'
18
+ Requires-Dist: prometheus-client==0.22.1; extra == 'dev'
15
19
  Requires-Dist: ruff==0.11.13; extra == 'dev'
16
20
  Description-Content-Type: text/markdown
17
21
 
@@ -20,11 +20,15 @@ classifiers = [
20
20
  dependencies = [
21
21
  "aiohttp>=3.12.9",
22
22
  "prometheus-client>=0.21.0",
23
+ "mashumaro>=3.13.1",
23
24
  ]
24
25
 
25
26
  [project.optional-dependencies]
26
27
  dev = [
27
28
  "ruff==0.11.13",
29
+ "aiohttp==3.12.12",
30
+ "prometheus-client==0.22.1",
31
+ "mashumaro==3.16",
28
32
  ]
29
33
 
30
34
  [project.urls]
@@ -40,8 +44,15 @@ include = [
40
44
  "/pythonkuma",
41
45
  ]
42
46
 
47
+ [tool.hatch.envs.default]
48
+ dependencies = [
49
+ "pythonkuma[dev]"
50
+ ]
51
+
43
52
  [tool.hatch.envs.hatch-static-analysis]
44
- dependencies = ["ruff==0.11.13"]
53
+ dependencies = [
54
+ "ruff==0.11.13",
55
+ ]
45
56
  config-path = "ruff.toml"
46
57
 
47
58
  [tool.pytest.ini_options]
@@ -53,5 +64,6 @@ pythonpath = ["pythonkuma"]
53
64
 
54
65
  [tool.hatch.envs.hatch-test]
55
66
  extra-dependencies = [
56
- "pytest-cov"
67
+ "pythonkuma[dev]",
68
+ "pytest-cov==6.1.1",
57
69
  ]
@@ -8,7 +8,7 @@ from .exceptions import (
8
8
  from .models import MonitorType, UptimeKumaApiResponse, UptimeKumaMonitor
9
9
  from .uptimekuma import UptimeKuma
10
10
 
11
- __version__ = "0.0.0rc0"
11
+ __version__ = "0.0.0rc1"
12
12
 
13
13
  __all__ = [
14
14
  "MonitorType",
@@ -23,8 +23,8 @@ def api_request(api_path: str, method: str = "GET"):
23
23
  async def wrapper(*args, **kwargs):
24
24
  """Wrapper"""
25
25
  client: UptimeKuma = args[0]
26
- url = f"{client._base_url}{api_path}"
27
- LOGGER.debug("Requesting %s", url)
26
+ url = client._base_url / api_path
27
+ LOGGER.debug("Requesting %s", url.human_repr())
28
28
  try:
29
29
  request = await client._session.request(
30
30
  method=method,
@@ -1,6 +1,7 @@
1
1
  """Uptime Kuma client."""
2
2
 
3
3
  from aiohttp import ClientSession
4
+ from yarl import URL
4
5
 
5
6
  from .decorator import api_request
6
7
  from .models import UptimeKumaApiResponse
@@ -9,14 +10,14 @@ from .models import UptimeKumaApiResponse
9
10
  class UptimeKuma:
10
11
  """This class is used to get information from Uptime Kuma."""
11
12
 
12
- def __init__(self, session: ClientSession, base_url: str, username: str, password: str) -> None:
13
+ def __init__(self, session: ClientSession, base_url: URL | str, username: str, password: str) -> None:
13
14
  """Initialize"""
14
15
  self.monitors = []
15
- self._base_url = base_url
16
+ self._base_url = base_url if isinstance(base_url, URL) else URL(base_url)
16
17
  self._username = username
17
18
  self._password = password
18
19
  self._session: ClientSession = session
19
20
 
20
- @api_request("/metrics")
21
+ @api_request("metrics")
21
22
  async def async_get_monitors(self, **kwargs) -> UptimeKumaApiResponse:
22
23
  """Get monitors from API."""
File without changes
File without changes
File without changes