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

Fix mypy error: Module "ray" does not explicitly export attribute "remote" #36356

Merged
merged 1 commit into from
Jun 13, 2023
Merged
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
10 changes: 4 additions & 6 deletions python/ray/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,8 @@ def __getattr__(self, attr):
state = _DeprecationWrapper("state", ray._private.state)


RAY_APIS = {
# Pulic Ray APIs
__all__ = [
"__version__",
"_config",
"get_runtime_context",
Expand Down Expand Up @@ -223,7 +224,7 @@ def __getattr__(self, attr):
"LOCAL_MODE",
"SCRIPT_MODE",
"WORKER_MODE",
}
]

# Public APIs that should automatically trigger ray.init().
AUTO_INIT_APIS = {
Expand Down Expand Up @@ -263,15 +264,12 @@ def __getattr__(self, attr):
"timeline",
}

assert RAY_APIS == AUTO_INIT_APIS | NON_AUTO_INIT_APIS
assert set(__all__) == AUTO_INIT_APIS | NON_AUTO_INIT_APIS
from ray._private.auto_init_hook import wrap_auto_init_for_all_apis # noqa: E402

wrap_auto_init_for_all_apis(AUTO_INIT_APIS)
del wrap_auto_init_for_all_apis


__all__ = list(RAY_APIS)

# Subpackages
__all__ += [
"actor",
Expand Down