This is an automated email from the ASF dual-hosted git repository.

dongjoon pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/master by this push:
     new 1a5ef40a4d5 [SPARK-41863][INFRA][PYTHON][TESTS] Skip `flake8` tests if 
the command is not available
1a5ef40a4d5 is described below

commit 1a5ef40a4d59b377b028b55ea3805caf5d55f28f
Author: Dongjoon Hyun <dongj...@apache.org>
AuthorDate: Tue Jan 3 15:01:43 2023 -0800

    [SPARK-41863][INFRA][PYTHON][TESTS] Skip `flake8` tests if the command is 
not available
    
    ### What changes were proposed in this pull request?
    
    This PR aims to skip `flake8` tests if the command is not available.
    
    ### Why are the changes needed?
    
    Linters are optional modules and we can be skip in some systems like `mypy`.
    ```
    $ dev/lint-python
    starting python compilation test...
    python compilation succeeded.
    
    The Python library providing 'black' module was not found. Skipping black 
checks for now.
    
    The flake8 command was not found. Skipping for now.
    The mypy command was not found. Skipping for now.
    
    all lint-python tests passed!
    ```
    
    ### Does this PR introduce _any_ user-facing change?
    
    No.
    
    ### How was this patch tested?
    
    Manual tests.
    
    Closes #39372 from dongjoon-hyun/SPARK-41863.
    
    Authored-by: Dongjoon Hyun <dongj...@apache.org>
    Signed-off-by: Dongjoon Hyun <dongj...@apache.org>
---
 dev/lint-python | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/dev/lint-python b/dev/lint-python
index f1f4e9f1070..b5ee63e3869 100755
--- a/dev/lint-python
+++ b/dev/lint-python
@@ -175,9 +175,8 @@ function flake8_test {
     local FLAKE8_STATUS=
 
     if ! hash "$FLAKE8_BUILD" 2> /dev/null; then
-        echo "The flake8 command was not found."
-        echo "flake8 checks failed."
-        exit 1
+        echo "The flake8 command was not found. Skipping for now."
+        return
     fi
 
     _FLAKE8_VERSION=($($FLAKE8_BUILD --version))


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org

Reply via email to