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
This commit is contained in:
Philipp Moritz
2020-03-04 13:13:21 -08:00
committed by GitHub
parent 596b39e36a
commit 0d7ef46c83
2 changed files with 29 additions and 4 deletions
+4 -4
View File
@@ -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
+25
View File
@@ -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
---------