Skip to content

Commit

Permalink
Use a single source of truth for version info
Browse files Browse the repository at this point in the history
  • Loading branch information
akx committed Oct 16, 2024
1 parent 0f335c3 commit ac7e7e7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
7 changes: 5 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "redis"
version = "5.1.0b7"
dynamic = ["version"]
description = "Python client for Redis database and key-value store"
readme = "README.md"
license = "MIT"
Expand All @@ -26,7 +26,7 @@ classifiers = [
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",x
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
Expand Down Expand Up @@ -55,6 +55,9 @@ Documentation = "https://redis.readthedocs.io/en/latest/"
Homepage = "https://github.com/redis/redis-py"
"Issue tracker" = "https://github.com/redis/redis-py/issues"

[tool.hatch.version]
path = "redis/__init__.py"

[tool.hatch.build.targets.sdist]
include = [
"/redis",
Expand Down
13 changes: 2 additions & 11 deletions redis/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from importlib import metadata

from redis import asyncio # noqa
from redis.backoff import default_backoff
from redis.client import Redis, StrictRedis
Expand Down Expand Up @@ -44,16 +42,9 @@ def int_or_str(value):
return value


try:
__version__ = metadata.version("redis")
except metadata.PackageNotFoundError:
__version__ = "99.99.99"

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

try:
VERSION = tuple(map(int_or_str, __version__.split(".")))
except AttributeError:
VERSION = tuple([99, 99, 99])

__all__ = [
"AuthenticationError",
Expand Down

0 comments on commit ac7e7e7

Please sign in to comment.