bazel.py 532 B

12345678910111213141516171819202122
  1. import os
  2. import runfiles
  3. REPO_NAME = "com_github_ray_project_ray"
  4. _LEGACY_REPO_ROOT = os.path.abspath(
  5. os.path.join(os.path.dirname(__file__), "../.."),
  6. )
  7. the_runfiles = runfiles.Create()
  8. def _norm_path_join(*args):
  9. return os.path.normpath(os.path.join(*args))
  10. def bazel_runfile(*args):
  11. """Return the path to a runfile in the release directory."""
  12. p = _norm_path_join(*args)
  13. if the_runfiles:
  14. return the_runfiles.Rlocation(os.path.join(REPO_NAME, p))
  15. return os.path.join(_LEGACY_REPO_ROOT, p)