simple-redis-cache 0.1.0__tar.gz → 0.2.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.
Files changed (20) hide show
  1. {simple_redis_cache-0.1.0 → simple_redis_cache-0.2.0}/PKG-INFO +2 -1
  2. {simple_redis_cache-0.1.0 → simple_redis_cache-0.2.0}/README.md +1 -0
  3. {simple_redis_cache-0.1.0 → simple_redis_cache-0.2.0}/pyproject.toml +1 -1
  4. simple_redis_cache-0.2.0/src/__init__.py +1 -0
  5. simple_redis_cache-0.2.0/src/simple_redis_cache/__init__.py +1 -0
  6. {simple_redis_cache-0.1.0 → simple_redis_cache-0.2.0}/src/simple_redis_cache/cache.py +5 -3
  7. {simple_redis_cache-0.1.0 → simple_redis_cache-0.2.0}/src/simple_redis_cache.egg-info/PKG-INFO +2 -1
  8. {simple_redis_cache-0.1.0 → simple_redis_cache-0.2.0}/tests/test_key_generator.py +1 -3
  9. simple_redis_cache-0.1.0/src/__init__.py +0 -0
  10. simple_redis_cache-0.1.0/src/simple_redis_cache/__init__.py +0 -0
  11. {simple_redis_cache-0.1.0 → simple_redis_cache-0.2.0}/LICENSE +0 -0
  12. {simple_redis_cache-0.1.0 → simple_redis_cache-0.2.0}/setup.cfg +0 -0
  13. {simple_redis_cache-0.1.0 → simple_redis_cache-0.2.0}/src/simple_redis_cache/encoder.py +0 -0
  14. {simple_redis_cache-0.1.0 → simple_redis_cache-0.2.0}/src/simple_redis_cache/key_generator.py +0 -0
  15. {simple_redis_cache-0.1.0 → simple_redis_cache-0.2.0}/src/simple_redis_cache.egg-info/SOURCES.txt +0 -0
  16. {simple_redis_cache-0.1.0 → simple_redis_cache-0.2.0}/src/simple_redis_cache.egg-info/dependency_links.txt +0 -0
  17. {simple_redis_cache-0.1.0 → simple_redis_cache-0.2.0}/src/simple_redis_cache.egg-info/requires.txt +0 -0
  18. {simple_redis_cache-0.1.0 → simple_redis_cache-0.2.0}/src/simple_redis_cache.egg-info/top_level.txt +0 -0
  19. {simple_redis_cache-0.1.0 → simple_redis_cache-0.2.0}/tests/test_cache.py +0 -0
  20. {simple_redis_cache-0.1.0 → simple_redis_cache-0.2.0}/tests/test_encoder.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: simple-redis-cache
3
- Version: 0.1.0
3
+ Version: 0.2.0
4
4
  Summary: A library that simplifies working with Redis in Python
5
5
  Requires-Python: >=3.10
6
6
  Description-Content-Type: text/markdown
@@ -11,6 +11,7 @@ Dynamic: license-file
11
11
  # simple-redis-cache
12
12
 
13
13
  [![Coverage](https://img.shields.io/badge/coverage-100%25-brightgreen)](https://hotpotato89.github.io/simple-redis-cache/coverage/)
14
+ [![PyPI version](https://badge.fury.io/py/simple-redis-cache.svg)](https://badge.fury.io/py/simple-redis-cache)
14
15
 
15
16
  Простой декоратор для кэширования асинхронных функций в Redis.
16
17
 
@@ -1,6 +1,7 @@
1
1
  # simple-redis-cache
2
2
 
3
3
  [![Coverage](https://img.shields.io/badge/coverage-100%25-brightgreen)](https://hotpotato89.github.io/simple-redis-cache/coverage/)
4
+ [![PyPI version](https://badge.fury.io/py/simple-redis-cache.svg)](https://badge.fury.io/py/simple-redis-cache)
4
5
 
5
6
  Простой декоратор для кэширования асинхронных функций в Redis.
6
7
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "simple-redis-cache"
3
- version = "0.1.0"
3
+ version = "0.2.0"
4
4
  description = "A library that simplifies working with Redis in Python"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.10"
@@ -0,0 +1 @@
1
+ from .simple_redis_cache import Cache # noqa
@@ -0,0 +1 @@
1
+ from .cache import Cache # noqa
@@ -87,7 +87,7 @@ class Cache:
87
87
  data_to_cache = json.dumps(result, cls=CustomJSONEncoder)
88
88
  await self.redis_client.set(cache_key, data_to_cache, ex=ttl)
89
89
  self.logger.debug("Cache saved: %s", cache_key)
90
- except Exception as exc: # pragma: no cover
90
+ except Exception as exc: # pragma: no cover
91
91
  self.logger.warning(
92
92
  "Failed cache set for key: %s",
93
93
  cache_key,
@@ -116,7 +116,9 @@ class Cache:
116
116
 
117
117
  try:
118
118
  while True:
119
- if asyncio.get_event_loop().time() - start_time > timeout_seconds: # pragma: no cover
119
+ if (
120
+ asyncio.get_event_loop().time() - start_time > timeout_seconds
121
+ ): # pragma: no cover
120
122
  self.logger.warning(
121
123
  "Cache invalidation timed out (%s)", timeout_seconds
122
124
  )
@@ -138,7 +140,7 @@ class Cache:
138
140
  self.logger.info("Cache invalidated (%s keys)", deleted_count)
139
141
  return deleted_count
140
142
 
141
- except Exception as exc: # pragma: no cover
143
+ except Exception as exc: # pragma: no cover
142
144
  self.logger.error(
143
145
  "Failed to invalidate cache",
144
146
  exc_info=exc,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: simple-redis-cache
3
- Version: 0.1.0
3
+ Version: 0.2.0
4
4
  Summary: A library that simplifies working with Redis in Python
5
5
  Requires-Python: >=3.10
6
6
  Description-Content-Type: text/markdown
@@ -11,6 +11,7 @@ Dynamic: license-file
11
11
  # simple-redis-cache
12
12
 
13
13
  [![Coverage](https://img.shields.io/badge/coverage-100%25-brightgreen)](https://hotpotato89.github.io/simple-redis-cache/coverage/)
14
+ [![PyPI version](https://badge.fury.io/py/simple-redis-cache.svg)](https://badge.fury.io/py/simple-redis-cache)
14
15
 
15
16
  Простой декоратор для кэширования асинхронных функций в Redis.
16
17
 
@@ -1,5 +1,3 @@
1
- import pytest
2
-
3
1
  from src.simple_redis_cache.key_generator import clean_args, gen_cache_key
4
2
 
5
3
 
@@ -163,4 +161,4 @@ class TestGenCacheKey:
163
161
 
164
162
  key1 = gen_cache_key(test_func, (None,), {})
165
163
  key2 = gen_cache_key(test_func, (5,), {})
166
- assert key1 != key2
164
+ assert key1 != key2
File without changes