diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index f34a5c5d5c9293c90c7e4c288eb61ea25ab70cfd..518173fdf8769ce5428e074e3463834d61aa07a4 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -13,7 +13,7 @@ endif() if(${dune-common_VERSION} VERSION_GREATER_EQUAL 2.9) dune_python_install_package( PATH "." - CMAKE_METADATA_FILE dumux/metadata.cmake + PACKAGENAME dumux DEPENDS _common CMAKE_METADATA_FLAGS DUNE_OPTS_FILE ) diff --git a/python/dumux/__init__.py b/python/dumux/__init__.py index 5bcb3ab2d1ec8dd680e6e36a83a2f2575d95899e..0a1fd4f22b13afc5c031c42295f3bfd1e73c99a4 100644 --- a/python/dumux/__init__.py +++ b/python/dumux/__init__.py @@ -11,10 +11,14 @@ https://dumux.org/ """ try: - from dune.common import registerExternalModule + from dune.packagemetadata import registerExternalModule + import pathlib # register dumux to be recognized by dune-py (code generation module) # as a module of the dune univers - registerExternalModule("dumux") + registerExternalModule( + moduleName="dumux", + modulePath=str(pathlib.Path(__file__).parent.resolve()), + ) except ImportError: pass diff --git a/python/dumux/common/properties.py b/python/dumux/common/properties.py index 0e791e1edb85fa349ecefef5fa5444035b7dce98..a456c4de6a51d5ba5adb3df55099bb54513b58cb 100644 --- a/python/dumux/common/properties.py +++ b/python/dumux/common/properties.py @@ -151,7 +151,7 @@ def propertiesHeaderPath(): """Find the path to the properties.hh C++ header""" path, _ = os.path.split(dumux.__file__) - metaDataFile = os.path.join(path, "data/metadata.cmake") + metaDataFile = os.path.join(path, "data/dumux.cmake") if os.path.exists(metaDataFile): data = {} with open(metaDataFile, "r") as metaData: diff --git a/python/setup.py.in b/python/setup.py.in index 539ce130d7cb05e227856fb9d499015619e7e397..1ec54395ef3f8b27266aa968f0ce9c5bf6440044 100644 --- a/python/setup.py.in +++ b/python/setup.py.in @@ -10,7 +10,7 @@ setup( author_email="${ProjectMaintainerEmail}", packages=find_packages(), zip_safe=0, - package_data={"": ["*.so"]}, + package_data={"": ["*.so"], "dumux": ["data/*.cmake"]}, install_requires=REQUIRED_PACKAGES, include_package_data=True, )