MCPcopy
hub / github.com/ray-project/ray / build

Function build

python/setup.py:542–689  ·  view source on GitHub ↗
(build_python, build_java, build_cpp, build_redis)

Source from the content-addressed store, hash-verified

540
541
542def build(build_python, build_java, build_cpp, build_redis):
543 if tuple(sys.version_info[:2]) not in SUPPORTED_PYTHONS:
544 msg = (
545 "Detected Python version {}, which is not supported. "
546 "Only Python {} are supported."
547 ).format(
548 ".".join(map(str, sys.version_info[:2])),
549 ", ".join(".".join(map(str, v)) for v in SUPPORTED_PYTHONS),
550 )
551 raise RuntimeError(msg)
552
553 if is_invalid_windows_platform():
554 msg = (
555 "Please use official native CPython on Windows,"
556 " not Cygwin/MSYS/MSYS2/MinGW/etc.\n"
557 + "Detected: {}\n at: {!r}".format(sys.version, sys.executable)
558 )
559 raise OSError(msg)
560
561 # Vendor thirdparty packages.
562 #
563 # TODO(ray-core, ray-ci): the version of these vendored packages should be
564 # pinned, so that the build is reproducible.
565 if not os.getenv("SKIP_THIRDPARTY_INSTALL_CONDA_FORGE"):
566 pip_packages = ["psutil", "colorama"]
567 subprocess.check_call(
568 [
569 sys.executable,
570 "-m",
571 "pip",
572 "install",
573 "-q",
574 "--target=" + os.path.join(ROOT_DIR, THIRDPARTY_SUBDIR),
575 ]
576 + pip_packages,
577 env=dict(os.environ, CC="gcc"),
578 )
579
580 # runtime env agent dependenceis
581 runtime_env_agent_pip_packages = ["aiohttp"]
582 subprocess.check_call(
583 [
584 sys.executable,
585 "-m",
586 "pip",
587 "install",
588 "-q",
589 "--target="
590 + os.path.join(ROOT_DIR, RUNTIME_ENV_AGENT_THIRDPARTY_SUBDIR),
591 ]
592 + runtime_env_agent_pip_packages
593 )
594
595 bazel_targets = []
596 if build_python:
597 bazel_targets.append("//:gen_ray_pkg")
598 if build_cpp:
599 bazel_targets.append("//cpp:gen_ray_cpp_pkg")

Callers 1

pip_runFunction · 0.70

Calls 14

_find_bazel_binFunction · 0.85
check_callMethod · 0.80
extendMethod · 0.80
getcwdMethod · 0.80
existsMethod · 0.80
copyMethod · 0.65
getMethod · 0.65
mapFunction · 0.50
formatMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…