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

cdutz pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/plc4x.git


The following commit(s) were added to refs/heads/develop by this push:
     new 6bb9404  - Added a prerequisite check to check for installation of 
"setuptools" as soon as the "with-python" profile is enabled.
6bb9404 is described below

commit 6bb9404ebe51ba1daac1360ddd21e3fd8ec9b896
Author: cdutz <[email protected]>
AuthorDate: Tue May 25 11:25:54 2021 +0200

    - Added a prerequisite check to check for installation of "setuptools" as 
soon as the "with-python" profile is enabled.
---
 src/main/script/prerequisiteCheck.groovy | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/src/main/script/prerequisiteCheck.groovy 
b/src/main/script/prerequisiteCheck.groovy
index 81b6bbf..b672f56 100644
--- a/src/main/script/prerequisiteCheck.groovy
+++ b/src/main/script/prerequisiteCheck.groovy
@@ -312,6 +312,27 @@ def checkPython() {
     }
 }
 
+def checkSetupTools() {
+    print "Detecting setuptools:      "
+    try {
+        def cmdArray = ["python", "-c", "import setuptools"]
+        def process = cmdArray.execute()
+        def stdOut = new StringBuilder()
+        def stdErr = new StringBuilder()
+        process.consumeProcessOutput(stdOut, stdErr)
+        process.waitForOrKill(500)
+        if(stdErr.contains("No module named setuptools")) {
+            println "missing"
+            allConditionsMet = false
+        } else {
+            println "               OK"
+        }
+    } catch (Exception e) {
+        println "missing"
+        allConditionsMet = false
+    }
+}
+
 /*
  * This check does an extremely simple check, if the boost library exists in 
the maven local repo.
  * We're not checking if it could be resolved.
@@ -500,6 +521,7 @@ if (cppEnabled) {
 
 if (pythonEnabled) {
     checkPython()
+    checkSetupTools()
 }
 
 // Boost needs the visual-studio `cl` compiler to compile the boostrap.

Reply via email to