diff --git a/cmake/morpheus_utils/python/python_module_tools.cmake b/cmake/morpheus_utils/python/python_module_tools.cmake index d4a753d..4760b91 100644 --- a/cmake/morpheus_utils/python/python_module_tools.cmake +++ b/cmake/morpheus_utils/python/python_module_tools.cmake @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2022-2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -89,6 +89,7 @@ function(morpheus_utils_create_python_package PACKAGE_NAME) "${project_dir}/pyproject.toml" "${project_dir}/setup.cfg" "${project_dir}/setup.py" + "${project_dir}/versioneer.py" ) list(APPEND wheel_python_files ${wheel_python_project_files}) @@ -367,7 +368,6 @@ function(morpheus_utils_build_python_package PACKAGE_NAME) # Change which setup we use if we are using inplace if(_ARGS_IS_INPLACE) - list(APPEND _pip_command "-e") list(APPEND _pip_command "${sources_source_dir}") else() list(APPEND _pip_command "${sources_binary_dir}") @@ -622,10 +622,11 @@ macro(__create_python_library MODULE_NAME) # Before installing, create the custom command to generate the stubs add_custom_command( OUTPUT ${module_binary_stub_file} - COMMAND ${Python3_EXECUTABLE} -m pybind11_stubgen ${TARGET_NAME} --no-setup-py --log-level WARN -o ./ --root-module-suffix \"\" + COMMAND env PYTHONPATH=${module_root_binary_dir}:$PYTHONPATH ${Python3_EXECUTABLE} -m pybind11_stubgen ${TARGET_NAME} --no-setup-py --log-level WARN -o ./ --root-module-suffix "" DEPENDS ${PYTHON_ACTIVE_PACKAGE_NAME}-modules $ COMMENT "Building stub for python module ${TARGET_NAME}..." WORKING_DIRECTORY ${module_root_binary_dir} + VERBATIM ) # Add a custom target to ensure the stub generation runs