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

szaszm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git

commit d3d205f3c8a8376bbad4c8a47758d585d57c653b
Author: Gabor Gyimesi <gamezb...@gmail.com>
AuthorDate: Mon May 6 20:39:07 2024 +0200

    MINIFICPP-2360 Fix python venv configuration and compatibility tests
    
    Closes #1781
    
    Signed-off-by: Marton Szasz <sza...@apache.org>
---
 .github/workflows/verify-python-compatibility.yml            | 4 +++-
 docker/test/integration/features/python_with_modules.feature | 3 ++-
 extensions/python/PythonDependencyInstaller.cpp              | 1 +
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/verify-python-compatibility.yml 
b/.github/workflows/verify-python-compatibility.yml
index 0e7748225..bcb83ea44 100644
--- a/.github/workflows/verify-python-compatibility.yml
+++ b/.github/workflows/verify-python-compatibility.yml
@@ -24,7 +24,9 @@ jobs:
       - id: build
         run: |
           if [ -d ~/.ccache ]; then mv ~/.ccache .; fi
-          mkdir build && cd build && cmake -DENABLE_PYTHON_SCRIPTING=ON 
-DDOCKER_BUILD_ONLY=ON -DDOCKER_CCACHE_DUMP_LOCATION=$HOME/.ccache .. && make 
centos
+          mkdir build && cd build && cmake -DENABLE_AWS=OFF 
-DENABLE_LIBRDKAFKA=OFF -DENABLE_KUBERNETES=OFF -DENABLE_SYSTEMD=OFF 
-DENABLE_SQL=OFF -DENABLE_MQTT=OFF -DENABLE_GCP=OFF \
+              -DENABLE_AZURE=OFF -DENABLE_SPLUNK=OFF 
-DENABLE_ELASTICSEARCH=OFF -DENABLE_PROMETHEUS=OFF -DDOCKER_BUILD_ONLY=ON 
-DENABLE_PROCFS=OFF -DENABLE_OPC=OFF \
+              -DDOCKER_CCACHE_DUMP_LOCATION=$HOME/.ccache .. && make centos
       - uses: actions/upload-artifact@v3
         with:
           name: minifi-tar
diff --git a/docker/test/integration/features/python_with_modules.feature 
b/docker/test/integration/features/python_with_modules.feature
index 0e766df67..85272a7aa 100644
--- a/docker/test/integration/features/python_with_modules.feature
+++ b/docker/test/integration/features/python_with_modules.feature
@@ -20,7 +20,8 @@ Feature: MiNiFi can use python modules
     Given the content of "/tmp/output" is monitored
 
   Scenario: MiNiFi can use python modules
-    Given a GaussianDistributionWithNumpy processor
+    Given the example MiNiFi python processors are present
+    And a GaussianDistributionWithNumpy processor
     And the scheduling period of the GaussianDistributionWithNumpy processor 
is set to "10 min"
     And a PutFile processor with the "Directory" property set to "/tmp/output"
     And the "success" relationship of the GaussianDistributionWithNumpy 
processor is connected to the PutFile
diff --git a/extensions/python/PythonDependencyInstaller.cpp 
b/extensions/python/PythonDependencyInstaller.cpp
index b8239e54f..6b6d92249 100644
--- a/extensions/python/PythonDependencyInstaller.cpp
+++ b/extensions/python/PythonDependencyInstaller.cpp
@@ -136,6 +136,7 @@ void PythonDependencyInstaller::evalScript(std::string_view 
script) {
   }
 
   OwnedDict bindings = OwnedDict::create();
+  bindings.put("__builtins__", OwnedObject(PyImport_ImportModule("builtins")));
   const auto result = OwnedObject(PyEval_EvalCode(compiled_string.get(), 
bindings.get(), bindings.get()));
   if (!result.get()) {
     throw PyException();

Reply via email to