Skip to content

Commit

Permalink
Try to address linting issues (ray-project#8485)
Browse files Browse the repository at this point in the history
  • Loading branch information
mehrdadn committed May 19, 2020
1 parent a73c488 commit 8da084b
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,11 @@ jobs:
BAZEL_CACHE_CREDENTIAL_B64: ${{ secrets.BAZEL_CACHE_CREDENTIAL_B64 }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
#LINUX_WHEELS: 1
LINT: 1
#MAC_WHEELS: 1
RAY_DEFAULT_BUILD: 1
WINDOWS_WHEELS: 1
run: |
. ./ci/travis/ci.sh init
. ./ci/travis/ci.sh lint
. ./ci/travis/ci.sh build
. ./ci/travis/ci.sh upload_wheels || true
. ./ci/travis/ci.sh test_python
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ if [ "$RAY_BUILD_PYTHON" == "YES" ]; then
# Install pickle5-backport.
TEMP_DIR="$(mktemp -d)"
pushd "$TEMP_DIR"
wget --quiet -O pickle5-backport.zip https://github.com/suquark/pickle5-backport/archive/8ffe41ceba9d5e2ce8a98190f6b3d2f3325e5a72.zip
curl -f -s -L -R -o "pickle5-backport.zip" "https://github.com/suquark/pickle5-backport/archive/8ffe41ceba9d5e2ce8a98190f6b3d2f3325e5a72.zip"
unzip pickle5-backport.zip
pushd pickle5-backport-8ffe41ceba9d5e2ce8a98190f6b3d2f3325e5a72
CC=gcc "$PYTHON_EXECUTABLE" setup.py --quiet bdist_wheel
Expand Down
2 changes: 1 addition & 1 deletion ci/travis/check-git-clang-format-output.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ if [ -z "${TRAVIS_PULL_REQUEST-}" ] || [ "${TRAVIS_PULL_REQUEST}" = "false" ]; t
base_commit="HEAD^"
echo "Running clang-format against parent commit $(git rev-parse "$base_commit")"
else
base_commit="$TRAVIS_BRANCH"
base_commit="$(git merge-base "${TRAVIS_BRANCH}" HEAD)"
echo "Running clang-format against branch $base_commit, with hash $(git rev-parse "$base_commit")"
fi
exclude_regex="(.*thirdparty/|.*redismodule.h|.*.java|.*.jsx?|.*.tsx?)"
Expand Down
18 changes: 13 additions & 5 deletions ci/travis/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -262,10 +262,14 @@ build_wheels() {
}

lint_readme() {
(
cd "${WORKSPACE_DIR}"/python
python setup.py check --restructuredtext --strict --metadata
)
if python -s -c "import docutils" >/dev/null 2>/dev/null; then
(
cd "${WORKSPACE_DIR}"/python
python setup.py check --restructuredtext --strict --metadata
)
else
echo "Skipping README lint because the docutils package is not installed" 1>&2
fi
}

lint_python() {
Expand Down Expand Up @@ -310,7 +314,11 @@ _lint() {
linux*) platform=linux;;
esac

"${ROOT_DIR}"/check-git-clang-format-output.sh
if command -v clang-format > /dev/null; then
"${ROOT_DIR}"/check-git-clang-format-output.sh
else
{ echo "WARNING: Skipping linting C/C++ as clang-format is not installed."; } 2> /dev/null
fi

# Run Python linting
lint_python
Expand Down

0 comments on commit 8da084b

Please sign in to comment.