mirror of
https://github.com/vale981/ray
synced 2025-03-06 02:21:39 -05:00
Fail format.sh if yapf/flake8 versions are incorrect. (#5083)
This commit is contained in:
parent
54d5969cea
commit
9cc4cc6a52
4 changed files with 25 additions and 3 deletions
|
@ -38,7 +38,6 @@ matrix:
|
|||
env: LINT=1 PYTHONWARNINGS=ignore
|
||||
before_install:
|
||||
- sudo apt-get update -qq
|
||||
- sudo apt-get install -qq clang-format-6.0
|
||||
install: []
|
||||
script:
|
||||
- ./ci/travis/check-git-clang-format-output.sh
|
||||
|
|
|
@ -22,6 +22,29 @@ if ! [[ -e "$ROOT/.git/refs/remotes/upstream" ]]; then
|
|||
git remote add 'upstream' 'https://github.com/ray-project/ray.git'
|
||||
fi
|
||||
|
||||
FLAKE8_VERSION=$(flake8 --version | awk '{print $1}')
|
||||
YAPF_VERSION=$(yapf --version | awk '{print $2}')
|
||||
|
||||
if [[ $FLAKE8_VERSION != "3.7.7" ]]; then
|
||||
echo "Please install flake8==3.7.7. You currently are using $FLAKE8_VERSION."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ $YAPF_VERSION != "0.23.0" ]]; then
|
||||
echo "Please install yapf==0.23.0. You currently are using $YAPF_VERSION."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if which clang-format >/dev/null; then
|
||||
CLANG_FORMAT_VERSION=$(clang-format --version | awk '{print $3}')
|
||||
if [[ $CLANG_FORMAT_VERSION != "7.0.0" ]]; then
|
||||
echo "Please install clang-format 7.0.0. You currently are using $CLANG_FORMAT_VERSION."
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "WARNING: clang-format is not installed!"
|
||||
fi
|
||||
|
||||
# Only fetch master since that's the branch we're diffing against.
|
||||
git fetch upstream master || true
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ elif [[ "$LINT" == "1" ]]; then
|
|||
bash miniconda.sh -b -p $HOME/miniconda
|
||||
export PATH="$HOME/miniconda/bin:$PATH"
|
||||
# Install Python linting tools.
|
||||
pip install -q flake8 flake8-comprehensions
|
||||
pip install -q flake8==3.7.7 flake8-comprehensions
|
||||
pip install flake8-quotes==2.0.0
|
||||
elif [[ "$LINUX_WHEELS" == "1" ]]; then
|
||||
sudo apt-get install docker
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
flake8
|
||||
flake8==3.7.7
|
||||
flake8-quotes
|
||||
gym
|
||||
opencv-python
|
||||
|
|
Loading…
Add table
Reference in a new issue