Skip to content

CoreCLR msbuild (xplat) support. Initial compilable version. #518

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Sep 21, 2017
157 changes: 142 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,145 @@
dist: trusty
sudo: false

language: python
python:
- 2.7
- 3.3
- 3.4
- 3.5
- 3.6
- 3.7-dev


matrix:
allow_failures:
- python: 3.7-dev
include:
- python: 2.7
env:
- BUILD_OPTS=--xplat
- NUNIT_PATH=~/.nuget/packages/nunit.consolerunner/3.*/tools/nunit3-console.exe
addons:
apt:
sources:
- sourceline: deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-trusty-prod trusty main
key_url: https://packages.microsoft.com/keys/microsoft.asc
- sourceline: deb http://download.mono-project.com/repo/ubuntu trusty main
key_url: http://keyserver.ubuntu.com/pks/lookup?op=get&search=0xA6A19B38D3D831EF
packages:
- mono-devel
- ca-certificates-mono
- dotnet-hostfxr-2.0.0
- dotnet-runtime-2.0.0
- dotnet-sdk-2.0.0
- python: 3.3
env:
- BUILD_OPTS=--xplat
- NUNIT_PATH=~/.nuget/packages/nunit.consolerunner/3.*/tools/nunit3-console.exe
addons:
apt:
sources:
- sourceline: deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-trusty-prod trusty main
key_url: https://packages.microsoft.com/keys/microsoft.asc
- sourceline: deb http://download.mono-project.com/repo/ubuntu trusty main
key_url: http://keyserver.ubuntu.com/pks/lookup?op=get&search=0xA6A19B38D3D831EF
packages:
- mono-devel
- ca-certificates-mono
- dotnet-hostfxr-2.0.0
- dotnet-runtime-2.0.0
- dotnet-sdk-2.0.0
- python: 3.4
env:
- BUILD_OPTS=--xplat
- NUNIT_PATH=~/.nuget/packages/nunit.consolerunner/3.*/tools/nunit3-console.exe
addons:
apt:
sources:
- sourceline: deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-trusty-prod trusty main
key_url: https://packages.microsoft.com/keys/microsoft.asc
- sourceline: deb http://download.mono-project.com/repo/ubuntu trusty main
key_url: http://keyserver.ubuntu.com/pks/lookup?op=get&search=0xA6A19B38D3D831EF
packages:
- mono-devel
- ca-certificates-mono
- dotnet-hostfxr-2.0.0
- dotnet-runtime-2.0.0
- dotnet-sdk-2.0.0
- python: 3.5
env:
- BUILD_OPTS=--xplat
- NUNIT_PATH=~/.nuget/packages/nunit.consolerunner/3.*/tools/nunit3-console.exe
addons:
apt:
sources:
- sourceline: deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-trusty-prod trusty main
key_url: https://packages.microsoft.com/keys/microsoft.asc
- sourceline: deb http://download.mono-project.com/repo/ubuntu trusty main
key_url: http://keyserver.ubuntu.com/pks/lookup?op=get&search=0xA6A19B38D3D831EF
packages:
- mono-devel
- ca-certificates-mono
- dotnet-hostfxr-2.0.0
- dotnet-runtime-2.0.0
- dotnet-sdk-2.0.0
- python: 3.6
env:
- BUILD_OPTS=--xplat
- NUNIT_PATH=~/.nuget/packages/nunit.consolerunner/3.*/tools/nunit3-console.exe
addons:
apt:
sources:
- sourceline: deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-trusty-prod trusty main
key_url: https://packages.microsoft.com/keys/microsoft.asc
- sourceline: deb http://download.mono-project.com/repo/ubuntu trusty main
key_url: http://keyserver.ubuntu.com/pks/lookup?op=get&search=0xA6A19B38D3D831EF
packages:
- mono-devel
- ca-certificates-mono
- dotnet-hostfxr-2.0.0
- dotnet-runtime-2.0.0
- dotnet-sdk-2.0.0
- python: "3.7-dev"
env:
- BUILD_OPTS=--xplat
- NUNIT_PATH=~/.nuget/packages/nunit.consolerunner/3.*/tools/nunit3-console.exe
addons:
apt:
sources:
- sourceline: deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-trusty-prod trusty main
key_url: https://packages.microsoft.com/keys/microsoft.asc
- sourceline: deb http://download.mono-project.com/repo/ubuntu trusty main
key_url: http://keyserver.ubuntu.com/pks/lookup?op=get&search=0xA6A19B38D3D831EF
packages:
- mono-devel
- ca-certificates-mono
- dotnet-hostfxr-2.0.0
- dotnet-runtime-2.0.0
- dotnet-sdk-2.0.0

- python: 2.7
env:
- BUILD_OPTS=
- NUNIT_PATH=./packages/NUnit.*/tools/nunit3-console.exe
- python: 3.3
env:
- BUILD_OPTS=
- NUNIT_PATH=./packages/NUnit.*/tools/nunit3-console.exe
- python: 3.4
env:
- BUILD_OPTS=
- NUNIT_PATH=./packages/NUnit.*/tools/nunit3-console.exe
- python: 3.5
env:
- BUILD_OPTS=
- NUNIT_PATH=./packages/NUnit.*/tools/nunit3-console.exe
- python: 3.6
env:
- BUILD_OPTS=
- NUNIT_PATH=./packages/NUnit.*/tools/nunit3-console.exe
- python: "3.7-dev"
env:
- BUILD_OPTS=
- NUNIT_PATH=./packages/NUnit.*/tools/nunit3-console.exe
allow_failures:
- python: "3.7-dev"
env:
- BUILD_OPTS=
- NUNIT_PATH=./packages/NUnit.*/tools/nunit3-console.exe
- python: "3.7-dev"
env:
- BUILD_OPTS=--xplat
- NUNIT_PATH=~/.nuget/packages/nunit.consolerunner/3.*/tools/nunit3-console.exe
env:
global:
- LD_PRELOAD=/lib/x86_64-linux-gnu/libSegFault.so
Expand All @@ -23,8 +150,8 @@ env:
addons:
apt:
sources:
- mono
- mono-libtiff-compat
- sourceline: deb http://download.mono-project.com/repo/ubuntu trusty main
key_url: http://keyserver.ubuntu.com/pks/lookup?op=get&search=0xA6A19B38D3D831EF
packages:
- mono-devel
- ca-certificates-mono
Expand All @@ -37,11 +164,11 @@ before_install:
install:
- pip install --upgrade setuptools # TEMP - due to setuptools 36.2.0 bug
- pip install --upgrade -r requirements.txt
- coverage run setup.py install
- coverage run setup.py install $BUILD_OPTS

script:
- python -m pytest
- mono ./packages/NUnit.*/tools/nunit3-console.exe src/embed_tests/bin/Python.EmbeddingTest.dll
- mono $NUNIT_PATH src/embed_tests/bin/Python.EmbeddingTest.dll

after_script:
# Uncomment if need to geninterop, ie. py37 final
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ This document follows the conventions laid out in [Keep a CHANGELOG][].
## [unreleased][]

### Added
- Added new build system (pythonnet.15.sln) based on dotnetcore-sdk/xplat(crossplatform msbuild).
Currently there two side-by-side build systems that produces the same output (net40) from the same sources.
After a some transition time, current (mono/ msbuild 14.0) build system will be removed.
- NUnit upgraded to 3.7 (eliminates travis-ci random bug)
- Added `clr.GetClrType` (#432, #433)
- Allowed passing `None` for nullable args (#460)
- Added keyword arguments based on C# syntax for calling CPython methods (#461)
Expand Down
7 changes: 7 additions & 0 deletions NuGet.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="dot-net MyGet Feed" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" protocolVersion="3"/>
<add key="api.nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
</packageSources>
</configuration>
16 changes: 15 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
version: '{branch}-{build}'
build: off

image:
- Visual Studio 2017

platform:
- x86
- x64
Expand All @@ -12,6 +15,16 @@ environment:
CODECOV_ENV: PYTHON_VERSION, PLATFORM

matrix:
- PYTHON_VERSION: 2.7
BUILD_OPTS: --xplat
- PYTHON_VERSION: 3.3
BUILD_OPTS: --xplat
- PYTHON_VERSION: 3.4
BUILD_OPTS: --xplat
- PYTHON_VERSION: 3.5
BUILD_OPTS: --xplat
- PYTHON_VERSION: 3.6
BUILD_OPTS: --xplat
- PYTHON_VERSION: 2.7
- PYTHON_VERSION: 3.3
- PYTHON_VERSION: 3.4
Expand All @@ -29,6 +42,7 @@ init:

install:
- pip install --upgrade -r requirements.txt --quiet
- choco install vswhere -y

# Install OpenCover. Can't put on `packages.config`, not Mono compatible
- .\tools\nuget\nuget.exe install OpenCover -OutputDirectory packages -Verbosity quiet
Expand All @@ -37,7 +51,7 @@ build_script:
# Create clean `sdist`. Only used for releases
- python setup.py --quiet sdist
# Build `wheel` with coverage of `setup.py`
- coverage run setup.py bdist_wheel
- coverage run setup.py bdist_wheel %BUILD_OPTS%

test_script:
- pip install --no-index --find-links=.\dist\ pythonnet
Expand Down
7 changes: 6 additions & 1 deletion ci/appveyor_run_tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ if ($FALSE -and $env:PLATFORM -eq "x86"){
# Executable paths for OpenCover
# Note if OpenCover fails, it won't affect the exit codes.
$OPENCOVER = Resolve-Path .\packages\OpenCover.*\tools\OpenCover.Console.exe
$CS_RUNNER = Resolve-Path .\packages\NUnit.*\tools\"$CS_RUNNER".exe
if ($env:BUILD_OPTS -eq "--xplat"){
$CS_RUNNER = Resolve-Path $env:USERPROFILE\.nuget\packages\nunit.consolerunner\*\tools\"$CS_RUNNER".exe
}
else{
$CS_RUNNER = Resolve-Path .\packages\NUnit.*\tools\"$CS_RUNNER".exe
}
$PY = Get-Command python

# Can't use ".\build\*\Python.EmbeddingTest.dll". Missing framework files.
Expand Down
Loading