Skip to content

Commit

Permalink
Don't throw an error when we're in a sphinx build
Browse files Browse the repository at this point in the history
  • Loading branch information
dagardner-nv committed Jul 11, 2023
1 parent 890bbbb commit 71e9950
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
12 changes: 6 additions & 6 deletions docs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ set(SPHINX_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/source)
set(SPHINX_BUILD ${CMAKE_CURRENT_BINARY_DIR}/html)

add_custom_target(${PROJECT_NAME}_docs ALL
COMMAND
BUILD_DIR=${CMAKE_CURRENT_BINARY_DIR}
${SPHINX_EXECUTABLE} -b html -j auto -T
${SPHINX_SOURCE} ${SPHINX_BUILD}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating documentation with Sphinx")
COMMAND
BUILD_DIR=${CMAKE_CURRENT_BINARY_DIR}
MORPHEUS_IN_SPHINX_BUILD=1 ${SPHINX_EXECUTABLE} -b html -j auto -T
${SPHINX_SOURCE} ${SPHINX_BUILD}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating documentation with Sphinx")

list(POP_BACK CMAKE_MESSAGE_CONTEXT)
13 changes: 9 additions & 4 deletions morpheus/_lib/src/utilities/cudf_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <pybind11/gil.h>
#include <pybind11/pybind11.h>

#include <cstdlib> // for getenv
#include <memory>
#include <ostream> // Needed for logging
#include <utility> // for move
Expand All @@ -41,10 +42,14 @@ void CudfHelper::load()
{
if (import_morpheus___lib__cudf_helpers() != 0)
{
pybind11::error_already_set ex;

LOG(ERROR) << "Could not load cudf_helpers library: " << ex.what();
throw ex;
// Only log/throw if we are not in a sphinx build
if (std::getenv("MORPHEUS_IN_SPHINX_BUILD") == nullptr)
{
pybind11::error_already_set ex;

LOG(ERROR) << "Could not load cudf_helpers library: " << ex.what();
throw ex;
}
}
}

Expand Down

0 comments on commit 71e9950

Please sign in to comment.