xn-client 0.0.3.dev2__tar.gz → 0.0.3.dev3__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.
@@ -32,5 +32,6 @@ repos:
32
32
  ### Run the formatter.
33
33
  - id: ruff-format
34
34
  types_or: [python, pyi]
35
+ args: [--preview]
35
36
  verbose: true
36
37
  stages: [pre-commit]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: xn-client
3
- Version: 0.0.3.dev2
3
+ Version: 0.0.3.dev3
4
4
  Author-email: Mike Artemiev <mixartemev@gmail.com>
5
5
  License: MIT
6
6
  Project-URL: Homepage, https://github.com/XyncNet/x-client
@@ -35,6 +35,9 @@ local_scheme = "no-local-version"
35
35
  [tool.ruff]
36
36
  line-length = 120
37
37
 
38
+ [tool.ruff.format]
39
+ preview = true
40
+
38
41
  [tool.pytest.ini_options]
39
42
  asyncio_mode = "auto"
40
43
  asyncio_default_fixture_loop_scope = "module" # , "session", "class", "package", "function"
@@ -17,17 +17,21 @@ class Client:
17
17
  async def close(self):
18
18
  await self.session.close()
19
19
 
20
- async def _get(self, url: str, params: dict = None, **kwargs):
21
- resp: ClientResponse = await self.session.get(url, params=params, **kwargs)
20
+ # noinspection PyMethodMayBeStatic
21
+ def _prehook(self, _payload: dict = None):
22
+ return {}
23
+
24
+ async def _get(self, url: str, params: dict = None):
25
+ resp: ClientResponse = await self.session.get(url, params=params, headers=self._prehook(params))
22
26
  return await self._proc(resp)
23
27
 
24
- async def _post(self, url: str, data: dict = None, params: dict = None, **kwargs):
28
+ async def _post(self, url: str, data: dict = None):
25
29
  dt = {"json" if isinstance(data, dict) else "data": data}
26
- resp = await self.session.post(url, **dt, **kwargs)
30
+ resp = await self.session.post(url, **dt, headers=self._prehook(data))
27
31
  return await self._proc(resp)
28
32
 
29
- async def _delete(self, url: str, params: dict = None, **kwargs):
30
- resp: ClientResponse = await self.session.delete(url, params=params, **kwargs)
33
+ async def _delete(self, url: str, params: dict = None):
34
+ resp: ClientResponse = await self.session.delete(url, params=params, headers=self._prehook(params))
31
35
  return await self._proc(resp)
32
36
 
33
37
  async def _proc(self, resp: ClientResponse, data=None) -> dict | str:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: xn-client
3
- Version: 0.0.3.dev2
3
+ Version: 0.0.3.dev3
4
4
  Author-email: Mike Artemiev <mixartemev@gmail.com>
5
5
  License: MIT
6
6
  Project-URL: Homepage, https://github.com/XyncNet/x-client
File without changes
File without changes
File without changes