lsrestclient 3.3.2__tar.gz → 3.4.0__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,13 +1,13 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: lsrestclient
3
- Version: 3.3.2
3
+ Version: 3.4.0
4
4
  Summary: REST Api Client
5
5
  Author: mba
6
6
  Author-email: bartel@electronic-shop.lu
7
7
  Requires-Python: >=3.12,<4.0
8
8
  Classifier: Programming Language :: Python :: 3
9
9
  Provides-Extra: redis
10
- Requires-Dist: fastapi-lsoft (>=1.0.2,<2.0.0)
10
+ Requires-Dist: fastapi-lsoft (>=1.2.0,<2.0.0)
11
11
  Requires-Dist: lsjsonclasses (>=2.0.1,<3.0.0)
12
12
  Requires-Dist: pydantic (>=2.11.7,<3.0.0)
13
13
  Requires-Dist: pydantic-settings (>=2.10.1,<3.0.0)
@@ -77,6 +77,8 @@ class LsRestClient(object):
77
77
  ignore_bearer_context: bool = False,
78
78
  cache: bool = False,
79
79
  cache_backend: LsRestClientBackendEnum = LsRestClientBackendEnum.sqlite,
80
+ cache_control: bool = True,
81
+ stale_while_revalidate: bool = True,
80
82
  ) -> None:
81
83
  """Class representing a REST client for JSON API."""
82
84
  if cache:
@@ -93,7 +95,12 @@ class LsRestClient(object):
93
95
  else:
94
96
  backend = SQLiteCache(f".cache/{name}")
95
97
 
96
- self._session = CachedSession(backend=backend, cache_control=True, filter_fn=self.cache_filter)
98
+ self._session = CachedSession(
99
+ backend=backend,
100
+ cache_control=cache_control,
101
+ filter_fn=self.cache_filter,
102
+ stale_while_revalidate=stale_while_revalidate,
103
+ )
97
104
 
98
105
  else:
99
106
  self._session = Session()
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "lsrestclient"
3
- version = "3.3.2"
3
+ version = "3.4.0"
4
4
  description = "REST Api Client"
5
5
  authors = ["mba <bartel@electronic-shop.lu>"]
6
6
  readme = "README.md"
@@ -15,15 +15,16 @@ requests-cache = "^1.2.1"
15
15
  pydantic = "^2.11.7"
16
16
  pydantic-settings = "^2.10.1"
17
17
  redis = "^6.4.0"
18
- fastapi-lsoft = "^1.0.2"
18
+ fastapi-lsoft = "^1.2.0"
19
19
 
20
20
  [tool.poetry.group.dev.dependencies]
21
- pytest = "^7.4.0"
21
+ pytest = "^8.4.1"
22
22
  black = "^23.7.0"
23
23
  fastapi = "^0.104.1"
24
24
  uvicorn = "^0.35.0"
25
25
  killport = "^1.2.0"
26
- fastapi-lsoft = "^1.0.2"
26
+ fastapi-lsoft = "^1.2.0"
27
+ pytest-asyncio = "^1.1.0"
27
28
 
28
29
  [tool.poetry.extras]
29
30
  redis = ["redis"]
@@ -38,6 +39,11 @@ addopts = "-ra -q -s -v"
38
39
  testpaths = [
39
40
  "tests",
40
41
  ]
42
+
43
+ asyncio_mode = "auto"
44
+ asyncio_default_fixture_loop_scope = "function"
45
+
46
+
41
47
  log_cli = true
42
48
  log_cli_level = "DEBUG"
43
49
  #log_cli_level = "INFO"
File without changes