From 7869f4112c0db8f4b1f4d0d9e07f2ccd3ce9c5b7 Mon Sep 17 00:00:00 2001 From: Dante Gama Dessavre Date: Fri, 1 May 2020 12:31:20 -0500 Subject: [PATCH 1/5] FIX Small build script corrections --- build.sh | 2 +- ci/gpu/build.sh | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/build.sh b/build.sh index 8f4b0afbc6..7f57d0935d 100755 --- a/build.sh +++ b/build.sh @@ -158,7 +158,7 @@ fi # Build and (optionally) install the cuml Python package -if (( ${NUMARGS} == 0 )) || hasArg cuml; then +if (( ${NUMARGS} == 0 )) || hasArg pyraft; then cd ${REPODIR}/python if [[ ${INSTALL_TARGET} != "" ]]; then diff --git a/ci/gpu/build.sh b/ci/gpu/build.sh index 2747ceac39..3744c15ad3 100644 --- a/ci/gpu/build.sh +++ b/ci/gpu/build.sh @@ -84,7 +84,7 @@ logger "Adding ${CONDA_PREFIX}/lib to LD_LIBRARY_PATH" export LD_LIBRARY_PATH_CACHED=$LD_LIBRARY_PATH export LD_LIBRARY_PATH=$CONDA_PREFIX/lib:$LD_LIBRARY_PATH -logger "Build libcuml, cuml, prims and bench targets..." +logger "Build C++ and Python targets..." $WORKSPACE/build.sh cppraft pyraft -v logger "Resetting LD_LIBRARY_PATH..." @@ -92,9 +92,6 @@ logger "Resetting LD_LIBRARY_PATH..." export LD_LIBRARY_PATH=$LD_LIBRARY_PATH_CACHED export LD_LIBRARY_PATH_CACHED="" -logger "Build treelite for GPU testing..." - -cd $WORKSPACE ################################################################################ @@ -111,10 +108,12 @@ nvidia-smi logger "GoogleTest for raft..." cd $WORKSPACE/cpp/build -GTEST_OUTPUT="xml:${WORKSPACE}/test-results/raft_cpp/" ./test/ml +# Googletests haven't been moved over/integrated yet +# GTEST_OUTPUT="xml:${WORKSPACE}/test-results/raft_cpp/" ./test/ml +# running simple tests meanwhile +./test_raft logger "Python pytest for cuml..." cd $WORKSPACE/python -pytest --cache-clear --junitxml=${WORKSPACE}/junit-cuml.xml -v -s - +python -m pytest pytest --cache-clear --junitxml=${WORKSPACE}/junit-cuml.xml -v -s From 58d0fd25828e65f3af111c196d15c7767c8e222a Mon Sep 17 00:00:00 2001 From: Dante Gama Dessavre Date: Fri, 1 May 2020 12:35:04 -0500 Subject: [PATCH 2/5] DOC Added entry to changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 640b4c90bb..3f67853597 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,3 +8,4 @@ ## Bug Fixes +- PR #5: Small build.sh fixes From 9c721cfba3cedaaa1b082db415cc2b1af48d658d Mon Sep 17 00:00:00 2001 From: Dante Gama Dessavre Date: Mon, 11 May 2020 14:48:24 -0500 Subject: [PATCH 3/5] FIX PEP8 fixes --- ci/gpu/build.sh | 3 +-- python/setup.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/ci/gpu/build.sh b/ci/gpu/build.sh index 3744c15ad3..5b7f68b2c0 100644 --- a/ci/gpu/build.sh +++ b/ci/gpu/build.sh @@ -109,9 +109,8 @@ nvidia-smi logger "GoogleTest for raft..." cd $WORKSPACE/cpp/build # Googletests haven't been moved over/integrated yet -# GTEST_OUTPUT="xml:${WORKSPACE}/test-results/raft_cpp/" ./test/ml +# GTEST_OUTPUT="xml:${WORKSPACE}/test-results/raft_cpp/" ./test_raft # running simple tests meanwhile -./test_raft logger "Python pytest for cuml..." cd $WORKSPACE/python diff --git a/python/setup.py b/python/setup.py index e1d9bb4f9d..4f47f41e0e 100644 --- a/python/setup.py +++ b/python/setup.py @@ -74,7 +74,7 @@ clean_folder(setup_file_path + '/raft') shutil.rmtree(setup_file_path + '/build') - except IOError as e: + except IOError: pass # need to terminate script so cythonizing doesn't get triggered after From dcd94b0ad054df04ebc1e876e76cefb35db324b5 Mon Sep 17 00:00:00 2001 From: Dante Gama Dessavre Date: Mon, 11 May 2020 15:00:45 -0500 Subject: [PATCH 4/5] FEA Add flake8 cython file --- ci/gpu/build.sh | 2 +- python/.flake8.cython | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 python/.flake8.cython diff --git a/ci/gpu/build.sh b/ci/gpu/build.sh index 5b7f68b2c0..62a511eaf0 100644 --- a/ci/gpu/build.sh +++ b/ci/gpu/build.sh @@ -115,4 +115,4 @@ cd $WORKSPACE/cpp/build logger "Python pytest for cuml..." cd $WORKSPACE/python -python -m pytest pytest --cache-clear --junitxml=${WORKSPACE}/junit-cuml.xml -v -s +python -m pytest --cache-clear --junitxml=${WORKSPACE}/junit-cuml.xml -v -s diff --git a/python/.flake8.cython b/python/.flake8.cython new file mode 100644 index 0000000000..c07e670e4c --- /dev/null +++ b/python/.flake8.cython @@ -0,0 +1,28 @@ +# +# Copyright (c) 2020, NVIDIA CORPORATION. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +[flake8] +filename = *.pyx, *.pxd +exclude = *.egg, build, docs, .git +ignore = E999, E225, E226, E227, W503, W504 + +# Rules ignored: +# E999: invalid syntax (works for Python, not Cython) +# E225: Missing whitespace around operators (breaks cython casting syntax like ) +# E226: Missing whitespace around arithmetic operators (breaks cython pointer syntax like int*) +# E227: Missing whitespace around bitwise or shift operator (Can also break casting syntax) +# W503: line break before binary operator (breaks lines that start with a pointer) +# W504: line break after binary operator (breaks lines that end with a pointer) From 945fff32681e7c3eabb6ba1492a960346acb66e9 Mon Sep 17 00:00:00 2001 From: Dante Gama Dessavre Date: Mon, 11 May 2020 15:02:20 -0500 Subject: [PATCH 5/5] FIX clang format fixes --- cpp/include/raft.hpp | 8 +++----- cpp/test/test.cpp | 9 ++++----- 2 files changed, 7 insertions(+), 10 deletions(-) mode change 100755 => 100644 cpp/include/raft.hpp diff --git a/cpp/include/raft.hpp b/cpp/include/raft.hpp old mode 100755 new mode 100644 index 7c12cbf3c8..0c12fb09dc --- a/cpp/include/raft.hpp +++ b/cpp/include/raft.hpp @@ -14,7 +14,6 @@ * limitations under the License. */ - #include namespace raft { @@ -22,10 +21,9 @@ namespace raft { /* Function for testing RAFT include * * @return message indicating RAFT has been included succesfully*/ -inline std::string test_raft() -{ - std::string status = "RAFT Setup succesfully"; - return status; +inline std::string test_raft() { + std::string status = "RAFT Setup succesfully"; + return status; } } // namespace raft diff --git a/cpp/test/test.cpp b/cpp/test/test.cpp index 1cb0434587..1ca69febca 100644 --- a/cpp/test/test.cpp +++ b/cpp/test/test.cpp @@ -14,11 +14,10 @@ * limitations under the License. */ - -#include #include +#include -int main(){ - std::string result = raft::test_raft(); - std::cout << result; +int main() { + std::string result = raft::test_raft(); + std::cout << result; }