-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
[Serve] Good error message when Serve not installed and ensure Serve installs ray[default] #19570
Conversation
.buildkite/pipeline.yml
Outdated
@@ -201,6 +201,8 @@ | |||
python/ray/tests/test_basic_3 | |||
- bazel test --test_output=streamed --config=ci --test_env=RAY_MINIMAL=1 $(./scripts/bazel_export_options) | |||
python/ray/tests/test_runtime_env_ray_minimal | |||
- bazel test --test_output=streamed --config=ci --test_env=RAY_MINIMAL=1 $(./scripts/bazel_export_options) | |||
python/ray/tests/test_serve_ray_minimal | |||
# TODO(archit) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My fault, forgot to remove this... I can remove this in my next PR, or feel free to remove it in this PR
python/ray/serve/__init__.py
Outdated
from ray.serve.batching import batch | ||
from ray.serve.config import HTTPOptions | ||
except ModuleNotFoundError as e: | ||
e.msg += (". You can run `pip install ray[serve]` to install all Ray Serve" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
e.msg += (". You can run `pip install ray[serve]` to install all Ray Serve" | |
e.msg += (". You can run `pip install 'ray[serve]'` to install all Ray Serve" |
To make it work with zsh
which is the default shell on newer Macs
os.environ.get("RAY_MINIMAL") != "1", | ||
reason="This test is only run in CI with a minimal Ray installation.") | ||
def test_errr_msg(): | ||
with pytest.raises(ModuleNotFoundError, match="install ray\[serve\]"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with pytest.raises(ModuleNotFoundError, match="install ray\[serve\]"): | |
with pytest.raises(ModuleNotFoundError, match="install 'ray\[serve\]'"): |
python/setup.py
Outdated
@@ -211,6 +211,9 @@ def get_packages(self): | |||
], | |||
} | |||
|
|||
# Ray Serve depends on the Ray dashboard components. | |||
setup_spec.extras["serve"] += setup_spec.extras["default"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! I assume nothing bad should happen if the same dependency appears twice in the list? (e.g. if it appears both in the original "serve" list and also in the "default" list)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah there will be problems, fixed it
@pytest.mark.skipif( | ||
os.environ.get("RAY_MINIMAL") != "1", | ||
reason="This test is only run in CI with a minimal Ray installation.") | ||
def test_errr_msg(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def test_errr_msg(): | |
def test_error_msg(): |
Why are these changes needed?
Related issue number
Closes #19262
Closes #19303
Checks
scripts/format.sh
to lint the changes in this PR.