Skip to content

Commit 6849df3

Browse files
authored
Merge branch 'master' into reset-gc
2 parents 1fae108 + 93a8c83 commit 6849df3

Some content is hidden

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

56 files changed

+1612
-222
lines changed

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,10 @@ UpgradeLog*.htm
5757

5858
# Coverity
5959
cov-int/
60+
61+
# Visual Studio Code
62+
.vscode/*
63+
!.vscode/settings.json
64+
!.vscode/tasks.json
65+
!.vscode/launch.json
66+
!.vscode/extensions.json

.travis.yml

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -22,45 +22,57 @@ matrix:
2222
- dotnet-hostfxr-2.0.0
2323
- dotnet-runtime-2.0.0
2424
- dotnet-sdk-2.0.0
25-
- python: 3.4
26-
env: *xplat-env
27-
addons: *xplat-addons
28-
25+
2926
- python: 3.5
3027
env: *xplat-env
3128
addons: *xplat-addons
3229

3330
- python: 3.6
3431
env: *xplat-env
3532
addons: *xplat-addons
36-
- python: "3.7-dev"
33+
34+
- python: 3.7
3735
env: *xplat-env
38-
addons: *xplat-addons
36+
dist: xenial
37+
sudo: true
38+
addons: &xplat-addons-xenial
39+
apt:
40+
sources:
41+
- sourceline: deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-xenial-prod xenial main
42+
key_url: https://packages.microsoft.com/keys/microsoft.asc
43+
- sourceline: deb https://download.mono-project.com/repo/ubuntu stable-xenial main
44+
key_url: http://keyserver.ubuntu.com/pks/lookup?op=get&search=0xA6A19B38D3D831EF
45+
packages:
46+
- mono-devel
47+
- ca-certificates-mono
48+
- dotnet-hostfxr-2.0.0
49+
- dotnet-runtime-2.0.0
50+
- dotnet-sdk-2.0.0
3951

4052
# --------------------- Classic builds ------------------------
4153
- python: 2.7
4254
env: &classic-env
4355
- BUILD_OPTS=
4456
- NUNIT_PATH=./packages/NUnit.*/tools/nunit3-console.exe
4557

46-
- python: 3.4
47-
env: *classic-env
48-
4958
- python: 3.5
5059
env: *classic-env
5160

5261
- python: 3.6
5362
env: *classic-env
5463

55-
- python: "3.7-dev"
56-
env: *classic-env
57-
58-
allow_failures:
59-
- python: "3.7-dev"
60-
env: *xplat-env
61-
62-
- python: "3.7-dev"
64+
- python: 3.7
6365
env: *classic-env
66+
dist: xenial
67+
sudo: true
68+
addons:
69+
apt:
70+
sources:
71+
- sourceline: deb http://download.mono-project.com/repo/ubuntu xenial main
72+
key_url: http://keyserver.ubuntu.com/pks/lookup?op=get&search=0xA6A19B38D3D831EF
73+
packages:
74+
- mono-devel
75+
- ca-certificates-mono
6476

6577
env:
6678
global:

AUTHORS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
- Alexandre Catarino([@AlexCatarino](https://github.com/AlexCatarino))
1616
- Arvid JB ([@ArvidJB](https://github.com/ArvidJB))
17+
- Benoît Hudson ([@benoithudson](https://github.com/benoithudson))
1718
- Bradley Friedman ([@leith-bartrich](https://github.com/leith-bartrich))
1819
- Callum Noble ([@callumnoble](https://github.com/callumnoble))
1920
- Christian Heimes ([@tiran](https://github.com/tiran))
@@ -22,6 +23,7 @@
2223
- Daniel Fernandez ([@fdanny](https://github.com/fdanny))
2324
- Daniel Santana ([@dgsantana](https://github.com/dgsantana))
2425
- Dave Hirschfeld ([@dhirschfeld](https://github.com/dhirschfeld))
26+
- David Lassonde ([@lassond](https://github.com/lassond))
2527
- David Lechner ([@dlech](https://github.com/dlech))
2628
- Dmitriy Se ([@dmitriyse](https://github.com/dmitriyse))
2729
- He-chien Tsai ([@t3476](https://github.com/t3476))
@@ -40,6 +42,8 @@
4042
- Sam Winstanley ([@swinstanley](https://github.com/swinstanley))
4143
- Sean Freitag ([@cowboygneox](https://github.com/cowboygneox))
4244
- Serge Weinstock ([@sweinst](https://github.com/sweinst))
45+
- Simon Mourier ([@smourier](https://github.com/smourier))
46+
- Viktoria Kovescses ([@vkovec](https://github.com/vkovec))
4347
- Ville M. Vainio ([@vivainio](https://github.com/vivainio))
4448
- Virgil Dupras ([@hsoft](https://github.com/hsoft))
4549
- Wenguang Yang ([@yagweb](https://github.com/yagweb))

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,35 @@ 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])
1921
- Catches exceptions thrown in C# iterators (yield returns) and rethrows them in python ([#475][i475])([#693][p693])
2022
- Implemented GetDynamicMemberNames() for PyObject to allow dynamic object members to be visible in the debugger ([#443][i443])([#690][p690])
2123
- Incorporated reference-style links to issues and pull requests in the CHANGELOG ([#608][i608])
2224
- Added detailed comments about aproaches and dangers to handle multi-app-domains ([#625][p625])
25+
- Python 3.7 support, builds and testing added. Defaults changed from Python 3.6 to 3.7 ([#698][p698])
2326

2427
### Changed
2528

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+
2632
### Fixed
2733

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])
2836
- Fixed Visual Studio 2017 compat ([#434][i434]) for setup.py
37+
- Fixed crashes when integrating pythonnet in Unity3d ([#714][i714]),
38+
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])
2940
- Fixed crash on exit of the Python interpreter if a python class
3041
derived from a .NET class has a `__namespace__` or `__assembly__`
3142
attribute ([#481][i481])
@@ -37,6 +48,8 @@ This document follows the conventions laid out in [Keep a CHANGELOG][].
3748
- Fixed errors breaking .NET Remoting on method invoke ([#276][i276])
3849
- Fixed PyObject.GetHashCode ([#676][i676])
3950
- 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])
4053

4154

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

595608
[1.0.0]: https://github.com/pythonnet/pythonnet/releases/tag/1.0
596609

610+
[i714]: https://github.com/pythonnet/pythonnet/issues/714
597611
[i608]: https://github.com/pythonnet/pythonnet/issues/608
598612
[i443]: https://github.com/pythonnet/pythonnet/issues/443
599613
[p690]: https://github.com/pythonnet/pythonnet/pull/690
@@ -686,3 +700,7 @@ This document follows the conventions laid out in [Keep a CHANGELOG][].
686700
[p163]: https://github.com/pythonnet/pythonnet/pull/163
687701
[p625]: https://github.com/pythonnet/pythonnet/pull/625
688702
[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"/>

appveyor.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@ environment:
1717
matrix:
1818
- PYTHON_VERSION: 2.7
1919
BUILD_OPTS: --xplat
20-
- PYTHON_VERSION: 3.4
21-
BUILD_OPTS: --xplat
2220
- PYTHON_VERSION: 3.5
2321
BUILD_OPTS: --xplat
2422
- PYTHON_VERSION: 3.6
2523
BUILD_OPTS: --xplat
24+
- PYTHON_VERSION: 3.7
25+
BUILD_OPTS: --xplat
2626
- PYTHON_VERSION: 2.7
27-
- PYTHON_VERSION: 3.4
2827
- PYTHON_VERSION: 3.5
2928
- PYTHON_VERSION: 3.6
29+
- PYTHON_VERSION: 3.7
3030

3131
matrix:
3232
allow_failures:

setup.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
# Allow config/verbosity to be set from cli
2323
# http://stackoverflow.com/a/4792601/5208670
2424
CONFIG = "Release" # Release or Debug
25-
VERBOSITY = "minimal" # quiet, minimal, normal, detailed, diagnostic
25+
VERBOSITY = "normal" # quiet, minimal, normal, detailed, diagnostic
2626

2727
is_64bits = sys.maxsize > 2**32
2828
DEVTOOLS = "MsDev" if sys.platform == "win32" else "Mono"
@@ -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"""
@@ -516,10 +523,10 @@ def run(self):
516523
'Programming Language :: Python :: 2',
517524
'Programming Language :: Python :: 2.7',
518525
'Programming Language :: Python :: 3',
519-
'Programming Language :: Python :: 3.3',
520526
'Programming Language :: Python :: 3.4',
521527
'Programming Language :: Python :: 3.5',
522528
'Programming Language :: Python :: 3.6',
529+
'Programming Language :: Python :: 3.7',
523530
'Operating System :: Microsoft :: Windows',
524531
'Operating System :: POSIX :: Linux',
525532
'Operating System :: MacOS :: MacOS X',

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.15.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
<BaseDefineConstants>XPLAT</BaseDefineConstants>
3030
<DefineConstants>$(DefineConstants);$(CustomDefineConstants);$(BaseDefineConstants);</DefineConstants>
3131
<DefineConstants Condition="'$(TargetFramework)'=='netcoreapp2.0'">$(DefineConstants);NETCOREAPP</DefineConstants>
32+
<DefineConstants Condition="'$(TargetFramework)'=='netstandard2.0'">$(DefineConstants);NETSTANDARD</DefineConstants>
3233
<DefineConstants Condition="'$(BuildingInsideVisualStudio)' == 'true' AND '$(CustomDefineConstants)' != '' AND $(Configuration.Contains('Debug'))">$(DefineConstants);TRACE;DEBUG</DefineConstants>
3334
<FrameworkPathOverride Condition="'$(TargetFramework)'=='net40' AND $(Configuration.Contains('Mono'))">$(NuGetPackageRoot)\microsoft.targetingpack.netframework.v4.5\1.0.1\lib\net45\</FrameworkPathOverride>
3435
</PropertyGroup>

src/embed_tests/Python.EmbeddingTest.csproj

Lines changed: 5 additions & 2 deletions
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>
@@ -86,6 +86,7 @@
8686
<Compile Include="pyrunstring.cs" />
8787
<Compile Include="TestConverter.cs" />
8888
<Compile Include="TestCustomMarshal.cs" />
89+
<Compile Include="TestDomainReload.cs" />
8990
<Compile Include="TestExample.cs" />
9091
<Compile Include="TestPyAnsiString.cs" />
9192
<Compile Include="TestPyFloat.cs" />
@@ -103,6 +104,8 @@
103104
<Compile Include="TestPyWith.cs" />
104105
<Compile Include="TestRuntime.cs" />
105106
<Compile Include="TestPyScope.cs" />
107+
<Compile Include="TestTypeManager.cs" />
108+
<Compile Include="GlobalTestsSetup.cs" />
106109
</ItemGroup>
107110
<ItemGroup>
108111
<ProjectReference Include="..\runtime\Python.Runtime.csproj">
@@ -122,4 +125,4 @@
122125
<Copy SourceFiles="$(TargetAssembly)" DestinationFolder="$(PythonBuildDir)" />
123126
<!--Copy SourceFiles="$(TargetAssemblyPdb)" Condition="Exists('$(TargetAssemblyPdb)')" DestinationFolder="$(PythonBuildDir)" /-->
124127
</Target>
125-
</Project>
128+
</Project>

0 commit comments

Comments
 (0)