MAINT: Ensure and auto-test Python.NET and IronPython compatibility#540
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #540 +/- ##
==========================================
+ Coverage 73.43% 75.39% +1.96%
==========================================
Files 22 22
Lines 3256 3252 -4
==========================================
+ Hits 2391 2452 +61
+ Misses 865 800 -65 🚀 New features to boost your workflow:
|
…NET cae was well.
…works in Python.NET environment.
…uses TCP communication.
benjaminbendig
approved these changes
Feb 2, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds comprehensive Python.NET and IronPython compatibility support to ensure PyOptiSLang can be embedded in .NET applications. The changes include detection utilities, process handling fixes for cross-platform .NET interop, and extensive test coverage.
Changes:
- Added
is_pythonnet()utility function to detect Python.NET environments - Fixed process return code handling to prevent UInt32/Int32 marshaling issues at Python↔.NET boundary
- Added comprehensive unit and integration tests for Python.NET compatibility scenarios
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/test_pythonnet_integration.py | Integration tests verifying optiSLang operations work correctly when Python.NET is loaded |
| tests/test_pythonnet_compatibility.py | Unit tests for Python.NET environment detection and subprocess operations with CLR loaded |
| src/ansys/optislang/core/utils.py | Added is_pythonnet() helper function with documentation |
| src/ansys/optislang/core/osl_process.py | Added defensive returncode conversion and IronPython-specific process handling |
| pyproject.toml | Added pythonnet dependency for test suite |
| .github/workflows/integration_tests.yml | Added CI job for Python.NET integration testing |
| .github/workflows/ci_cd.yml | Configured Python.NET runtime environment variable for Linux |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.