From eefd37768de83f85042b0a5ec8fc4cca30199166 Mon Sep 17 00:00:00 2001 From: Aleksei Nikiforov Date: Tue, 12 May 2026 13:54:42 +0200 Subject: [PATCH] setup.py: respect OCOS_ONNXRUNTIME_PKG_URI and OCOS_ONNXRUNTIME_VERSION env variables --- .pyproject/cmdclass.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.pyproject/cmdclass.py b/.pyproject/cmdclass.py index 3f5147380..165c53807 100644 --- a/.pyproject/cmdclass.py +++ b/.pyproject/cmdclass.py @@ -205,6 +205,11 @@ def build_cmake(self, extension): if self.ort_pkg_dir: cmake_args += ['-DONNXRUNTIME_PKG_DIR=' + self.ort_pkg_dir] + elif os.environ.get('OCOS_ONNXRUNTIME_PKG_URI'): + cmake_args += ['-DOCOS_ONNXRUNTIME_PKG_URI=' + os.environ.get('OCOS_ONNXRUNTIME_PKG_URI')] + + if os.environ.get('OCOS_ONNXRUNTIME_VERSION'): + cmake_args += ['-DOCOS_ONNXRUNTIME_VERSION=' + os.environ.get('OCOS_ONNXRUNTIME_VERSION')] if self.no_opencv: # Disabling openCV can drastically reduce the build time.