Skip to content
This repository was archived by the owner on Jul 22, 2023. It is now read-only.

Commit 916e85e

Browse files
committed
Merge remote-tracking branch 'remotes/upstream/master' into pyobject-finalizer
2 parents 5254c65 + d3ca2e8 commit 916e85e

35 files changed

+432
-64
lines changed

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: 13 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])
@@ -26,8 +28,13 @@ This document follows the conventions laid out in [Keep a CHANGELOG][].
2628
### Changed
2729
- PythonException included C# call stack
2830

31+
- Reattach python exception traceback information (#545)
32+
- 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])
33+
2934
### Fixed
3035

36+
- Fixed secondary PythonEngine.Initialize call, all sensitive static variables now reseted.
37+
This is a hidden bug. Once python cleaning up enough memory, objects from previous engine run becomes corrupted. ([#534][p534])
3138
- Fixed Visual Studio 2017 compat ([#434][i434]) for setup.py
3239
- Fixed crashes when integrating pythonnet in Unity3d ([#714][i714]),
3340
related to unloading the Application Domain
@@ -43,6 +50,8 @@ This document follows the conventions laid out in [Keep a CHANGELOG][].
4350
- Fixed errors breaking .NET Remoting on method invoke ([#276][i276])
4451
- Fixed PyObject.GetHashCode ([#676][i676])
4552
- Fix memory leaks due to spurious handle incrementation ([#691][i691])
53+
- Fix spurious assembly loading exceptions from private types ([#703][i703])
54+
- Fix inheritance of non-abstract base methods ([#755][i755])
4655

4756

4857
## [2.3.0][] - 2017-03-11
@@ -600,6 +609,7 @@ This document follows the conventions laid out in [Keep a CHANGELOG][].
600609

601610
[1.0.0]: https://github.com/pythonnet/pythonnet/releases/tag/1.0
602611

612+
[i714]: https://github.com/pythonnet/pythonnet/issues/714
603613
[i608]: https://github.com/pythonnet/pythonnet/issues/608
604614
[i443]: https://github.com/pythonnet/pythonnet/issues/443
605615
[p690]: https://github.com/pythonnet/pythonnet/pull/690
@@ -693,3 +703,6 @@ This document follows the conventions laid out in [Keep a CHANGELOG][].
693703
[p625]: https://github.com/pythonnet/pythonnet/pull/625
694704
[i131]: https://github.com/pythonnet/pythonnet/issues/131
695705
[p531]: https://github.com/pythonnet/pythonnet/pull/531
706+
[i755]: https://github.com/pythonnet/pythonnet/pull/755
707+
[p534]: https://github.com/pythonnet/pythonnet/pull/534
708+
[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
@@ -329,9 +329,16 @@ def _install_packages(self):
329329
self.debug_print("Updating NuGet: {0}".format(cmd))
330330
subprocess.check_call(cmd, shell=use_shell)
331331

332-
cmd = "{0} restore pythonnet.sln -MSBuildVersion 14 -o packages".format(nuget)
333-
self.debug_print("Installing packages: {0}".format(cmd))
334-
subprocess.check_call(cmd, shell=use_shell)
332+
try:
333+
# msbuild=14 is mainly for Mono issues
334+
cmd = "{0} restore pythonnet.sln -MSBuildVersion 14 -o packages".format(nuget)
335+
self.debug_print("Installing packages: {0}".format(cmd))
336+
subprocess.check_call(cmd, shell=use_shell)
337+
except:
338+
# when only VS 2017 is installed do not specify msbuild version
339+
cmd = "{0} restore pythonnet.sln -o packages".format(nuget)
340+
self.debug_print("Installing packages: {0}".format(cmd))
341+
subprocess.check_call(cmd, shell=use_shell)
335342

336343
def _find_msbuild_tool(self, tool="msbuild.exe", use_windows_sdk=False):
337344
"""Return full path to one of the Microsoft build tools"""

src/embed_tests/GlobalTestsSetup.cs

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>
@@ -106,6 +106,7 @@
106106
<Compile Include="TestRuntime.cs" />
107107
<Compile Include="TestPyScope.cs" />
108108
<Compile Include="TestTypeManager.cs" />
109+
<Compile Include="GlobalTestsSetup.cs" />
109110
</ItemGroup>
110111
<ItemGroup>
111112
<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/TestPyWith.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

0 commit comments

Comments
 (0)