Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0e0f71f

Browse files
authored
Merge branch 'master' into master
2 parents b4b36fc + d3ca2e8 commit 0e0f71f

44 files changed

Lines changed: 684 additions & 140 deletions

Some content is hidden

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

AUTHORS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
- Sam Winstanley ([@swinstanley](https://github.com/swinstanley))
4343
- Sean Freitag ([@cowboygneox](https://github.com/cowboygneox))
4444
- Serge Weinstock ([@sweinst](https://github.com/sweinst))
45+
- Simon Mourier ([@smourier](https://github.com/smourier))
4546
- Viktoria Kovescses ([@vkovec](https://github.com/vkovec))
4647
- Ville M. Vainio ([@vivainio](https://github.com/vivainio))
4748
- Virgil Dupras ([@hsoft](https://github.com/hsoft))

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@ This document follows the conventions laid out in [Keep a CHANGELOG][].
88
## [unreleased][]
99

1010
### Added
11+
1112
- Added support for embedding python into dotnet core 2.0 (NetStandard 2.0)
1213
- Added new build system (pythonnet.15.sln) based on dotnetcore-sdk/xplat(crossplatform msbuild).
1314
Currently there two side-by-side build systems that produces the same output (net40) from the same sources.
1415
After a some transition time, current (mono/ msbuild 14.0) build system will be removed.
1516
- NUnit upgraded to 3.7 (eliminates travis-ci random bug)
17+
- Added C# `PythonEngine.AddShutdownHandler` to help client code clean up on shutdown.
1618
- Added `clr.GetClrType` ([#432][i432])([#433][p433])
1719
- Allowed passing `None` for nullable args ([#460][p460])
1820
- Added keyword arguments based on C# syntax for calling CPython methods ([#461][p461])
@@ -24,11 +26,17 @@ This document follows the conventions laid out in [Keep a CHANGELOG][].
2426

2527
### Changed
2628

29+
- Reattach python exception traceback information (#545)
30+
- PythonEngine.Intialize will now call `Py_InitializeEx` with a default value of 0, so signals will not be configured by default on embedding. This is different from the previous behaviour, where `Py_Initialize` was called instead, which sets initSigs to 1. ([#449][i449])
31+
2732
### Fixed
2833

34+
- Fixed secondary PythonEngine.Initialize call, all sensitive static variables now reseted.
35+
This is a hidden bug. Once python cleaning up enough memory, objects from previous engine run becomes corrupted. ([#534][p534])
2936
- Fixed Visual Studio 2017 compat ([#434][i434]) for setup.py
3037
- Fixed crashes when integrating pythonnet in Unity3d ([#714][i714]),
3138
related to unloading the Application Domain
39+
- Fixed interop methods with Py_ssize_t. NetCoreApp 2.0 is more sensitive than net40 and requires this fix. ([#531][p531])
3240
- Fixed crash on exit of the Python interpreter if a python class
3341
derived from a .NET class has a `__namespace__` or `__assembly__`
3442
attribute ([#481][i481])
@@ -40,6 +48,8 @@ This document follows the conventions laid out in [Keep a CHANGELOG][].
4048
- Fixed errors breaking .NET Remoting on method invoke ([#276][i276])
4149
- Fixed PyObject.GetHashCode ([#676][i676])
4250
- Fix memory leaks due to spurious handle incrementation ([#691][i691])
51+
- Fix spurious assembly loading exceptions from private types ([#703][i703])
52+
- Fix inheritance of non-abstract base methods ([#755][i755])
4353

4454

4555
## [2.3.0][] - 2017-03-11
@@ -597,6 +607,7 @@ This document follows the conventions laid out in [Keep a CHANGELOG][].
597607

598608
[1.0.0]: https://github.com/pythonnet/pythonnet/releases/tag/1.0
599609

610+
[i714]: https://github.com/pythonnet/pythonnet/issues/714
600611
[i608]: https://github.com/pythonnet/pythonnet/issues/608
601612
[i443]: https://github.com/pythonnet/pythonnet/issues/443
602613
[p690]: https://github.com/pythonnet/pythonnet/pull/690
@@ -689,3 +700,7 @@ This document follows the conventions laid out in [Keep a CHANGELOG][].
689700
[p163]: https://github.com/pythonnet/pythonnet/pull/163
690701
[p625]: https://github.com/pythonnet/pythonnet/pull/625
691702
[i131]: https://github.com/pythonnet/pythonnet/issues/131
703+
[p531]: https://github.com/pythonnet/pythonnet/pull/531
704+
[i755]: https://github.com/pythonnet/pythonnet/pull/755
705+
[p534]: https://github.com/pythonnet/pythonnet/pull/534
706+
[i449]: https://github.com/pythonnet/pythonnet/issues/449

NuGet.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?xml version="1.0" encoding="utf-8"?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<configuration>
33
<packageSources>
44
<add key="dot-net MyGet Feed" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" protocolVersion="3"/>

setup.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -344,9 +344,16 @@ def _install_packages(self):
344344
self.debug_print("Updating NuGet: {0}".format(cmd))
345345
subprocess.check_call(cmd, shell=use_shell)
346346

347-
cmd = "{0} restore pythonnet.sln -MSBuildVersion 14 -o packages".format(nuget)
348-
self.debug_print("Installing packages: {0}".format(cmd))
349-
subprocess.check_call(cmd, shell=use_shell)
347+
try:
348+
# msbuild=14 is mainly for Mono issues
349+
cmd = "{0} restore pythonnet.sln -MSBuildVersion 14 -o packages".format(nuget)
350+
self.debug_print("Installing packages: {0}".format(cmd))
351+
subprocess.check_call(cmd, shell=use_shell)
352+
except:
353+
# when only VS 2017 is installed do not specify msbuild version
354+
cmd = "{0} restore pythonnet.sln -o packages".format(nuget)
355+
self.debug_print("Installing packages: {0}".format(cmd))
356+
subprocess.check_call(cmd, shell=use_shell)
350357

351358
def _find_msbuild_tool(self, tool="msbuild.exe", use_windows_sdk=False):
352359
"""Return full path to one of the Microsoft build tools"""
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
using NUnit.Framework;
2+
using Python.Runtime;
3+
4+
namespace Python.EmbeddingTest
5+
{
6+
7+
// As the SetUpFixture, the OneTimeTearDown of this class is executed after
8+
// all tests have run.
9+
[SetUpFixture]
10+
public class GlobalTestsSetup
11+
{
12+
[OneTimeTearDown]
13+
public void FinalCleanup()
14+
{
15+
if (PythonEngine.IsInitialized)
16+
{
17+
PythonEngine.Shutdown();
18+
}
19+
}
20+
}
21+
}

src/embed_tests/Python.EmbeddingTest.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?xml version="1.0" encoding="utf-8"?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
33
<PropertyGroup>
44
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -105,6 +105,7 @@
105105
<Compile Include="TestRuntime.cs" />
106106
<Compile Include="TestPyScope.cs" />
107107
<Compile Include="TestTypeManager.cs" />
108+
<Compile Include="GlobalTestsSetup.cs" />
108109
</ItemGroup>
109110
<ItemGroup>
110111
<ProjectReference Include="..\runtime\Python.Runtime.csproj">

src/embed_tests/TestConverter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using NUnit.Framework;
1+
using NUnit.Framework;
22
using Python.Runtime;
33

44
namespace Python.EmbeddingTest

src/embed_tests/TestNamedArguments.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using NUnit.Framework;
33
using Python.Runtime;
44

src/embed_tests/TestPyObject.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Collections.Generic;
33
using System.Linq;
44
using NUnit.Framework;

src/embed_tests/TestPySequence.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,8 @@ public void TestRepeat()
6969
PyObject actual = t1.Repeat(3);
7070
Assert.AreEqual("FooFooFoo", actual.ToString());
7171

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

7876
[Test]

0 commit comments

Comments
 (0)