diff --git a/python/setup.py b/python/setup.py index 05a15764edf20..00bf5c26e96a7 100644 --- a/python/setup.py +++ b/python/setup.py @@ -4,6 +4,7 @@ import io import logging import os +import platform import re import shutil import subprocess @@ -264,9 +265,20 @@ def get_packages(self): "numpy >= 1.19.3; python_version >= '3.9'", "protobuf >= 3.15.3", "pyyaml", - "redis >= 3.5.0, < 4.0.0", ] +if platform.system() == "Darwin" and platform.machine() == "arm64": + # TODO (Alex): `hiredis` doesn't have prebuilt M1 mac wheels yet. We can + # remove this, either when they add support, we remove redis, or we vendor + # redis/hiredis ourselves. + setup_spec.install_requires.append("redis >= 3.5.0") +elif platform.system() == "Windows": + # TODO (Alex): Ray is not compatible with redis >= 4.0.0. We ened to either + # investigate why, or remove the redis dependency. + setup_spec.install_requires.append("redis >= 3.5.0, < 4.0") +else: + setup_spec.install_requires.append("redis[hiredis] >= 3.5.0") + def is_native_windows_or_msys(): """Check to see if we are running on native Windows,