From 0d7ef46c8338a452815fb2e5ce8aaefb96a939b8 Mon Sep 17 00:00:00 2001 From: Philipp Moritz Date: Wed, 4 Mar 2020 13:13:21 -0800 Subject: [PATCH] Bazel improvements (#7427) * Make wget quiet * Make sphinx-build quiet * Remove -q from pip install in CI script as config already takes care of it * Add documentation on custom dependencies * formatting * python --- .travis.yml | 8 ++++---- doc/source/development.rst | 25 +++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 52985f0fb..8ee95bc0f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -98,9 +98,9 @@ matrix: - ./ci/travis/install-dependencies.sh - export PATH="$HOME/miniconda/bin:$PATH" - cd doc - - pip install -q -r requirements-doc.txt - - pip install -q yapf==0.23.0 - - sphinx-build -W -b html -d _build/doctrees source _build/html + - pip install -r requirements-doc.txt + - pip install yapf==0.23.0 + - sphinx-build -q -W -b html -d _build/doctrees source _build/html - cd .. # Run Python linting, ignore dict vs {} (C408), others are defaults - flake8 --inline-quotes '"' --no-avoid-escape --exclude=python/ray/core/generated/,streaming/python/generated,doc/source/conf.py,python/ray/cloudpickle/,python/ray/thirdparty_files --ignore=C408,E121,E123,E126,E226,E24,E704,W503,W504,W605 @@ -110,7 +110,7 @@ matrix: - python setup.py check --restructuredtext --strict --metadata - cd .. # Run Bazel linter Buildifier. - - wget https://dl.google.com/go/go1.11.linux-amd64.tar.gz + - wget -q https://dl.google.com/go/go1.11.linux-amd64.tar.gz - tar -xf go1.11.linux-amd64.tar.gz - mkdir $HOME/go_dir - export GOROOT=`pwd`/go diff --git a/doc/source/development.rst b/doc/source/development.rst index 6025ebb2e..259f7dc4e 100644 --- a/doc/source/development.rst +++ b/doc/source/development.rst @@ -38,6 +38,31 @@ the following: This command is not enough to recompile all C++ unit tests. To do so, see `Testing locally`_. +Using a local repository for dependencies +----------------------------------------- + +If you'd like to build Ray with custom dependencies (for example, with a +different version of Cython), you can modify your ``.bzl`` file as follows: + +.. code-block:: python + + http_archive( + name = "cython", + ..., + ) if False else native.new_local_repository( + name = "cython", + build_file = "bazel/BUILD.cython", + path = "../cython", + ) + +This replaces the existing ``http_archive`` rule with one that references a +sibling of your Ray directory (named ``cython``) using the build file +provided in the Ray repository (``bazel/BUILD.cython``). +If the dependency already has a Bazel build file in it, you can use +``native.local_repository`` instead, and omit ``build_file``. + +To test switching back to the original rule, change ``False`` to ``True``. + Debugging ---------