"""
@file
@defgroup rtctk_componentFramework_pybindings Python Bindings
@ingroup rtctk_componentFramework

@internal
@brief Python bindings for the component framework.

@copyright
  SPDX-FileCopyrightText: 2022-2025 European Southern Observatory (ESO) @n
  SPDX-License-Identifier: LGPL-3.0-only
"""

from wtools.module import declare_cshlib

declare_cshlib(
    target="rtctk/framework",
    features="pyext",
    # Hiding symbols to avoid compiler warnings, to generate smaller binaries, and for
    # proper pybind11 operation (according to pybind11 FAQ).
    cxxflags="-fvisibility=hidden",
    use=[
        "pybind11",
        "fmt",
        "client-api.cpp-pybindings.common",
        "componentFramework.services.common",
        "componentFramework.services.serviceRegistry",
        "componentFramework.services.oldb",
        "componentFramework.services.runtimeRepo",
        "componentFramework.services.persistentRepo",
        "componentFramework.services.populateConfig",
    ],
    ut_attrs=dict(
        use=lambda pkgs, _: pkgs
        + [
            "componentFramework.services.testSupport.common",
            "componentFramework.services.testSupport.runtimeRepo",
        ],
        ldflags="-rdynamic",
        features="pyext pyembed",
    ),
    install_path="${PYTHONDIR}/rtctk",
    valgrind_suppression=["test/valgrind.supp"],
)
