diff --git a/CMakeLists.txt b/CMakeLists.txt index d7ad834da..9cfe41712 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -184,6 +184,8 @@ if (OPM_ENABLE_PYTHON) endif() set(Python3_EXECUTABLE ${PYTHON_EXECUTABLE}) set(Python3_LIBRARIES ${PYTHON_LIBRARIES}) + set(Python3_VERSION "${PYTHON_VERSION_STRING}"}) + set(Python3_VERSION_MINOR ${PYTHON_VERSION_MINOR}) else() # Be backwards compatible. if(PYTHON_EXECUTABLE AND NOT Python3_EXECUTABLE) @@ -210,6 +212,10 @@ if (OPM_ENABLE_PYTHON) "Either use \"apt-get install python3-setuptools\" (on Debian/Ubuntu) " "or \"pip install setuptools\"") endif() + if(Python3_VERSION_MINOR LESS 3) + # Python native namespace packages requires python >= 3.3 + message(SEND_ERROR "OPM requires python >= 3.3 but only version ${Python3_VERSION} was found") + endif() # Compatibility settings for PythonInterp and PythonLibs # used e.g. in FindCwrap, pybind11 diff --git a/python/opm/__init__.py b/python/opm/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/python/opm/simulators/__init__.py b/python/opm/simulators/__init__.py deleted file mode 100644 index 66220f553..000000000 --- a/python/opm/simulators/__init__.py +++ /dev/null @@ -1,15 +0,0 @@ -# When using opm-simulators in combination with opm-common, the -# opm-simulators pybind11 module is placed in a package opm2, i.e. opm2.simulators. -# This is done to avoid conflict with the opm-common package prefix opm. -# The following is hack to avoid having to write -# -# from opm2.simulators import BlackOilSimulator -# from opm.io.parser import Parser -# #.... -# -# when it would be more natural to use the "opm" prefix instead of "opm2" -# to import the BlackOilSimulator also. It assumes that PYTHONPATH includes -# the install directory for the pybind11 python module for opm2.simulators - -from opm2.simulators import BlackOilSimulator -