Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump dependencies #16

Merged
merged 2 commits into from
Jan 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/unittest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]
python-version: ["3.9", "3.10", "3.11", "3.12"]
name: Python ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v2
Expand Down
14 changes: 7 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@ def read(fname):


TESTS_REQUIREMENTS = [
"black==22.*,>=22.1.0",
"black==23.*,>=23.12.1",
"preggy==1.*,>=1.4.4",
"pyssim==0.*,>=0.4",
"pytest==7.*,>=7.0.0",
"pytest-cov==3.*,>=3.0.0",
"pytest-asyncio==0.*,>=0.18.0",
"pyssim==0.*,>=0.7",
"pytest==7.*,>=7.4.3",
"pytest-cov==4.*,>=4.1.0",
"pytest-asyncio==0.*,>=0.23.2",
]

RUNTIME_REQUIREMENTS = [
"redis==5.*,>=5.0.1",
"thumbor==7.*,>=7.0.6",
"pre-commit==2.*,>=2.17.0",
"thumbor==7.*,>=7.7.2",
"pre-commit==3.*,>=3.6.0",
]

setup(
Expand Down
23 changes: 18 additions & 5 deletions tc_redis/base_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@


class RedisBaseStorage:

single_node_storage = None
cluster_storage = None
sentinel_storage = None
Expand All @@ -29,7 +28,9 @@ def __init__(self, context, storage_type):
"db": self.context.config.get("REDIS_STORAGE_SERVER_DB"),
"host": self.context.config.get("REDIS_STORAGE_SERVER_HOST"),
"instances": self.context.config.get(
"REDIS_CLUSTER_STORAGE_STARTUP_INSTANCES" if self.context.config.get("REDIS_STORAGE_MODE") == CLUSTER else "REDIS_SENTINEL_STORAGE_INSTANCES"
"REDIS_CLUSTER_STORAGE_STARTUP_INSTANCES"
if self.context.config.get("REDIS_STORAGE_MODE") == CLUSTER
else "REDIS_SENTINEL_STORAGE_INSTANCES"
),
"master_instance": self.context.config.get(
"REDIS_SENTINEL_STORAGE_MASTER_INSTANCE"
Expand All @@ -56,7 +57,9 @@ def __init__(self, context, storage_type):
"db": self.context.config.get("REDIS_RESULT_STORAGE_SERVER_DB"),
"host": self.context.config.get("REDIS_RESULT_STORAGE_SERVER_HOST"),
"instances": self.context.config.get(
"REDIS_CLUSTER_RESULT_STORAGE_STARTUP_INSTANCES" if self.context.config.get("REDIS_RESULT_STORAGE_MODE") == CLUSTER else "REDIS_SENTINEL_RESULT_STORAGE_INSTANCES"
"REDIS_CLUSTER_RESULT_STORAGE_STARTUP_INSTANCES"
if self.context.config.get("REDIS_RESULT_STORAGE_MODE") == CLUSTER
else "REDIS_SENTINEL_RESULT_STORAGE_INSTANCES"
),
"master_instance": self.context.config.get(
"REDIS_SENTINEL_RESULT_STORAGE_MASTER_INSTANCE"
Expand Down Expand Up @@ -138,8 +141,18 @@ def connect_redis_single_node(self):
)

def connect_redis_cluster(self):
instances_split = [tuple(instance.strip().split(":")) for instance in self.storage_values[self.storage_type]["instances"].split(",")]
instances = list(map(lambda x: ClusterNode(x[0], int(x[1] if len(x) == 2 else 6379)), instances_split))
instances_split = [
tuple(instance.strip().split(":"))
for instance in self.storage_values[self.storage_type]["instances"].split(
","
)
]
instances = list(
map(
lambda x: ClusterNode(x[0], int(x[1] if len(x) == 2 else 6379)),
instances_split,
)
)

if self.storage_values[self.storage_type]["password"] is None:
return RedisCluster(
Expand Down
Loading