Skip to content

Conversation

@ivaylo-matov
Copy link
Contributor

@ivaylo-matov ivaylo-matov commented Oct 24, 2025

Purpose

PR in response to DYN-9388.

This is re-submit of #16548 with one major change:

proposed upgrade to SDK 10.0.100-rc.2.25502.107

Previous downgrade to preview.5 seems to be causing a bug where calling .NET methods from Python can throw odd null-ref exceptions.

  • for testing UX scenarios
  • pythonnet3 loaded as built-in package
  • for now cpython is still present but does not load
  • to be discussed what to do with python tests. Note that test will fail now as they still rely on built-in cpython logic.
  • when users open old graph with cpython nodes, they get updated to PythonNet3 and toast is displayed. On save another text box appears to explain the changes. Should reflect latest Figma design
image image image

With the proposed changes all but 2 DynamoPythonTests pass locally. The two failing test are caused by updates in python 3.11 and have been marked as failures for the time being.

Failing tests:

  • Test_With_Exception_IDisposeCheck_Python
  • TestListDecoding
Screenshot 2025-10-24 201420

Declarations

Check these if you believe they are true

Release Notes

Make PythonNet3 default python engine as built-in package

Reviewers

@zeusongit
@DynamoDS/eidos

FYIs

@dnenov
@achintyabhat

ivaylo-matov and others added 30 commits September 3, 2025 09:42
cpython still present but does not load
Copilot AI review requested due to automatic review settings October 24, 2025 19:14
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

See the ticket for this pull request: https://jira.autodesk.com/browse/DYN-9388

Copy link
Contributor

Copilot AI left a comment

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 transitions the default Python engine from CPython3 to PythonNet3 by loading it as a built-in package, addressing issues with CPython's null-reference exceptions when calling .NET methods. The update includes automatic node migration, user notifications, and test suite updates to reflect the new default engine.

  • Replaces CPython3 with PythonNet3 as the default built-in Python engine
  • Implements automatic migration of legacy CPython nodes to PythonNet3 with user notifications
  • Updates all test graphs and test code to use PythonNet3 instead of CPython3

Reviewed Changes

Copilot reviewed 87 out of 100 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
global.json Updates .NET SDK version to rc.1.25451.107
src/DynamoCore/DynamoCore.csproj Adds PythonNet3 package reference and build target to create built-in package structure
src/NodeServices/PythonServices.cs Adds PythonNet3EngineName constant and removes CPython auto-loading logic
src/Libraries/PythonNodeModels/PythonNode.cs Changes default engine from CPython3 to PythonNet3 and adds ShowAutoUpgradedBar property
src/PythonMigrationViewExtension/PythonMigrationViewExtension.cs Implements CPython to PythonNet3 auto-upgrade logic with toast notifications
src/DynamoCoreWpf/Properties/Resources.resx Adds localized strings for Python engine change notifications
test/Libraries/DynamoPythonTests/*.cs Updates all test files to use PythonNet3Evaluator instead of CPythonEvaluator
test/core/python/*.dyn Updates test graph files to use PythonNet3 engine
src/Libraries/DSCPython/* Removes entire DSCPython library and related resource files
Files not reviewed (4)
  • src/DynamoCoreWpf/Properties/Resources.Designer.cs: Language not supported
  • src/Libraries/DSCPython/Properties/Resources.Designer.cs: Language not supported
  • src/Libraries/PythonNodeModels/Properties/Resources.Designer.cs: Language not supported
  • src/PythonMigrationViewExtension/Properties/Resources.Designer.cs: Language not supported
Comments suppressed due to low confidence (2)

src/PythonMigrationViewExtension/PythonMigrationViewExtension.cs:1

  • Corrected spelling of 'sis' to 'is'.
    src/PythonMigrationViewExtension/PythonMigrationViewExtension.cs:1
  • Corrected spelling of 'toas' to 'toast'.

@zeusongit
Copy link
Contributor

zeusongit commented Oct 30, 2025

@ivaylo-matov We have updated our build pipelines with RC2 for master, can you update this PR accordingly? Also, mark the 3 failing test as failure, and note them down so we can take a look at them later.

Update DynamoCore.csproj
@ivaylo-matov ivaylo-matov force-pushed the DYN-9388-Make-PythonNet3-default-in-4.0_251024 branch from d12f49d to 1e56a28 Compare October 31, 2025 12:30
@ivaylo-matov
Copy link
Contributor Author

ivaylo-matov commented Oct 31, 2025

@zeusongit, done!

ivaylo-matov and others added 8 commits November 4, 2025 12:11
Changed the Python engine from CPython3 to PythonNet3 in Core_Math.dyn and Core_Python.dyn. Also updated output names, descriptions, group properties, and version metadata in Core_Python.dyn for improved clarity and compatibility.
@zeusongit
Copy link
Contributor

Cherrypicked some changes from my other branch, which I created based off this PR.
These should fix all tests except 3. A fix coming soon for those 3 as well.

@zeusongit
Copy link
Contributor

@zeusongit zeusongit merged commit 912f431 into DynamoDS:master Nov 4, 2025
24 of 27 checks passed
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