rediscache 1.0.0__tar.gz → 1.0.1__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.
- {rediscache-1.0.0 → rediscache-1.0.1}/PKG-INFO +26 -8
- {rediscache-1.0.0 → rediscache-1.0.1}/README.md +21 -3
- {rediscache-1.0.0 → rediscache-1.0.1}/pyproject.toml +16 -9
- {rediscache-1.0.0 → rediscache-1.0.1}/rediscache/__init__.py +0 -1
- {rediscache-1.0.0 → rediscache-1.0.1}/LICENSE +0 -0
- {rediscache-1.0.0 → rediscache-1.0.1}/rediscache/tools.py +0 -0
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
2
|
Name: rediscache
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.1
|
|
4
4
|
Summary: Redis caching of functions evolving over time
|
|
5
|
-
Home-page: https://github.com/AmadeusITGroup/RedisCache
|
|
6
5
|
License: MIT
|
|
7
6
|
Keywords: redis,performance,cache
|
|
8
7
|
Author: Pierre Cart-Grandjean
|
|
@@ -20,9 +19,10 @@ Classifier: Programming Language :: Python :: 3.9
|
|
|
20
19
|
Classifier: Programming Language :: Python :: 3.10
|
|
21
20
|
Classifier: Programming Language :: Python :: 3.11
|
|
22
21
|
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
23
23
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
24
|
-
Requires-Dist: executiontime (>=0.3
|
|
25
|
-
Requires-Dist: redis (>=5.
|
|
24
|
+
Requires-Dist: executiontime (>=0.4.3,<0.5.0)
|
|
25
|
+
Requires-Dist: redis (>=5.2.1,<6.0.0)
|
|
26
26
|
Project-URL: Repository, https://github.com/AmadeusITGroup/RedisCache
|
|
27
27
|
Description-Content-Type: text/markdown
|
|
28
28
|
|
|
@@ -46,7 +46,7 @@ This is a great caching mechanism for functions that will give a consistent outp
|
|
|
46
46
|
|
|
47
47
|
## Installation
|
|
48
48
|
|
|
49
|
-
Simply install the PyPi package:
|
|
49
|
+
Simply install the PyPi package [rediscache](https://pypi.org/project/rediscache/):
|
|
50
50
|
|
|
51
51
|
```bash
|
|
52
52
|
pip install rediscache
|
|
@@ -188,10 +188,10 @@ My development environment is handled by Poetry. I use `Python 3.11.7`.
|
|
|
188
188
|
|
|
189
189
|
To make sure we use Redis properly, we do not mock it in the unit tess. So you will need a localhost default instance of Redis server without a password. This means that the unit tests are more like integration tests.
|
|
190
190
|
|
|
191
|
-
The execution of the tests including coverage result
|
|
191
|
+
The execution of the tests including coverage result is done with `pytest`:
|
|
192
192
|
|
|
193
193
|
```bash
|
|
194
|
-
|
|
194
|
+
poetry run pytest --cov=rediscache
|
|
195
195
|
```
|
|
196
196
|
|
|
197
197
|
## CI/CD
|
|
@@ -210,3 +210,21 @@ We get help from re-usable actions. Here is the [Marketplace](https://github.com
|
|
|
210
210
|
|
|
211
211
|
For the moment the publish to PyPI is done manually with the `publish.sh` script. You will need a PyPI API token in `PYPI_API_TOKEN`, stored in a `secrets.sh`.
|
|
212
212
|
|
|
213
|
+
## Demo application
|
|
214
|
+
|
|
215
|
+
In the `demo` directory you will find a web application to test `RedisCache`.
|
|
216
|
+
|
|
217
|
+
```bash
|
|
218
|
+
poetry run webapp
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
Entry points:
|
|
222
|
+
|
|
223
|
+
- Call to long function with parameter value `20` and using the cache but waiting for a result: [link](http://localhost:9090/cached/20)
|
|
224
|
+
- Call to long function with parameter value `20` without using the cache: [link](http://localhost:9090/direct/20)
|
|
225
|
+
- Get the stats stored in Redis database: [link](http://localhost:9090/stats)
|
|
226
|
+
|
|
227
|
+
There is also a `Nginx` configuration file to further test if with a load balancing of workers. It is useful to demonstrate that many workers can share efficiently the same instance of `Redis`.
|
|
228
|
+
|
|
229
|
+
Finally a `Gatling` configuration file can be used to test the performance.
|
|
230
|
+
|
|
@@ -18,7 +18,7 @@ This is a great caching mechanism for functions that will give a consistent outp
|
|
|
18
18
|
|
|
19
19
|
## Installation
|
|
20
20
|
|
|
21
|
-
Simply install the PyPi package:
|
|
21
|
+
Simply install the PyPi package [rediscache](https://pypi.org/project/rediscache/):
|
|
22
22
|
|
|
23
23
|
```bash
|
|
24
24
|
pip install rediscache
|
|
@@ -160,10 +160,10 @@ My development environment is handled by Poetry. I use `Python 3.11.7`.
|
|
|
160
160
|
|
|
161
161
|
To make sure we use Redis properly, we do not mock it in the unit tess. So you will need a localhost default instance of Redis server without a password. This means that the unit tests are more like integration tests.
|
|
162
162
|
|
|
163
|
-
The execution of the tests including coverage result
|
|
163
|
+
The execution of the tests including coverage result is done with `pytest`:
|
|
164
164
|
|
|
165
165
|
```bash
|
|
166
|
-
|
|
166
|
+
poetry run pytest --cov=rediscache
|
|
167
167
|
```
|
|
168
168
|
|
|
169
169
|
## CI/CD
|
|
@@ -181,3 +181,21 @@ We get help from re-usable actions. Here is the [Marketplace](https://github.com
|
|
|
181
181
|
### Publish to PyPI
|
|
182
182
|
|
|
183
183
|
For the moment the publish to PyPI is done manually with the `publish.sh` script. You will need a PyPI API token in `PYPI_API_TOKEN`, stored in a `secrets.sh`.
|
|
184
|
+
|
|
185
|
+
## Demo application
|
|
186
|
+
|
|
187
|
+
In the `demo` directory you will find a web application to test `RedisCache`.
|
|
188
|
+
|
|
189
|
+
```bash
|
|
190
|
+
poetry run webapp
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
Entry points:
|
|
194
|
+
|
|
195
|
+
- Call to long function with parameter value `20` and using the cache but waiting for a result: [link](http://localhost:9090/cached/20)
|
|
196
|
+
- Call to long function with parameter value `20` without using the cache: [link](http://localhost:9090/direct/20)
|
|
197
|
+
- Get the stats stored in Redis database: [link](http://localhost:9090/stats)
|
|
198
|
+
|
|
199
|
+
There is also a `Nginx` configuration file to further test if with a load balancing of workers. It is useful to demonstrate that many workers can share efficiently the same instance of `Redis`.
|
|
200
|
+
|
|
201
|
+
Finally a `Gatling` configuration file can be used to test the performance.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
# For more details on this file see: https://python-poetry.org/docs/pyproject/
|
|
1
2
|
[tool.poetry]
|
|
2
3
|
name = "rediscache"
|
|
3
|
-
version = "1.0.
|
|
4
|
+
version = "1.0.1"
|
|
4
5
|
description = "Redis caching of functions evolving over time"
|
|
5
6
|
authors = ["Pierre Cart-Grandjean <pcart-grandjean@amadeus.com>"]
|
|
6
7
|
license = "MIT"
|
|
@@ -21,25 +22,31 @@ classifiers = [
|
|
|
21
22
|
"Programming Language :: Python :: 3.11",
|
|
22
23
|
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
23
24
|
]
|
|
25
|
+
packages = [{ include = "rediscache" }]
|
|
24
26
|
|
|
25
27
|
[tool.poetry.dependencies]
|
|
26
28
|
python = "^3.9"
|
|
27
|
-
redis = "^5.
|
|
28
|
-
executiontime = "^0.3
|
|
29
|
+
redis = "^5.2.1"
|
|
30
|
+
executiontime = "^0.4.3"
|
|
29
31
|
|
|
30
32
|
[tool.poetry.group.dev.dependencies]
|
|
31
|
-
pylint = "^3.
|
|
32
|
-
pytest = "^8.
|
|
33
|
+
pylint = "^3.3.5"
|
|
34
|
+
pytest = "^8.3.5"
|
|
33
35
|
pdbpp = "^0.10.3"
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
mypy = "^1.15.0"
|
|
37
|
+
safety = "^3.3.1"
|
|
38
|
+
black = "^25.1.0"
|
|
39
|
+
pytest-cov = "^6.0.0"
|
|
40
|
+
tornado = "^6.4.2"
|
|
41
|
+
pip-audit = "^2.8.0"
|
|
38
42
|
|
|
39
43
|
[build-system]
|
|
40
44
|
requires = ["poetry-core"]
|
|
41
45
|
build-backend = "poetry.core.masonry.api"
|
|
42
46
|
|
|
47
|
+
[tool.poetry.scripts]
|
|
48
|
+
webapp = "demo.webapp:main"
|
|
49
|
+
|
|
43
50
|
[tool.mypy]
|
|
44
51
|
strict = true
|
|
45
52
|
|
|
File without changes
|
|
File without changes
|