Skip to content

setup.py: respect onnxruntime env variables#1073

Open
AlekseiNikiforovIBM wants to merge 1 commit into
microsoft:mainfrom
AlekseiNikiforovIBM:build_system_env_vars
Open

setup.py: respect onnxruntime env variables#1073
AlekseiNikiforovIBM wants to merge 1 commit into
microsoft:mainfrom
AlekseiNikiforovIBM:build_system_env_vars

Conversation

@AlekseiNikiforovIBM

Copy link
Copy Markdown

setup.py: respect OCOS_ONNXRUNTIME_PKG_URI and OCOS_ONNXRUNTIME_VERSION env variables

With this change it is possible to build onnxruntime-extensions using setup.py with custom-built onnxruntime.

Copilot AI review requested due to automatic review settings June 10, 2026 10:46
@AlekseiNikiforovIBM AlekseiNikiforovIBM requested a review from a team as a code owner June 10, 2026 10:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds support for configuring ONNX Runtime package source/version via environment variables when building the CMake extension.

Changes:

  • Add OCOS_ONNXRUNTIME_PKG_URI as an alternative to self.ort_pkg_dir for supplying the ONNX Runtime package location.
  • Add OCOS_ONNXRUNTIME_VERSION CMake definition when provided via environment.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .pyproject/cmdclass.py
Comment on lines +208 to +212
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')]
Comment thread .pyproject/cmdclass.py
Comment on lines +209 to +212
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')]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants