Skip to content

Added side-by-side VS 2017 build with NetStandard 1.5 support. #444

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 19 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
DotNetCore + Windows x64 + Python 3.5 = all tests passed.
  • Loading branch information
dse committed Mar 29, 2017
commit 36c2e85a9eeaba6e187bac6898ea66819ce4ea19
21 changes: 21 additions & 0 deletions src/embed_tests/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using System;
using System.Reflection;
using NUnit.Common;
using NUnitLite;

namespace Python.EmbeddingTest
{
public class Program
{
public static int Main(string[] args)
{
////var example = new TestExample();
////example.SetUp();
////example.TestReadme();
////example.Dispose();
////return 0;
return new AutoRun(typeof(Program).GetTypeInfo().Assembly)
.Execute(args, new ExtendedTextWrapper(Console.Out), Console.In);
}
}
}
7 changes: 7 additions & 0 deletions src/embed_tests/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"profiles": {
"Python.EmbeddingTest.15": {
"commandName": "Project"
}
}
}
11 changes: 7 additions & 4 deletions src/embed_tests/Python.EmbeddingTest.15.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net40;netstandard1.6</TargetFrameworks>
<!--<PackageTargetFallback>net</PackageTarg0etFallback>-->
<OutputType>exe</OutputType>
<TargetFrameworks><!--net40;-->netcoreapp1.0</TargetFrameworks>
<RuntimeIdentifiers>win7-x64;ubuntu.16.04-x64</RuntimeIdentifiers>
<RootNamespace>Python.EmbeddingTest</RootNamespace>
<AssemblyName>Python.EmbeddingTest</AssemblyName>
<PackageId>Python.EmbeddingTest</PackageId>
Expand All @@ -12,6 +13,7 @@
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<!--<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>-->
<NetStandardImplicitPackageVersion>1.6.0</NetStandardImplicitPackageVersion>
<!--This is for NUnit Test Adaptor crash workaround.-->
<DebugType>Full</DebugType>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'x86'">
Expand All @@ -25,9 +27,9 @@

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net40|x64'" />

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|netstandard1.6|x64'" />
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|netcoreapp1.0|x64'" />

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|netstandard1.6|x64'" />
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|netcoreapp1.0|x64'" />

<PropertyGroup>
<DefineConstants>$(DefineConstants);XPLAT</DefineConstants>
Expand All @@ -37,6 +39,7 @@
<PackageReference Include="NUnit">
<Version>3.6.1</Version>
</PackageReference>
<PackageReference Include="NUnitLite" Version="3.6.1" />
</ItemGroup>

<ItemGroup>
Expand Down
5 changes: 4 additions & 1 deletion src/runtime/importhook.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Runtime.InteropServices;

namespace Python.Runtime
Expand Down Expand Up @@ -75,7 +75,10 @@ internal static void Shutdown()
if (Runtime.Py_IsInitialized() != 0)
{
Runtime.XDecref(py_clr_module);
// TODO: Very strange behavior under CoreCLR. System.ExecutionEngineException (Crash)
#if !NETSTANDARD1_5
Runtime.XDecref(root.pyHandle);
#endif
Runtime.XDecref(py_import);
}
}
Expand Down