Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
0abfde0
Full featured xplat build.
Jul 28, 2017
8b0b399
.Net 45 TargetingPack System.XML.dll naming fix. (For xplat linux bui…
Aug 18, 2017
3f02c12
Setup.py --xplat option refactored. Travis-ci build matrix extended.
Aug 18, 2017
78d5d46
AppVeyor matrix extended, xplat build added.
Aug 19, 2017
2dc1b47
appveyor.yml yaml syntax fix.
Aug 20, 2017
665b9d7
NUnit dependency upgraded to 3.7. Changelog improved.
Aug 20, 2017
504495e
EmbeddingTest fixes, and stubs.
Aug 22, 2017
1cc9008
Fix for importing numpy and other python modules with native parts.
Aug 22, 2017
2ac981b
Build order improvement.
Aug 22, 2017
2edbc87
NetCoreApp 2.0 fix. EmitCalli does not supports cdecl. Falling-back t…
Aug 27, 2017
dac5a96
Changelog improved.
Aug 22, 2017
0852392
All finalizers are disabled until valid implementation. Helps to avoi…
Sep 4, 2017
d16100c
NetCoreApp 2.0 target added, compile issues fixed, CI system improved.
Jul 29, 2017
ed48618
Mono builds now can be build on Windows.
Sep 6, 2017
3069fe4
Python.Runtime.dll now targets NetStandard2.0 inplace of NetCoreApp 2.0
Sep 6, 2017
0ca9612
Merge
Sep 6, 2017
afaca1b
Wrong NETSTANDARD/NETCOREAPP define constant change.
Sep 6, 2017
b20d134
Typo fix.
Sep 6, 2017
966f035
PYTHONNET_PY3_VERSION, PYTHONNET_PY2_VERSION build related environmen…
Sep 7, 2017
f4a6608
Small compile fixes.
Sep 7, 2017
a89685e
PYTHONNET_WIN_DEFINE_CONSTANTS and PYTHONNET_MONO_DEFINE_CONSTANTS in…
Sep 7, 2017
153de5e
.travis.yaml file simplification.
Sep 21, 2017
447da7d
PYTHONNET_INTEROP_FILE env var introduced to allow working with custo…
Sep 21, 2017
7293223
pdb generation improved for all conditions Net 4.0/NetStandard 2.0 x …
Sep 22, 2017
0df38c2
Fix for the #539 classic build fails when VS 2017 installed.
Sep 22, 2017
52a675f
Build fixes for the fresh Windows 10 SDKS.
Nov 4, 2017
64cb7f8
Workaround: Mono downgrade to 5.2.0 to avoid broken mono 5.4.0.201
Nov 7, 2017
2ba6bff
Merge #518
Nov 16, 2017
4aa8b18
Merge #519
Nov 16, 2017
c4910f0
vswhere.exe tool now distributed with the pythonnet sources, dotnet-c…
Sep 21, 2017
700b522
backout #546, wrong merge!
Nov 16, 2017
43a9eb6
Backed #519, wrong merge!
Nov 16, 2017
1c79426
backout #518, wrong merge !
Nov 16, 2017
194e5e6
Backing out wrong merges.
Nov 16, 2017
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
Backed #519, wrong merge!
  • Loading branch information
dse committed Nov 16, 2017
commit 43a9eb65e7c2487cb1b77791e57c670014669d45
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ install:
script:
- python -m pytest
- mono $NUNIT_PATH src/embed_tests/bin/Python.EmbeddingTest.dll
- if [[ $BUILD_OPTS == --xplat ]]; then dotnet src/embed_tests/bin/netcoreapp2.0_publish/Python.EmbeddingTest.dll; fi

after_script:
# Uncomment if need to geninterop, ie. py37 final
Expand Down
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ This document follows the conventions laid out in [Keep a CHANGELOG][].
## [unreleased][]

### Added
- Added support for embedding python into dotnet core 2.0 (NetStandard 2.0)
- Added new build system (pythonnet.15.sln) based on dotnetcore-sdk/xplat(crossplatform msbuild).
Currently there two side-by-side build systems that produces the same output (net40) from the same sources.
After a some transition time, current (mono/ msbuild 14.0) build system will be removed.
Expand Down
2 changes: 0 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ init:
install:
- pip install --upgrade -r requirements.txt --quiet
- choco install vswhere -y
- cmd: curl -O https://download.microsoft.com/download/5/6/B/56BFEF92-9045-4414-970C-AB31E0FC07EC/dotnet-runtime-2.0.0-win-x86.exe
- cmd: dotnet-runtime-2.0.0-win-x86.exe /install /quiet /norestart /log install.log

# Install OpenCover. Can't put on `packages.config`, not Mono compatible
- .\tools\nuget\nuget.exe install OpenCover -OutputDirectory packages -Verbosity quiet
Expand Down
17 changes: 0 additions & 17 deletions ci/appveyor_run_tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -44,23 +44,6 @@ if ($CS_STATUS -ne 0) {
Write-Host "Embedded tests failed" -ForegroundColor "Red"
}

if ($env:BUILD_OPTS -eq "--xplat"){
if ($env:PLATFORM -eq "x64") {
$DOTNET_CMD = "dotnet"
}
else{
$DOTNET_CMD = "c:\Program Files (x86)\dotnet\dotnet"
}

# Run Embedded tests for netcoreapp2.0 (OpenCover currently does not supports dotnet core)
Write-Host ("Starting embedded tests for netcoreapp2.0") -ForegroundColor "Green"
&$DOTNET_CMD .\src\embed_tests\bin\netcoreapp2.0_publish\Python.EmbeddingTest.dll
$CS_STATUS = $LastExitCode
if ($CS_STATUS -ne 0) {
Write-Host "Embedded tests for netcoreapp2.0 failed" -ForegroundColor "Red"
}
}

# Set exit code to fail if either Python or Embedded tests failed
if ($PYTHON_STATUS -ne 0 -or $CS_STATUS -ne 0) {
Write-Host "Tests failed" -ForegroundColor "Red"
Expand Down
10 changes: 5 additions & 5 deletions pythonnet.15.sln
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26730.3
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Python.Runtime.15", "src/runtime/Python.Runtime.15.csproj", "{2759F4FF-716B-4828-916F-50FA86613DFC}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Python.Runtime.15", "src\runtime\Python.Runtime.15.csproj", "{2759F4FF-716B-4828-916F-50FA86613DFC}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Python.EmbeddingTest.15", "src/embed_tests/Python.EmbeddingTest.15.csproj", "{66B8D01A-9906-452A-B09E-BF75EA76468F}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Python.EmbeddingTest.15", "src\embed_tests\Python.EmbeddingTest.15.csproj", "{66B8D01A-9906-452A-B09E-BF75EA76468F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "clrmodule.15", "src/clrmodule/clrmodule.15.csproj", "{E08678D4-9A52-4AD5-B63D-8EBC7399981B}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "clrmodule.15", "src\clrmodule\clrmodule.15.csproj", "{E08678D4-9A52-4AD5-B63D-8EBC7399981B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Console.15", "src/console/Console.15.csproj", "{CDAD305F-8E72-492C-A314-64CF58D472A0}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Console.15", "src\console\Console.15.csproj", "{CDAD305F-8E72-492C-A314-64CF58D472A0}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Python.Test.15", "src/testing/Python.Test.15.csproj", "{F94B547A-E97E-4500-8D53-B4D64D076E5F}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Python.Test.15", "src\testing\Python.Test.15.csproj", "{F94B547A-E97E-4500-8D53-B4D64D076E5F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
2 changes: 0 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,6 @@ def build_extension(self, ext):

subprocess.check_call(" ".join(cmd + ["/t:Clean"]), shell=use_shell)
subprocess.check_call(" ".join(cmd + ["/t:Build"]), shell=use_shell)
if DEVTOOLS == "MsDev15" or DEVTOOLS == "dotnet":
subprocess.check_call(" ".join(cmd + ['"/t:Console_15:publish;Python_EmbeddingTest_15:publish"', "/p:TargetFramework=netcoreapp2.0"]), shell=use_shell)

if DEVTOOLS == "Mono" or DEVTOOLS == "dotnet":
self._build_monoclr()
Expand Down
1 change: 0 additions & 1 deletion src/clrmodule/clrmodule.15.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
<NoWarn>1591</NoWarn>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<PythonBuildDir Condition=" '$(PythonBuildDir)' == '' ">$(SolutionDir)\bin\</PythonBuildDir>
<PythonBuildDir Condition="'$(TargetFramework)'!='net40'">$(PythonBuildDir)\$(TargetFramework)\</PythonBuildDir>
<LangVersion>6</LangVersion>
<ErrorReport>prompt</ErrorReport>
<CustomDefineConstants Condition="'$(CustomDefineConstants)' == ''">$(PYTHONNET_DEFINE_CONSTANTS)</CustomDefineConstants>
Expand Down
12 changes: 5 additions & 7 deletions src/console/Console.15.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
<PropertyGroup>
<TargetFrameworks>net40;netcoreapp2.0</TargetFrameworks>
<TargetFrameworks>net40</TargetFrameworks>
<Platforms>x64;x86</Platforms>
<Configurations>DebugMono;DebugMonoPY3;ReleaseMono;ReleaseMonoPY3;DebugWin;DebugWinPY3;ReleaseWin;ReleaseWinPY3</Configurations>
<OutputType>Exe</OutputType>
Expand All @@ -15,14 +15,12 @@
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
<GenerateAssemblyDescriptionAttribute>false</GenerateAssemblyDescriptionAttribute>
<DocumentationFile>bin\nPython.xml</DocumentationFile>
<OutputPath>bin\</OutputPath>
<AppendTargetFrameworkToOutputPath Condition="'$(TargetFramework)'=='net40'">false</AppendTargetFrameworkToOutputPath>
<DocumentationFile Condition="'$(TargetFramework)'=='net40'">$(OutputPath)\$(AssemblyName).xml</DocumentationFile>
<DocumentationFile Condition="'$(TargetFramework)'!='net40'">$(OutputPath)\$(TargetFramework)\$(AssemblyName).xml</DocumentationFile>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<NoWarn>1591</NoWarn>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<PythonBuildDir Condition=" '$(PythonBuildDir)' == '' ">$(SolutionDir)\bin\</PythonBuildDir>
<PublishDir Condition="'$(TargetFramework)'!='net40'">$(PythonBuildDir)\$(TargetFramework)\</PublishDir>
<LangVersion>6</LangVersion>
<ApplicationIcon>python-clear.ico</ApplicationIcon>
<ErrorReport>prompt</ErrorReport>
Expand Down Expand Up @@ -91,7 +89,7 @@
</ItemGroup>
<ItemGroup>
<Content Include="python-clear.ico" />
<EmbeddedResource Condition="'$(TargetFramework)'=='net40'" Include="$(PythonBuildDir)\Python.Runtime.dll">
<EmbeddedResource Include="$(PythonBuildDir)\Python.Runtime.dll">
<LogicalName>Python.Runtime.dll</LogicalName>
</EmbeddedResource>
</ItemGroup>
Expand All @@ -102,6 +100,6 @@
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />

<Target Name="AfterBuild">
<Copy Condition="'$(TargetFramework)'=='net40'" SourceFiles="$(TargetPath)" DestinationFolder="$(PythonBuildDir)" />
<Copy SourceFiles="$(TargetPath)" DestinationFolder="$(PythonBuildDir)" />
</Target>
</Project>
9 changes: 2 additions & 7 deletions src/console/pythonconsole.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,18 @@ namespace Python.Runtime
/// </remarks>
public sealed class PythonConsole
{
#if NET40
private static AssemblyLoader assemblyLoader = new AssemblyLoader();
#endif

private PythonConsole()
{
}

[STAThread]
public static int Main(string[] args)
{
// Only net40 is capable to safely inject python.runtime.dll into resources.
#if NET40
// reference the static assemblyLoader to stop it being optimized away
AssemblyLoader a = assemblyLoader;
#endif

string[] cmd = Environment.GetCommandLineArgs();
PythonEngine.Initialize();

Expand All @@ -40,7 +37,6 @@ public static int Main(string[] args)
return i;
}

#if NET40
// Register a callback function to load embedded assemblies.
// (Python.Runtime.dll is included as a resource)
private sealed class AssemblyLoader
Expand Down Expand Up @@ -77,6 +73,5 @@ public AssemblyLoader()
};
}
}
#endif
}
}
19 changes: 0 additions & 19 deletions src/embed_tests/Program.cs

This file was deleted.

21 changes: 6 additions & 15 deletions src/embed_tests/Python.EmbeddingTest.15.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />

<PropertyGroup>
<TargetFrameworks>net40;netcoreapp2.0</TargetFrameworks>
<TargetFrameworks>net40</TargetFrameworks>
<Platforms>x64;x86</Platforms>
<Configurations>DebugMono;DebugMonoPY3;ReleaseMono;ReleaseMonoPY3;DebugWin;DebugWinPY3;ReleaseWin;ReleaseWinPY3</Configurations>
<OutputType Condition="'$(TargetFramework)' != 'net40' OR '$(PYTHONNET_VS_ENV)' == 'true'">Exe</OutputType>
<GenerateProgramFile>false</GenerateProgramFile>
<AssetTargetFallback Condition="'$(TargetFramework)'=='net40' AND $(Configuration.Contains('Mono'))">net45</AssetTargetFallback>
<AssemblyName>Python.EmbeddingTest</AssemblyName>
<RootNamespace>Python.EmbeddingTest</RootNamespace>
<PackageId>Python.EmbeddingTest</PackageId>
Expand All @@ -16,19 +15,16 @@
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<OutputPath>bin\</OutputPath>
<AppendTargetFrameworkToOutputPath Condition="'$(TargetFramework)'=='net40'">false</AppendTargetFrameworkToOutputPath>
<DocumentationFile Condition="'$(TargetFramework)'=='net40'">$(OutputPath)\$(AssemblyName).xml</DocumentationFile>
<DocumentationFile Condition="'$(TargetFramework)'!='net40'">$(OutputPath)\$(TargetFramework)\$(AssemblyName).xml</DocumentationFile>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<DocumentationFile>$(OutputPath)\$(AssemblyName).xml</DocumentationFile>
<NoWarn>1591</NoWarn>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<PythonBuildDir Condition="'$(TargetFramework)'=='net40' AND '$(PythonBuildDir)' == ''">$(SolutionDir)\bin\</PythonBuildDir>
<PublishDir Condition="'$(TargetFramework)'!='net40'">$(OutputPath)\$(TargetFramework)_publish</PublishDir>
<PythonBuildDir Condition=" '$(PythonBuildDir)' == '' ">$(SolutionDir)\bin\</PythonBuildDir>
<LangVersion>6</LangVersion>
<ErrorReport>prompt</ErrorReport>
<CustomDefineConstants Condition="'$(CustomDefineConstants)' == ''">$(PYTHONNET_DEFINE_CONSTANTS)</CustomDefineConstants>
<BaseDefineConstants>XPLAT</BaseDefineConstants>
<DefineConstants>$(DefineConstants);$(CustomDefineConstants);$(BaseDefineConstants);</DefineConstants>
<DefineConstants Condition="'$(TargetFramework)'=='netcoreapp2.0'">$(DefineConstants);NETCOREAPP</DefineConstants>
<DefineConstants Condition="'$(BuildingInsideVisualStudio)' == 'true' AND '$(CustomDefineConstants)' != '' AND $(Configuration.Contains('Debug'))">$(DefineConstants);TRACE;DEBUG</DefineConstants>
<FrameworkPathOverride Condition="'$(TargetFramework)'=='net40' AND $(Configuration.Contains('Mono'))">$(NuGetPackageRoot)\microsoft.targetingpack.netframework.v4.5\1.0.1\lib\net45\</FrameworkPathOverride>
</PropertyGroup>
Expand Down Expand Up @@ -92,11 +88,6 @@
<ItemGroup>
<PackageReference Include="NUnit" Version="3.7.1" />
<PackageReference Include="NUnit.ConsoleRunner" Version="3.7.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.8.0" />
<PackageReference Include="NUnitLite" Version="3.7.2" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp2.0'">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
</ItemGroup>

<ItemGroup>
Expand All @@ -123,7 +114,7 @@
</PropertyGroup>

<Target Name="AfterBuild">
<Copy Condition="'$(TargetFramework)'=='net40'" SourceFiles="$(TargetAssembly)" DestinationFolder="$(PythonBuildDir)" />
<Copy SourceFiles="$(TargetAssembly)" DestinationFolder="$(PythonBuildDir)" />
<!--Copy SourceFiles="$(TargetAssemblyPdb)" Condition="Exists('$(TargetAssemblyPdb)')" DestinationFolder="$(PythonBuildDir)" /-->
</Target>

Expand Down
6 changes: 2 additions & 4 deletions src/embed_tests/TestPySequence.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,8 @@ public void TestRepeat()
PyObject actual = t1.Repeat(3);
Assert.AreEqual("FooFooFoo", actual.ToString());

// On 32 bit system this argument should be int, but on the 64 bit system this should be long value.
// This works on the Framework 4.0 accidentally, it should produce out of memory!
// actual = t1.Repeat(-3);
// Assert.AreEqual("", actual.ToString());
actual = t1.Repeat(-3);
Assert.AreEqual("", actual.ToString());
}

[Test]
Expand Down
4 changes: 0 additions & 4 deletions src/embed_tests/pyimport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,7 @@ public void SetUp()
/* Append the tests directory to sys.path
* using reflection to circumvent the private
* modifiers placed on most Runtime methods. */
#if NETCOREAPP
const string s = "../../fixtures";
#else
const string s = "../fixtures";
#endif
string testPath = Path.Combine(TestContext.CurrentContext.TestDirectory, s);

IntPtr str = Runtime.Runtime.PyString_FromString(testPath);
Expand Down
Loading