From f6ab2f92d344b7e5b695df649a38061eb0d784e4 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Mon, 14 Oct 2024 15:05:06 +0200 Subject: [PATCH] Python: Adjust pinning to be compatible with ortools ortools is used in the Komodo environment. This environment is not compatible with libprotoc 27 and newer. Use pinning to limit version of libprotoc<27. Add dependency on typing_extensions --- .github/workflows/ResInsightWithCache.yml | 2 +- GrpcInterface/Python/build-requirements.txt | 8 ++++++++ GrpcInterface/Python/setup.py.cmake | 4 ++-- 3 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 GrpcInterface/Python/build-requirements.txt diff --git a/.github/workflows/ResInsightWithCache.yml b/.github/workflows/ResInsightWithCache.yml index 81de5064ad..711407d292 100644 --- a/.github/workflows/ResInsightWithCache.yml +++ b/.github/workflows/ResInsightWithCache.yml @@ -91,7 +91,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install -r GrpcInterface/Python/dev-requirements.txt + pip install -r GrpcInterface/Python/build-requirements.txt - name: Use CMake uses: lukka/get-cmake@latest diff --git a/GrpcInterface/Python/build-requirements.txt b/GrpcInterface/Python/build-requirements.txt new file mode 100644 index 0000000000..6f830264f8 --- /dev/null +++ b/GrpcInterface/Python/build-requirements.txt @@ -0,0 +1,8 @@ +grpcio +grpcio-tools<1.64 # to make sure we use libprotoc 26.1, to display version info use 'python -m grpc_tools.protoc --version' +protobuf>=5.26.1,<5.27 # use same requirements as ortools https://github.com/google/or-tools/blob/stable/ortools/python/setup.py.in +wheel +typing-extensions +pytest +setuptools>=70.0.0 # not directly required, pinned by Snyk to avoid a vulnerability +packaging>=22.0 # https://github.com/pypa/setuptools/issues/4483 \ No newline at end of file diff --git a/GrpcInterface/Python/setup.py.cmake b/GrpcInterface/Python/setup.py.cmake index a82135abbb..bd5f49adf5 100644 --- a/GrpcInterface/Python/setup.py.cmake +++ b/GrpcInterface/Python/setup.py.cmake @@ -6,7 +6,7 @@ with open('README.md') as f: with open('LICENSE') as f: license = f.read() -RIPS_DIST_VERSION = '2' +RIPS_DIST_VERSION = '3' setup( name='rips', @@ -19,6 +19,6 @@ setup( license=license, packages=['rips'], package_data={'rips': ['py.typed', '*.py', 'generated/*.py', 'PythonExamples/*.py', 'tests/*.py']}, - install_requires=['grpcio', 'protobuf', 'wheel'], + install_requires=['grpcio', 'protobuf', 'wheel', 'typing_extensions'], python_requires='>=3.8', )