Skip to content

Commit 38f5741

Browse files
authored
DYN-9388 Make PythonNet3 default python engine as built-in package (DynamoDS#16548)
1 parent ec4642f commit 38f5741

File tree

97 files changed

+1258
-3889
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+1258
-3889
lines changed

.github/scripts/check_file_version.ps1

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,12 @@ $excludedFiles = @(
6868
"TuneUp.dll",
6969
"TuneUp.resources.dll",
7070
"Units.dll",
71-
"Webview2Loader.dll"
71+
"Webview2Loader.dll",
72+
"DSPythonNet3.dll",
73+
"DSPythonNet3.resources.dll",
74+
"DSPythonNet3Extension.dll",
75+
"DSPythonNet3Empty.dll",
76+
"DSPythonNet3Wheels.dll"
7277
)
7378
$noVersion = @()
7479
$wrongVersion = @()
-40.5 MB
Binary file not shown.

extern/Python/Python.Included.dll

-44.2 MB
Binary file not shown.

extern/Python/Python.Runtime.dll

-205 KB
Binary file not shown.

src/Dynamo.All.sln

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DynamoFeatureFlags", "Tools
7979
EndProject
8080
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Analysis", "Libraries\Analysis\Analysis.csproj", "{76686ED6-E759-4772-81C2-768740BE13FA}"
8181
EndProject
82-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DSCPython", "Libraries\DSCPython\DSCPython.csproj", "{F1541C2D-80A9-4FE7-8D9E-75A8B9FF3479}"
83-
EndProject
8482
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GeometryColor", "Libraries\GeometryColor\GeometryColor.csproj", "{A50C198C-DA6E-4081-BC53-0F44D287F207}"
8583
EndProject
8684
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GeometryUI", "Libraries\GeometryUI\GeometryUI.csproj", "{E674F1A1-BE83-475A-9CC9-F55CADBEC448}"
@@ -305,10 +303,6 @@ Global
305303
{76686ED6-E759-4772-81C2-768740BE13FA}.Debug|Any CPU.Build.0 = Debug|Any CPU
306304
{76686ED6-E759-4772-81C2-768740BE13FA}.Release|Any CPU.ActiveCfg = Release|Any CPU
307305
{76686ED6-E759-4772-81C2-768740BE13FA}.Release|Any CPU.Build.0 = Release|Any CPU
308-
{F1541C2D-80A9-4FE7-8D9E-75A8B9FF3479}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
309-
{F1541C2D-80A9-4FE7-8D9E-75A8B9FF3479}.Debug|Any CPU.Build.0 = Debug|Any CPU
310-
{F1541C2D-80A9-4FE7-8D9E-75A8B9FF3479}.Release|Any CPU.ActiveCfg = Release|Any CPU
311-
{F1541C2D-80A9-4FE7-8D9E-75A8B9FF3479}.Release|Any CPU.Build.0 = Release|Any CPU
312306
{A50C198C-DA6E-4081-BC53-0F44D287F207}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
313307
{A50C198C-DA6E-4081-BC53-0F44D287F207}.Debug|Any CPU.Build.0 = Debug|Any CPU
314308
{A50C198C-DA6E-4081-BC53-0F44D287F207}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -569,7 +563,6 @@ Global
569563
{C0D6DEE5-5532-4345-9C66-4C00D7FDB8BE} = {FA7BE306-A3B0-45FA-9D87-0C69E6932C13}
570564
{94CF053D-BB66-4FC7-883B-48F072701BA9} = {D114C59C-CF66-4CC2-980F-9301FB4EA4E1}
571565
{76686ED6-E759-4772-81C2-768740BE13FA} = {FA7BE306-A3B0-45FA-9D87-0C69E6932C13}
572-
{F1541C2D-80A9-4FE7-8D9E-75A8B9FF3479} = {FA7BE306-A3B0-45FA-9D87-0C69E6932C13}
573566
{A50C198C-DA6E-4081-BC53-0F44D287F207} = {FA7BE306-A3B0-45FA-9D87-0C69E6932C13}
574567
{E674F1A1-BE83-475A-9CC9-F55CADBEC448} = {FA7BE306-A3B0-45FA-9D87-0C69E6932C13}
575568
{8872CA17-C10D-43B9-8393-5C5A57065EB0} = {FA7BE306-A3B0-45FA-9D87-0C69E6932C13}

src/DynamoCore.sln

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AssemblyInfoGenerator", "As
7777
EndProject
7878
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Analysis", "Libraries\Analysis\Analysis.csproj", "{76686ED6-E759-4772-81C2-768740BE13FA}"
7979
EndProject
80-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DSCPython", "Libraries\DSCPython\DSCPython.csproj", "{F1541C2D-80A9-4FE7-8D9E-75A8B9FF3479}"
81-
EndProject
8280
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GeometryColor", "Libraries\GeometryColor\GeometryColor.csproj", "{A50C198C-DA6E-4081-BC53-0F44D287F207}"
8381
EndProject
8482
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GeometryUI", "Libraries\GeometryUI\GeometryUI.csproj", "{E674F1A1-BE83-475A-9CC9-F55CADBEC448}"
@@ -385,18 +383,6 @@ Global
385383
{76686ED6-E759-4772-81C2-768740BE13FA}.Release|NET_Linux.Build.0 = Release|NET_Linux
386384
{76686ED6-E759-4772-81C2-768740BE13FA}.Release|Publish_Linux.ActiveCfg = Release|Publish_Linux
387385
{76686ED6-E759-4772-81C2-768740BE13FA}.Release|Publish_Linux.Build.0 = Release|Publish_Linux
388-
{F1541C2D-80A9-4FE7-8D9E-75A8B9FF3479}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
389-
{F1541C2D-80A9-4FE7-8D9E-75A8B9FF3479}.Debug|Any CPU.Build.0 = Debug|Any CPU
390-
{F1541C2D-80A9-4FE7-8D9E-75A8B9FF3479}.Debug|NET_Linux.ActiveCfg = Debug|NET_Linux
391-
{F1541C2D-80A9-4FE7-8D9E-75A8B9FF3479}.Debug|NET_Linux.Build.0 = Debug|NET_Linux
392-
{F1541C2D-80A9-4FE7-8D9E-75A8B9FF3479}.Debug|Publish_Linux.ActiveCfg = Debug|Publish_Linux
393-
{F1541C2D-80A9-4FE7-8D9E-75A8B9FF3479}.Debug|Publish_Linux.Build.0 = Debug|Publish_Linux
394-
{F1541C2D-80A9-4FE7-8D9E-75A8B9FF3479}.Release|Any CPU.ActiveCfg = Release|Any CPU
395-
{F1541C2D-80A9-4FE7-8D9E-75A8B9FF3479}.Release|Any CPU.Build.0 = Release|Any CPU
396-
{F1541C2D-80A9-4FE7-8D9E-75A8B9FF3479}.Release|NET_Linux.ActiveCfg = Release|NET_Linux
397-
{F1541C2D-80A9-4FE7-8D9E-75A8B9FF3479}.Release|NET_Linux.Build.0 = Release|NET_Linux
398-
{F1541C2D-80A9-4FE7-8D9E-75A8B9FF3479}.Release|Publish_Linux.ActiveCfg = Release|Publish_Linux
399-
{F1541C2D-80A9-4FE7-8D9E-75A8B9FF3479}.Release|Publish_Linux.Build.0 = Release|Publish_Linux
400386
{A50C198C-DA6E-4081-BC53-0F44D287F207}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
401387
{A50C198C-DA6E-4081-BC53-0F44D287F207}.Debug|Any CPU.Build.0 = Debug|Any CPU
402388
{A50C198C-DA6E-4081-BC53-0F44D287F207}.Debug|NET_Linux.ActiveCfg = Debug|NET_Linux
@@ -623,7 +609,6 @@ Global
623609
{47533B7C-0E1A-44A4-8511-B438645F052A} = {88D45B00-E564-41DB-B57C-9509646CAA49}
624610
{C0D6DEE5-5532-4345-9C66-4C00D7FDB8BE} = {FA7BE306-A3B0-45FA-9D87-0C69E6932C13}
625611
{76686ED6-E759-4772-81C2-768740BE13FA} = {FA7BE306-A3B0-45FA-9D87-0C69E6932C13}
626-
{F1541C2D-80A9-4FE7-8D9E-75A8B9FF3479} = {FA7BE306-A3B0-45FA-9D87-0C69E6932C13}
627612
{A50C198C-DA6E-4081-BC53-0F44D287F207} = {FA7BE306-A3B0-45FA-9D87-0C69E6932C13}
628613
{E674F1A1-BE83-475A-9CC9-F55CADBEC448} = {FA7BE306-A3B0-45FA-9D87-0C69E6932C13}
629614
{8872CA17-C10D-43B9-8393-5C5A57065EB0} = {FA7BE306-A3B0-45FA-9D87-0C69E6932C13}

src/DynamoCore/Configuration/PreferenceSettings.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -707,6 +707,17 @@ public string PythonTemplateFilePath
707707
/// </summary>
708708
public bool ShowTabsAndSpacesInScriptEditor { get; set; }
709709

710+
/// <summary>
711+
/// Controls whether Dynamo shows upgrade notifications for legacy CPython nodes
712+
/// when opening a graph. These notices appear when a graph contains CPython-engine
713+
/// Python nodes that are automatically upgraded to PythonNet3:
714+
/// • toast on graph open
715+
/// • save/close confirmation dialog
716+
/// • banner inside the Python Script Editor
717+
/// NOTE: This setting is not related to the historical IronPython2 → CPython3 migration.
718+
/// </summary>
719+
public bool HideCPython3Notifications { get; set; } = false;
720+
710721
/// <summary>
711722
/// This defines if user wants to see the enabled node Auto Complete feature for port interaction.
712723
/// </summary>

src/DynamoCore/DynamoCore.csproj

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@
4040
<PackageReference Include="Lucene.Net" Version="4.8.0-beta00016" />
4141
<PackageReference Include="Lucene.Net.Analysis.Common" Version="4.8.0-beta00016" />
4242
<PackageReference Include="Lucene.Net.QueryParser" Version="4.8.0-beta00016" />
43-
<PackageReference Include="DynamoVisualProgramming.Analytics" Version="4.2.2.10064" />
43+
<PackageReference Include="DynamoVisualProgramming.Analytics" Version="4.2.1.9358" />
44+
<PackageReference Include="DynamoVisualProgramming.PythonEngine.PythonNet3" Version="1.4.2" GeneratePathProperty="true" ExcludeAssets="all" />
4445
</ItemGroup>
4546
<ItemGroup>
4647
<ProjectReference Include="..\Engine\GraphLayout\GraphLayout.csproj">
@@ -224,6 +225,28 @@
224225
<Copy SourceFiles="$(ProjectDir)\BuiltInAndOperators\BuiltIn.xml" DestinationFolder="$(OutputPath)\$(UICulture)" />
225226
<Copy SourceFiles="$(ProjectDir)\BuiltInAndOperators\BuiltIn.Migrations.xml" DestinationFolder="$(OutputPath)" />
226227
<Copy SourceFiles="$(SolutionDir)Config\upiconfig.xml" DestinationFolder="$(OutputPath)" />
228+
</Target>
229+
<Target Name="BuildPythonNet3EngineDynamoPackage" AfterTargets="Build">
230+
<PropertyGroup>
231+
<DestRoot>$(OutputPath)Built-In Packages\packages\PythonNet3Engine\</DestRoot>
232+
<DestBin>$(DestRoot)bin\</DestBin>
233+
<DestExtra>$(DestRoot)extra\</DestExtra>
234+
<PkgRoot>$(PkgDynamoVisualProgramming_PythonEngine_PythonNet3)</PkgRoot>
235+
<LibDir>$(PkgRoot)\lib\</LibDir>
236+
<PkgJson>$(PkgRoot)\content\manifest\pkg.json</PkgJson>
237+
</PropertyGroup>
238+
<MakeDir Directories="$(DestBin)" />
239+
<MakeDir Directories="$(DestExtra)" />
240+
<Copy SourceFiles="$(PkgJson)" DestinationFiles="$(DestRoot)pkg.json" SkipUnchangedFiles="True" />
241+
<ItemGroup>
242+
<DllEmpty Include="$(LibDir)**\DSPythonNet3Empty.dll" />
243+
</ItemGroup>
244+
<Copy SourceFiles="@(DllEmpty)" DestinationFolder="$(DestBin)" SkipUnchangedFiles="True" />
245+
<ItemGroup>
246+
<DllExtra Include="$(LibDir)**\*.dll" Exclude="@(DllEmpty)" />
247+
<DllExtra Include="$(LibDir)**\DSPythonNet3Extension_ExtensionDefinition.xml" />
248+
</ItemGroup>
249+
<Copy SourceFiles="@(DllExtra)" DestinationFolder="$(DestExtra)" SkipUnchangedFiles="True" />
227250
</Target>
228251
<Target Name="AfterBuildOps" AfterTargets="ResolveSateliteResDeps">
229252
<ItemGroup>

src/DynamoCore/Graph/Workspaces/WorkspaceModel.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,11 @@ internal int CurrentPasteOffset
304304
private Dictionary<Guid, DependencyInfo> externalFilesDictionary = new Dictionary<Guid, DependencyInfo>();
305305
private readonly string customNodeExtension = ".dyf";
306306

307+
/// <summary>
308+
/// Flag to indicate whether the CPython notification has been shown once.
309+
/// </summary>
310+
internal bool HasShownCPythonNotification;
311+
307312
/// <summary>
308313
/// Whether or not to delay graph execution.
309314
/// 64-bit read operations are already atomic so no need to lock here
@@ -1384,6 +1389,14 @@ internal set
13841389
WorkspaceEvents.OnWorkspaceSettingsChanged(scaleFactor);
13851390
}
13861391
}
1392+
1393+
/// <summary>
1394+
/// Flag indicating whether the “Python Engine Change” notice should be shown
1395+
/// on save/close. Runtime-only (not serialized) and reset on workspace switch.
1396+
/// </summary>
1397+
[JsonIgnore]
1398+
public bool ShowCPythonNotifications { get; internal set; }
1399+
13871400
#endregion
13881401

13891402
#region constructors

src/DynamoCoreWpf/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
[assembly: InternalsVisibleTo("DynamoPlayer")]
6161
[assembly: InternalsVisibleTo("DynamoConnector")]
6262
[assembly: InternalsVisibleTo("NodeAutoCompleteViewExtension")]
63+
[assembly: InternalsVisibleTo("PythonMigrationViewExtension")]
6364

6465
// Disable PublicAPIAnalyzer errors for this type as they're already added to the public API text file
6566
#pragma warning disable RS0016

0 commit comments

Comments
 (0)