|
12 | 12 |
|
13 | 13 | # Add the directory containing pyarrow to the Python path so that we find the
|
14 | 14 | # pyarrow version packaged with ray and not a pre-existing pyarrow.
|
15 |
| -pyarrow_path = os.path.join(os.path.abspath(os.path.dirname(__file__)), |
16 |
| - "pyarrow_files") |
| 15 | +pyarrow_path = os.path.join( |
| 16 | + os.path.abspath(os.path.dirname(__file__)), "pyarrow_files") |
17 | 17 | sys.path.insert(0, pyarrow_path)
|
18 | 18 |
|
19 | 19 | # See https://github.com/ray-project/ray/issues/131.
|
|
27 | 27 | try:
|
28 | 28 | import pyarrow # noqa: F401
|
29 | 29 | except ImportError as e:
|
30 |
| - if ((hasattr(e, "msg") and isinstance(e.msg, str) and |
31 |
| - ("libstdc++" in e.msg or "CXX" in e.msg))): |
| 30 | + if ((hasattr(e, "msg") and isinstance(e.msg, str) |
| 31 | + and ("libstdc++" in e.msg or "CXX" in e.msg))): |
32 | 32 | # This code path should be taken with Python 3.
|
33 | 33 | e.msg += helpful_message
|
34 |
| - elif (hasattr(e, "message") and isinstance(e.message, str) and |
35 |
| - ("libstdc++" in e.message or "CXX" in e.message)): |
| 34 | + elif (hasattr(e, "message") and isinstance(e.message, str) |
| 35 | + and ("libstdc++" in e.message or "CXX" in e.message)): |
36 | 36 | # This code path should be taken with Python 2.
|
37 |
| - condition = (hasattr(e, "args") and isinstance(e.args, tuple) and |
38 |
| - len(e.args) == 1 and isinstance(e.args[0], str)) |
| 37 | + condition = (hasattr(e, "args") and isinstance(e.args, tuple) |
| 38 | + and len(e.args) == 1 and isinstance(e.args[0], str)) |
39 | 39 | if condition:
|
40 |
| - e.args = (e.args[0] + helpful_message,) |
| 40 | + e.args = (e.args[0] + helpful_message, ) |
41 | 41 | else:
|
42 | 42 | if not hasattr(e, "args"):
|
43 | 43 | e.args = ()
|
44 | 44 | elif not isinstance(e.args, tuple):
|
45 |
| - e.args = (e.args,) |
46 |
| - e.args += (helpful_message,) |
| 45 | + e.args = (e.args, ) |
| 46 | + e.args += (helpful_message, ) |
47 | 47 | raise
|
48 | 48 |
|
49 | 49 | from ray.local_scheduler import _config # noqa: E402
|
50 |
| -from ray.worker import (error_info, init, connect, disconnect, |
51 |
| - get, put, wait, remote, log_event, log_span, |
52 |
| - flush_log, get_gpu_ids, get_webui_url, |
| 50 | +from ray.worker import (error_info, init, connect, disconnect, get, put, wait, |
| 51 | + remote, log_event, log_span, flush_log, get_gpu_ids, |
| 52 | + get_webui_url, |
53 | 53 | register_custom_serializer) # noqa: E402
|
54 | 54 | from ray.worker import (SCRIPT_MODE, WORKER_MODE, PYTHON_MODE,
|
55 | 55 | SILENT_MODE) # noqa: E402
|
|
63 | 63 | # Fix this.
|
64 | 64 | __version__ = "0.4.0"
|
65 | 65 |
|
66 |
| -__all__ = ["error_info", "init", "connect", "disconnect", "get", "put", "wait", |
67 |
| - "remote", "log_event", "log_span", "flush_log", "actor", "method", |
68 |
| - "get_gpu_ids", "get_webui_url", "register_custom_serializer", |
69 |
| - "SCRIPT_MODE", "WORKER_MODE", "PYTHON_MODE", "SILENT_MODE", |
70 |
| - "global_state", "_config", "__version__"] |
| 66 | +__all__ = [ |
| 67 | + "error_info", "init", "connect", "disconnect", "get", "put", "wait", |
| 68 | + "remote", "log_event", "log_span", "flush_log", "actor", "method", |
| 69 | + "get_gpu_ids", "get_webui_url", "register_custom_serializer", |
| 70 | + "SCRIPT_MODE", "WORKER_MODE", "PYTHON_MODE", "SILENT_MODE", "global_state", |
| 71 | + "_config", "__version__" |
| 72 | +] |
71 | 73 |
|
72 | 74 | import ctypes # noqa: E402
|
73 | 75 | # Windows only
|
|
0 commit comments