Skip to content

Commit a0fb98c

Browse files
committed
pulling version from setup.py
1 parent f82ab33 commit a0fb98c

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

redis/__init__.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
import sys
2+
if sys.version_info >= (3,8):
3+
from importlib import metadata
4+
else:
5+
import importlib_metadata as metadata
6+
17
from redis.client import Redis, StrictRedis
28
from redis.cluster import RedisCluster
39
from redis.connection import (
@@ -38,7 +44,7 @@ def int_or_str(value):
3844
return value
3945

4046

41-
__version__ = "4.1.0rc2"
47+
__version__ = metadata.version('redis')
4248

4349

4450
VERSION = tuple(map(int_or_str, __version__.split(".")))

setup.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
long_description_content_type="text/markdown",
1111
keywords=["Redis", "key-value store", "database"],
1212
license="MIT",
13-
version=redis.__version__,
13+
version="4.1.0rc2",
1414
packages=find_packages(
1515
include=[
1616
"redis",
@@ -26,12 +26,10 @@
2626
author="Redis Inc.",
2727
author_email="[email protected]",
2828
python_requires=">=3.6",
29-
setup_requires=[
30-
"packaging>=21.3",
31-
],
3229
install_requires=[
3330
"deprecated>=1.2.3",
3431
"packaging>=21.3",
32+
'importlib-metadata >= 1.0; python_version < "3.8"',
3533
],
3634
classifiers=[
3735
"Development Status :: 5 - Production/Stable",

0 commit comments

Comments
 (0)