From d9998bfab321bce44d35fcaa881fe682e66714d8 Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Fri, 15 Jan 2021 10:52:25 +0100 Subject: [PATCH 1/1] pylint may be available as pylint3 or pylint --- CMakeLists.txt | 13 ++++++++++--- docs/develop/Development-Environment.md | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 88565238..761531b1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -140,6 +140,8 @@ if (BUILD_TESTS) set(TEST_BDD db osm2pgsql api) + find_program(PYLINT NAMES pylint3 pylint) + foreach (test ${TEST_BDD}) add_test(NAME bdd_${test} COMMAND behave ${test} @@ -156,9 +158,14 @@ if (BUILD_TESTS) COMMAND phpcs --report-width=120 --colors lib website utils WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}) - add_test(NAME pylint - COMMAND pylint3 nominatim - WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}) + if (PYLINT) + message(STATUS "Using '${PYLINT}' for Python linting.") + add_test(NAME pylint + COMMAND ${PYLINT} nominatim + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}) + else() + message(STATUS "pylint not found. Linting tests disabled.") + endif() endif() #----------------------------------------------------------------------------- diff --git a/docs/develop/Development-Environment.md b/docs/develop/Development-Environment.md index 36b34ccb..75324e71 100644 --- a/docs/develop/Development-Environment.md +++ b/docs/develop/Development-Environment.md @@ -47,7 +47,7 @@ To install all necessary packages run: ```sh sudo apt install php-cgi phpunit php-codesniffer \ - python3-pip python3-setuptools python3-dev pylint3 + python3-pip python3-setuptools python3-dev pylint pip3 install --user behave mkdocs ``` -- 2.39.5