Skip to content

Commit dfa6c11

Browse files
authored
Merge branch 'master' into patch-1
2 parents aaf8599 + 75e5231 commit dfa6c11

29 files changed

+1119
-64
lines changed

.travis.yml

Lines changed: 71 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,73 @@
1+
dist: trusty
12
sudo: false
2-
33
language: python
4-
python:
5-
- 2.7
6-
- 3.3
7-
- 3.4
8-
- 3.5
9-
- 3.6
10-
- 3.7-dev
11-
4+
125
matrix:
6+
include:
7+
# --------------------- XPLAT builds ------------------------
8+
- python: 2.7
9+
env: &xplat-env
10+
- BUILD_OPTS=--xplat
11+
- NUNIT_PATH=~/.nuget/packages/nunit.consolerunner/3.*/tools/nunit3-console.exe
12+
addons: &xplat-addons
13+
apt:
14+
sources:
15+
- sourceline: deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-trusty-prod trusty main
16+
key_url: https://packages.microsoft.com/keys/microsoft.asc
17+
- sourceline: deb http://download.mono-project.com/repo/debian trusty/snapshots/5.2.0.224 main
18+
key_url: http://keyserver.ubuntu.com/pks/lookup?op=get&search=0xA6A19B38D3D831EF
19+
packages:
20+
- mono-devel
21+
- ca-certificates-mono
22+
- dotnet-hostfxr-2.0.0
23+
- dotnet-runtime-2.0.0
24+
- dotnet-sdk-2.0.0
25+
- python: 3.3
26+
env: *xplat-env
27+
addons: *xplat-addons
28+
29+
- python: 3.4
30+
env: *xplat-env
31+
addons: *xplat-addons
32+
33+
- python: 3.5
34+
env: *xplat-env
35+
addons: *xplat-addons
36+
37+
- python: 3.6
38+
env: *xplat-env
39+
addons: *xplat-addons
40+
- python: "3.7-dev"
41+
env: *xplat-env
42+
addons: *xplat-addons
43+
44+
# --------------------- Classic builds ------------------------
45+
- python: 2.7
46+
env: &classic-env
47+
- BUILD_OPTS=
48+
- NUNIT_PATH=./packages/NUnit.*/tools/nunit3-console.exe
49+
50+
- python: 3.3
51+
env: *classic-env
52+
53+
- python: 3.4
54+
env: *classic-env
55+
56+
- python: 3.5
57+
env: *classic-env
58+
59+
- python: 3.6
60+
env: *classic-env
61+
62+
- python: "3.7-dev"
63+
env: *classic-env
64+
1365
allow_failures:
14-
- python: 3.7-dev
66+
- python: "3.7-dev"
67+
env: *xplat-env
68+
69+
- python: "3.7-dev"
70+
env: *classic-env
1571

1672
env:
1773
global:
@@ -23,8 +79,8 @@ env:
2379
addons:
2480
apt:
2581
sources:
26-
- mono
27-
- mono-libtiff-compat
82+
- sourceline: deb http://download.mono-project.com/repo/debian trusty/snapshots/5.2.0.224 main
83+
key_url: http://keyserver.ubuntu.com/pks/lookup?op=get&search=0xA6A19B38D3D831EF
2884
packages:
2985
- mono-devel
3086
- ca-certificates-mono
@@ -37,11 +93,12 @@ before_install:
3793
install:
3894
- pip install --upgrade setuptools # TEMP - due to setuptools 36.2.0 bug
3995
- pip install --upgrade -r requirements.txt
40-
- coverage run setup.py install
96+
- coverage run setup.py install $BUILD_OPTS
4197

4298
script:
4399
- python -m pytest
44-
- mono ./packages/NUnit.*/tools/nunit3-console.exe src/embed_tests/bin/Python.EmbeddingTest.dll
100+
- mono $NUNIT_PATH src/embed_tests/bin/Python.EmbeddingTest.dll
101+
- if [[ $BUILD_OPTS == --xplat ]]; then dotnet src/embed_tests/bin/netcoreapp2.0_publish/Python.EmbeddingTest.dll; fi
45102

46103
after_script:
47104
# Uncomment if need to geninterop, ie. py37 final

CHANGELOG.md

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

1010
### Added
11+
- Added support for embedding python into dotnet core 2.0 (NetStandard 2.0)
12+
- Added new build system (pythonnet.15.sln) based on dotnetcore-sdk/xplat(crossplatform msbuild).
13+
Currently there two side-by-side build systems that produces the same output (net40) from the same sources.
14+
After a some transition time, current (mono/ msbuild 14.0) build system will be removed.
15+
- NUnit upgraded to 3.7 (eliminates travis-ci random bug)
1116
- Added `clr.GetClrType` (#432, #433)
1217
- Allowed passing `None` for nullable args (#460)
1318
- Added keyword arguments based on C# syntax for calling CPython methods (#461)

NuGet.config

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<packageSources>
4+
<add key="dot-net MyGet Feed" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" protocolVersion="3"/>
5+
<add key="api.nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
6+
</packageSources>
7+
</configuration>

appveyor.yml

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

4+
image:
5+
- Visual Studio 2017
6+
47
platform:
58
- x86
69
- x64
@@ -12,6 +15,16 @@ environment:
1215
CODECOV_ENV: PYTHON_VERSION, PLATFORM
1316

1417
matrix:
18+
- PYTHON_VERSION: 2.7
19+
BUILD_OPTS: --xplat
20+
- PYTHON_VERSION: 3.3
21+
BUILD_OPTS: --xplat
22+
- PYTHON_VERSION: 3.4
23+
BUILD_OPTS: --xplat
24+
- PYTHON_VERSION: 3.5
25+
BUILD_OPTS: --xplat
26+
- PYTHON_VERSION: 3.6
27+
BUILD_OPTS: --xplat
1528
- PYTHON_VERSION: 2.7
1629
- PYTHON_VERSION: 3.3
1730
- PYTHON_VERSION: 3.4
@@ -37,7 +50,7 @@ build_script:
3750
# Create clean `sdist`. Only used for releases
3851
- python setup.py --quiet sdist
3952
# Build `wheel` with coverage of `setup.py`
40-
- coverage run setup.py bdist_wheel
53+
- coverage run setup.py bdist_wheel %BUILD_OPTS%
4154

4255
test_script:
4356
- pip install --no-index --find-links=.\dist\ pythonnet

ci/appveyor_run_tests.ps1

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@ if ($FALSE -and $env:PLATFORM -eq "x86"){
1111
# Executable paths for OpenCover
1212
# Note if OpenCover fails, it won't affect the exit codes.
1313
$OPENCOVER = Resolve-Path .\packages\OpenCover.*\tools\OpenCover.Console.exe
14-
$CS_RUNNER = Resolve-Path .\packages\NUnit.*\tools\"$CS_RUNNER".exe
14+
if ($env:BUILD_OPTS -eq "--xplat"){
15+
$CS_RUNNER = Resolve-Path $env:USERPROFILE\.nuget\packages\nunit.consolerunner\*\tools\"$CS_RUNNER".exe
16+
}
17+
else{
18+
$CS_RUNNER = Resolve-Path .\packages\NUnit.*\tools\"$CS_RUNNER".exe
19+
}
1520
$PY = Get-Command python
1621

1722
# Can't use ".\build\*\Python.EmbeddingTest.dll". Missing framework files.
@@ -39,6 +44,23 @@ if ($CS_STATUS -ne 0) {
3944
Write-Host "Embedded tests failed" -ForegroundColor "Red"
4045
}
4146

47+
if ($env:BUILD_OPTS -eq "--xplat"){
48+
if ($env:PLATFORM -eq "x64") {
49+
$DOTNET_CMD = "dotnet"
50+
}
51+
else{
52+
$DOTNET_CMD = "c:\Program Files (x86)\dotnet\dotnet"
53+
}
54+
55+
# Run Embedded tests for netcoreapp2.0 (OpenCover currently does not supports dotnet core)
56+
Write-Host ("Starting embedded tests for netcoreapp2.0") -ForegroundColor "Green"
57+
&$DOTNET_CMD .\src\embed_tests\bin\netcoreapp2.0_publish\Python.EmbeddingTest.dll
58+
$CS_STATUS = $LastExitCode
59+
if ($CS_STATUS -ne 0) {
60+
Write-Host "Embedded tests for netcoreapp2.0 failed" -ForegroundColor "Red"
61+
}
62+
}
63+
4264
# Set exit code to fail if either Python or Embedded tests failed
4365
if ($PYTHON_STATUS -ne 0 -or $CS_STATUS -ne 0) {
4466
Write-Host "Tests failed" -ForegroundColor "Red"

0 commit comments

Comments
 (0)