From e94ac51568e3e0043c5fd0f17d546d18f0ef3fa9 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Thu, 15 Feb 2024 09:47:20 +0100 Subject: [PATCH] Optionally install python modules defined in dev-requirements.txt --- .github/workflows/ResInsightWithCache.yml | 2 +- GrpcInterface/CMakeLists.txt | 7 ++----- GrpcInterface/Python/dev-requirements.txt | 6 ++++++ 3 files changed, 9 insertions(+), 6 deletions(-) create mode 100644 GrpcInterface/Python/dev-requirements.txt diff --git a/.github/workflows/ResInsightWithCache.yml b/.github/workflows/ResInsightWithCache.yml index 1d45d0c2bb..7c83bd0a88 100644 --- a/.github/workflows/ResInsightWithCache.yml +++ b/.github/workflows/ResInsightWithCache.yml @@ -87,7 +87,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install -r GrpcInterface/Python/requirements.txt + pip install -r GrpcInterface/Python/dev-requirements.txt - name: Use CMake uses: lukka/get-cmake@latest diff --git a/GrpcInterface/CMakeLists.txt b/GrpcInterface/CMakeLists.txt index 64fcfc6f6c..3747acc6e5 100644 --- a/GrpcInterface/CMakeLists.txt +++ b/GrpcInterface/CMakeLists.txt @@ -251,13 +251,10 @@ endif() # install gRPC Python files if(RESINSIGHT_GRPC_PYTHON_EXECUTABLE AND RESINSIGHT_GRPC_DOWNLOAD_PYTHON_MODULE) - message(STATUS "Installing Python modules") + message(STATUS "Installing Python modules (dev-requirements.txt)") add_custom_command( TARGET PipInstall - COMMAND ${RESINSIGHT_GRPC_PYTHON_EXECUTABLE} ARGS -m pip install --user - wheel setuptools pytest - COMMAND ${RESINSIGHT_GRPC_PYTHON_EXECUTABLE} ARGS -m pip install --user - grpcio-tools) + COMMAND ${RESINSIGHT_GRPC_PYTHON_EXECUTABLE} ARGS -m pip install -r ${GRPC_PYTHON_SOURCE_PATH}/dev-requirements.txt --user ) endif() if(RESINSIGHT_GRPC_PYTHON_EXECUTABLE AND RESINSIGHT_GRPC_BUNDLE_PYTHON_MODULE) diff --git a/GrpcInterface/Python/dev-requirements.txt b/GrpcInterface/Python/dev-requirements.txt new file mode 100644 index 0000000000..26207d9c11 --- /dev/null +++ b/GrpcInterface/Python/dev-requirements.txt @@ -0,0 +1,6 @@ +grpcio +grpcio-tools +protobuf +wheel +typing-extensions +pytest