Skip to content

MAINT: Ensure and auto-test Python.NET and IronPython compatibility#540

Merged
rfahlberg merged 14 commits into
mainfrom
maint/iron_python_compatibility_issues
Feb 2, 2026
Merged

MAINT: Ensure and auto-test Python.NET and IronPython compatibility#540
rfahlberg merged 14 commits into
mainfrom
maint/iron_python_compatibility_issues

Conversation

@rfahlberg

@rfahlberg rfahlberg commented Jan 30, 2026

Copy link
Copy Markdown
Collaborator
  • Fix compatibility issues with IronPython
  • Added unit and integration tests

@rfahlberg rfahlberg requested a review from widerschein January 30, 2026 10:34
@rfahlberg rfahlberg marked this pull request as draft January 30, 2026 10:44
@codecov-commenter

codecov-commenter commented Jan 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.39%. Comparing base (06740c2) to head (545716d).

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:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@rfahlberg rfahlberg marked this pull request as ready for review February 2, 2026 07:27
@rfahlberg rfahlberg requested a review from Copilot February 2, 2026 18:12

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

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.

Comment thread .github/workflows/integration_tests.yml
@rfahlberg rfahlberg merged commit b0161ff into main Feb 2, 2026
31 checks passed
@rfahlberg rfahlberg deleted the maint/iron_python_compatibility_issues branch February 2, 2026 22:19
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.

4 participants