Skip to content

Commit 2253ef3

Browse files
committed
Merge remote-tracking branch 'upstream/master' into domain-reload-test-cases
2 parents 20861b2 + c81c3c3 commit 2253ef3

25 files changed

+471
-200
lines changed

.travis.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@ dist: xenial
22
sudo: false
33
language: python
44
python:
5+
- 3.9
56
- 3.8
67
- 3.7
78
- 3.6
89

910
env:
1011
matrix:
11-
- BUILD_OPTS=--xplat NUNIT_PATH="~/.nuget/packages/nunit.consolerunner/3.*/tools/nunit3-console.exe" RUN_TESTS=dotnet EMBED_TESTS_PATH=netcoreapp2.0_publish/ PERF_TESTS_PATH=net461/
12+
- BUILD_OPTS=--xplat NUNIT_PATH="~/.nuget/packages/nunit.consolerunner/3.*/tools/nunit3-console.exe" RUN_TESTS=dotnet EMBED_TESTS_PATH=netcoreapp3.1_publish/ PERF_TESTS_PATH=net461/
1213
- BUILD_OPTS="" NUNIT_PATH="./packages/NUnit.*/tools/nunit3-console.exe" RUN_TESTS="mono $NUNIT_PATH" EMBED_TESTS_PATH="" PERF_TESTS_PATH=""
13-
- PYTHONNET_SHUTDOWN_MODE="Soft" BUILD_OPTS=--xplat NUNIT_PATH="~/.nuget/packages/nunit.consolerunner/3.*/tools/nunit3-console.exe" RUN_TESTS=dotnet EMBED_TESTS_PATH=netcoreapp2.0_publish/ PERF_TESTS_PATH=net461/
14+
- PYTHONNET_SHUTDOWN_MODE="Soft" BUILD_OPTS=--xplat NUNIT_PATH="~/.nuget/packages/nunit.consolerunner/3.*/tools/nunit3-console.exe" RUN_TESTS=dotnet EMBED_TESTS_PATH=netcoreapp3.1_publish/ PERF_TESTS_PATH=net461/
1415
- PYTHONNET_SHUTDOWN_MODE="Soft" BUILD_OPTS="" NUNIT_PATH="./packages/NUnit.*/tools/nunit3-console.exe" RUN_TESTS="mono $NUNIT_PATH" EMBED_TESTS_PATH="" PERF_TESTS_PATH=""
1516

1617
global:
@@ -29,9 +30,7 @@ addons:
2930
packages:
3031
- mono-devel
3132
- ca-certificates-mono
32-
- dotnet-hostfxr-2.2
33-
- dotnet-runtime-2.2
34-
- dotnet-sdk-2.2
33+
- dotnet-sdk-3.1
3534

3635
before_install:
3736
# Set-up dll path for embedded tests

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,19 @@ details about the cause of the failure
2525

2626
- Fix incorrect dereference of wrapper object in `tp_repr`, which may result in a program crash
2727
- Fix incorrect dereference in params array handling
28+
- Fixes issue with function resolution when calling overloaded function with keyword arguments from python ([#1097][i1097])
2829
- Fix `object[]` parameters taking precedence when should not in overload resolution
2930
- Fixed a bug where all .NET class instances were considered Iterable
3031
- Fix incorrect choice of method to invoke when using keyword arguments.
3132
- Fix non-delegate types incorrectly appearing as callable.
3233
- Indexers can now be used with interface objects
3334
- Fixed a bug where indexers could not be used if they were inherited
3435
- Made it possible to use `__len__` also on `ICollection<>` interface objects
36+
- Made it possible to call `ToString`, `GetHashCode`, and `GetType` on inteface objects
37+
38+
### Removed
39+
40+
- implicit assembly loading (you have to explicitly `clr.AddReference` before doing import)
3541

3642
## [2.5.0][] - 2020-06-14
3743

appveyor.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: '{branch}-{build}'
22
build: off
33

44
image:
5-
- Visual Studio 2017
5+
- Visual Studio 2019
66

77
platform:
88
- x86
@@ -15,15 +15,20 @@ environment:
1515
CODECOV_ENV: PYTHON_VERSION, PLATFORM
1616

1717
matrix:
18+
- PYTHON_VERSION: 3.9
19+
BUILD_OPTS: --xplat
1820
- PYTHON_VERSION: 3.8
1921
BUILD_OPTS: --xplat
2022
- PYTHON_VERSION: 3.7
2123
BUILD_OPTS: --xplat
2224
- PYTHON_VERSION: 3.6
2325
BUILD_OPTS: --xplat
26+
- PYTHON_VERSION: 3.9
2427
- PYTHON_VERSION: 3.8
2528
- PYTHON_VERSION: 3.7
2629
- PYTHON_VERSION: 3.6
30+
- PYTHON_VERSION: 3.9
31+
PYTHONNET_SHUTDOWN_MODE: Soft
2732
- PYTHON_VERSION: 3.8
2833
PYTHONNET_SHUTDOWN_MODE: Soft
2934
- PYTHON_VERSION: 3.7

ci/appveyor_run_tests.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,12 @@ if ($XPLAT){
9999
$DOTNET_CMD = "c:\Program Files (x86)\dotnet\dotnet"
100100
}
101101

102-
# Run Embedded tests for netcoreapp2.0 (OpenCover currently does not supports dotnet core)
103-
Write-Host ("Starting embedded tests for netcoreapp2.0") -ForegroundColor "Green"
104-
&$DOTNET_CMD ".\src\embed_tests\bin\netcoreapp2.0_publish\Python.EmbeddingTest.dll"
102+
# Run Embedded tests for netcoreapp3.1 (OpenCover currently does not supports dotnet core)
103+
Write-Host ("Starting embedded tests for netcoreapp3.1") -ForegroundColor "Green"
104+
&$DOTNET_CMD ".\src\embed_tests\bin\netcoreapp3.1_publish\Python.EmbeddingTest.dll"
105105
$CS_STATUS = $LastExitCode
106106
if ($CS_STATUS -ne 0) {
107-
Write-Host "Embedded tests for netcoreapp2.0 failed" -ForegroundColor "Red"
107+
Write-Host "Embedded tests for netcoreapp3.1 failed" -ForegroundColor "Red"
108108
ReportTime ""
109109
} else {
110110
ReportTime ".NET Core 2.0 tests completed"

requirements.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
# Requirements for both Travis and AppVeyor
2-
pytest==3.2.5
2+
pytest
33
coverage
44
psutil
55

66
# Coverage upload
77
codecov
88

99
# Platform specific requirements
10-
# pip; sys_platform == 'win32'
11-
wheel; sys_platform == 'win32'
12-
pycparser; sys_platform != 'win32'
10+
wheel
11+
pycparser

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ def build_extension(self, ext):
351351
cmd
352352
+ [
353353
'"/t:Console_15:publish;Python_EmbeddingTest_15:publish"',
354-
"/p:TargetFramework=netcoreapp2.0",
354+
"/p:TargetFramework=netcoreapp3.1",
355355
]
356356
),
357357
shell=use_shell,

src/console/Console.15.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project>
22
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
33
<PropertyGroup>
4-
<TargetFrameworks>net40;netcoreapp2.0</TargetFrameworks>
4+
<TargetFrameworks>net40;netcoreapp3.1</TargetFrameworks>
55
<Platforms>x64;x86</Platforms>
66
<Configurations>DebugMono;DebugMonoPY3;ReleaseMono;ReleaseMonoPY3;DebugWin;DebugWinPY3;ReleaseWin;ReleaseWinPY3</Configurations>
77
<OutputType>Exe</OutputType>

src/embed_tests/Python.EmbeddingTest.15.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
33

44
<PropertyGroup>
5-
<TargetFrameworks>net40;netcoreapp2.0</TargetFrameworks>
5+
<TargetFrameworks>net40;netcoreapp3.1</TargetFrameworks>
66
<Platforms>x64;x86</Platforms>
77
<Configurations>DebugMono;DebugMonoPY3;ReleaseMono;ReleaseMonoPY3;DebugWin;DebugWinPY3;ReleaseWin;ReleaseWinPY3</Configurations>
88
<OutputType Condition="'$(TargetFramework)' != 'net40' OR '$(PYTHONNET_VS_ENV)' == 'true'">Exe</OutputType>
@@ -28,7 +28,7 @@
2828
<CustomDefineConstants Condition="'$(CustomDefineConstants)' == ''">$(PYTHONNET_DEFINE_CONSTANTS)</CustomDefineConstants>
2929
<BaseDefineConstants>XPLAT</BaseDefineConstants>
3030
<DefineConstants>$(DefineConstants);$(CustomDefineConstants);$(BaseDefineConstants);</DefineConstants>
31-
<DefineConstants Condition="'$(TargetFramework)'=='netcoreapp2.0'">$(DefineConstants);NETCOREAPP</DefineConstants>
31+
<DefineConstants Condition="'$(TargetFramework)'=='netcoreapp3.1'">$(DefineConstants);NETCOREAPP</DefineConstants>
3232
<DefineConstants Condition="'$(TargetFramework)'=='netstandard2.0'">$(DefineConstants);NETSTANDARD</DefineConstants>
3333
<DefineConstants Condition="'$(BuildingInsideVisualStudio)' == 'true' AND '$(CustomDefineConstants)' != '' AND $(Configuration.Contains('Debug'))">$(DefineConstants);TRACE;DEBUG</DefineConstants>
3434
<FrameworkPathOverride Condition="'$(TargetFramework)'=='net40' AND $(Configuration.Contains('Mono'))">$(NuGetPackageRoot)\microsoft.targetingpack.netframework.v4.5\1.0.1\lib\net45\</FrameworkPathOverride>
@@ -87,7 +87,7 @@
8787
</PackageReference>
8888
<PackageReference Include="NUnitLite" Version="3.12.0" />
8989
</ItemGroup>
90-
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp2.0'">
90+
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
9191
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
9292
</ItemGroup>
9393
<ItemGroup>

src/runtime/Python.Runtime.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>
@@ -169,6 +169,7 @@
169169
<Compile Include="interop36.cs" />
170170
<Compile Include="interop37.cs" />
171171
<Compile Include="interop38.cs" />
172+
<Compile Include="interop39.cs" />
172173
</ItemGroup>
173174
<ItemGroup>
174175
<None Include="..\pythonnet.snk" />

src/runtime/assemblymanager.cs

Lines changed: 0 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -252,75 +252,6 @@ public static Assembly FindLoadedAssembly(string name)
252252
return null;
253253
}
254254

255-
/// <summary>
256-
/// Given a qualified name of the form A.B.C.D, attempt to load
257-
/// an assembly named after each of A.B.C.D, A.B.C, A.B, A. This
258-
/// will only actually probe for the assembly once for each unique
259-
/// namespace. Returns true if any assemblies were loaded.
260-
/// </summary>
261-
/// <remarks>
262-
/// TODO item 3 "* Deprecate implicit loading of assemblies":
263-
/// Set the fromFile flag if the name of the loaded assembly matches
264-
/// the fully qualified name that was requested if the framework
265-
/// actually loads an assembly.
266-
/// Call ONLY for namespaces that HAVE NOT been cached yet.
267-
/// </remarks>
268-
public static bool LoadImplicit(string name, Action<Exception> assemblyLoadErrorHandler, bool warn = true)
269-
{
270-
string[] names = name.Split('.');
271-
var loaded = false;
272-
var s = "";
273-
Assembly lastAssembly = null;
274-
HashSet<Assembly> assembliesSet = null;
275-
for (var i = 0; i < names.Length; i++)
276-
{
277-
s = i == 0 ? names[0] : s + "." + names[i];
278-
if (!probed.ContainsKey(s))
279-
{
280-
if (assembliesSet == null)
281-
{
282-
assembliesSet = new HashSet<Assembly>(AppDomain.CurrentDomain.GetAssemblies());
283-
}
284-
Assembly a = FindLoadedAssembly(s);
285-
try
286-
{
287-
if (a == null)
288-
{
289-
a = LoadAssemblyPath(s);
290-
}
291-
292-
if (a == null)
293-
{
294-
a = LoadAssembly(s);
295-
}
296-
}
297-
catch (FileLoadException e) { assemblyLoadErrorHandler(e); }
298-
catch (BadImageFormatException e) { assemblyLoadErrorHandler(e); }
299-
catch (System.Security.SecurityException e) { assemblyLoadErrorHandler(e); }
300-
catch (PathTooLongException e) { assemblyLoadErrorHandler(e); }
301-
302-
if (a != null && !assembliesSet.Contains(a))
303-
{
304-
loaded = true;
305-
lastAssembly = a;
306-
}
307-
probed[s] = 1;
308-
}
309-
}
310-
311-
// Deprecation warning
312-
if (warn && loaded)
313-
{
314-
string location = Path.GetFileNameWithoutExtension(lastAssembly.Location);
315-
string deprWarning = "The module was found, but not in a referenced namespace.\n" +
316-
$"Implicit loading is deprecated. Please use clr.AddReference('{location}').";
317-
Exceptions.deprecation(deprWarning);
318-
}
319-
320-
return loaded;
321-
}
322-
323-
324255
/// <summary>
325256
/// Scans an assembly for exported namespaces, adding them to the
326257
/// mapping of valid namespaces. Note that for a given namespace

0 commit comments

Comments
 (0)