From 25a041daaea210ffed64dc88a384149e9a1995f5 Mon Sep 17 00:00:00 2001 From: Lars Ivar Hatledal Date: Wed, 7 May 2025 10:19:14 +0200 Subject: [PATCH] remove sources from modelDescription as they can't be used for anything --- pythonfmu/builder.py | 13 ------------- pythonfmu/tests/test_builder.py | 11 +---------- 2 files changed, 1 insertion(+), 23 deletions(-) diff --git a/pythonfmu/builder.py b/pythonfmu/builder.py index ae7a726..03516d4 100644 --- a/pythonfmu/builder.py +++ b/pythonfmu/builder.py @@ -288,19 +288,6 @@ def build_FMU( # Add information for the Python loader zip_fmu.writestr(str(resource.joinpath("slavemodule.txt")), module_name) - # Add FMI API wrapping Python class source - source_node = SubElement(type_node, "SourceFiles") - sources = Path("sources") - src = HERE / "pythonfmu-export" - for f in itertools.chain( - src.rglob("*.hpp"), src.rglob("*.cpp"), src.rglob("CMakeLists.txt") - ): - relative_f = f.relative_to(src) - SubElement( - source_node, "File", attrib={"name": relative_f.as_posix()} - ) - zip_fmu.write(f, arcname=(sources / relative_f)) - # Add FMI API wrapping Python class library binaries = Path("binaries") src_binaries = HERE / "resources" / "binaries" diff --git a/pythonfmu/tests/test_builder.py b/pythonfmu/tests/test_builder.py index bb78d98..5f736c8 100644 --- a/pythonfmu/tests/test_builder.py +++ b/pythonfmu/tests/test_builder.py @@ -38,7 +38,7 @@ def test_zip_content(tmp_path): module_file = "/".join(("resources", "slavemodule.txt")) assert module_file in names - nfiles = 20 + nfiles = 16 if FmuBuilder.has_binary(): assert ( "/".join(("binaries", get_platform(), f"PythonSlave.{lib_extension}")) @@ -47,15 +47,6 @@ def test_zip_content(tmp_path): else: nfiles -= 1 - # Check sources - src_folder = Path(pythonfmu.__path__[0]) / "pythonfmu-export" - for f in itertools.chain( - src_folder.rglob("*.hpp"), - src_folder.rglob("*.cpp"), - src_folder.rglob("CMakeLists.txt"), - ): - assert "/".join(("sources", f.relative_to(src_folder).as_posix())) in names - # Check pythonfmu is embedded pkg_folder = Path(pythonfmu.__path__[0]) for f in pkg_folder.rglob("*.py"):