Skip to content

Commit 1f3f895

Browse files
update pythonnet (#16)
1 parent 3be4e26 commit 1f3f895

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

DSPythonNet3/DSPythonNet3.csproj

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<PackageReference Include="DynamoVisualProgramming.Core" Version="$(DynamoPackageVersion)" ExcludeAssets="runtime" />
1515
<PackageReference Include="DynamoVisualProgramming.DynamoServices" Version="$(DynamoPackageVersion)" ExcludeAssets="runtime" />
1616
<PackageReference Include="Python.Included" Version="3.11.6" />
17-
<PackageReference Include="Autodesk.pythonnet" Version="3.1.0-preview*" />
17+
<PackageReference Include="Autodesk.pythonnet" Version="3.1.1-preview*" />
1818
</ItemGroup>
1919
<ItemGroup>
2020
<Compile Update="Properties\Resources.Designer.cs">
@@ -41,6 +41,18 @@
4141
<ItemGroup>
4242
<ProjectReference Include="..\DSPythonNet3Wheels\DSPythonNet3Wheels.csproj" />
4343
</ItemGroup>
44+
<!-- Prevent transitive pythonnet from dropping its Python.Runtime.dll while keeping compile assets -->
45+
<ItemGroup>
46+
<PackageReference Update="pythonnet" ExcludeAssets="all" />
47+
</ItemGroup>
48+
49+
<!-- As a safeguard, remove any Python.Runtime coming from NuGet packages from being copied to output -->
50+
<Target Name="RemoveTransitivePythonNetRuntime" AfterTargets="ResolveReferences">
51+
<ItemGroup>
52+
<ReferenceCopyLocalPaths Remove="@(ReferenceCopyLocalPaths)" Condition="'%(ReferenceCopyLocalPaths.FileName)' == 'Python.Runtime' and $([System.String]::Copy('%(ReferenceCopyLocalPaths.Identity)').ToLower().Contains('nuget\\packages\\pythonnet'))" />
53+
</ItemGroup>
54+
</Target>
55+
4456
<ItemGroup>
4557
<None Update="pkg.json">
4658
<TargetPath>..\%(Filename)%(Extension)</TargetPath>

0 commit comments

Comments
 (0)