8000 Domain reload test cases fixes by BadSingleton · Pull Request #1287 · pythonnet/pythonnet · GitHub
[go: up one dir, main page]

Skip to content

Domain reload test cases fixes #1287

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
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
fc7da1d
Adds test cases for member changes during a domain reload
BadSingleton Nov 9, 2020
72fafdd
!fixup add the project to the solution files
BadSingleton Nov 9, 2020
20861b2
Add more test cases
BadSingleton Nov 18, 2020
2253ef3
Merge remote-tracking branch 'upstream/master' into domain-reload-tes…
BadSingleton Nov 18, 2020
635edac
Make the tests run as netcoreapp
BadSingleton Nov 19, 2020
0ee931e
Remove stray colon
BadSingleton Nov 19, 2020
3dad96e
Rework the serialization of reflected types
BadSingleton Nov 19, 2020
90a81f3
Call PyType_Modified after modifying the type
BadSingleton Nov 20, 2020
10276f1
Some code review changes
BadSingleton Nov 20, 2020
4d0e2ce
fixup! Some code review changes
BadSingleton Nov 23, 2020
02fa245
Remove hungarian notation from Maybe* types
BadSingleton Nov 23, 2020
91c881c
Check the type of the exception before ignoring it
BadSingleton Nov 23, 2020
284e8e1
Check for validity, don't throw
BadSingleton Nov 23, 2020
fe96781
Refactor the member binding logic of ClassManager
BadSingleton Nov 23, 2020
6ff9e0b
Include info about why deserialization failed in Maybe*
BadSingleton Nov 23, 2020
4d2d05b
improve deserialization resolution of ref, out and in parameters
BadSingleton Nov 24, 2020
5f061bc
Clean up the project and solution files
BadSingleton Nov 26, 2020
3adc559
Merge branch 'master' into domain-reload-test-cases
BadSingleton Nov 26, 2020
e8543cf
Rework the serialization of reflected types
BadSingleton Nov 19, 2020
61b0d8c
Call PyType_Modified after modifying the type
BadSingleton Nov 20, 2020
c8bacf3
Some code review changes
BadSingleton Nov 20, 2020
cde5c23
fixup! Some code review changes
BadSingleton Nov 23, 2020
a956773
Remove hungarian notation from Maybe* types
BadSingleton Nov 23, 2020
ee3b391
Check the type of the exception before ignoring it
BadSingleton Nov 23, 2020
9b4d5f9
Check for validity, don't throw
BadSingleton Nov 23, 2020
a2f3294
Refactor the member binding logic of ClassManager
BadSingleton Nov 23, 2020
46dcb9d
Include info about why deserialization failed in Maybe*
BadSingleton Nov 23, 2020
10116bb
improve deserialization resolution of ref, out and in parameters
BadSingleton Nov 24, 2020
102054e
!fixup leftover error from the rebase
BadSingleton Nov 26, 2020
329de5d
Add fixes and test for nested classes
BadSingleton Nov 27, 2020
f97262b
Code review fixes
BadSingleton Dec 2, 2020
ceb3fab
Merge branch 'master' into domain-reload-test-cases-fixes
BadSingleton Dec 2, 2020
2d6ae4c
fixup! Merge branch 'master' into domain-reload-test-cases-fixes
BadSingleton Dec 2, 2020
16a39a6
fixup! Code review fixes
BadSingleton Dec 2, 2020
ace340d
Fix build failures on non-windows
BadSingleton Dec 8, 2020
78a8088
fixup! Fix build failures on non-windows
BadSingleton Dec 8, 2020
3232f79
Merge remote-tracking branch 'origin/domain-reload-test-cases-fixes' …
BadSingleton Dec 8, 2020
87287a5
Merge branch 'master' into domain-reload-test-cases-fixes
BadSingleton Dec 8, 2020
44b4800
Merge branch 'master' into domain-reload-test-cases-fixes
BadSingleton Dec 10, 2020
79516f1
Code review fixes
BadSingleton Dec 10, 2020
421f665
Merge remote-tracking branch 'upstream/master' into domain-reload-tes…
BadSingleton Dec 10, 2020
5e4c976
(WIP) rework project structure
BadSingleton Dec 11, 2020
9d1991a
Merge remote-tracking branch 'upstream/master' into domain-reload-tes…
BadSingleton Dec 14, 2020
bcf0cd6
Rework the projects file structure
BadSingleton Dec 14, 2020
73e5a6b
Check teh return value of PyDict_DelItemString
BadSingleton Dec 14, 2020
510a7ae
netstandard.dll is a Facade Library
BadSingleton Dec 16, 2020
21eb14c
Remove TestClassReference
BadSingleton Dec 17, 2020
59e81e2
Test runner docs fixes
BadSingleton Dec 17, 2020
1383b5a
Skip the domain reload tests on macos
BadSingleton Dec 17, 2020
fbc06ef
fixup! Skip the domain reload tests on macos
BadSingleton Dec 17, 2020
b3e86da
Update ISSUE_TEMPLATE.md
filmor Dec 17, 2020
0b027c6
refactoring in CreateSubType
lostmsu Dec 17, 2020
b4533c4
allocate space for GCHandle in instances of CLR Metatype (which are t…
lostmsu Dec 18, 2020
0a3f044
classderived: handle tp_dealloc called after tp_clear
lostmsu Dec 18, 2020
639236a
a few extra assertions
lostmsu Dec 18, 2020
3069285
fixed crash in finalizer of CLR types defined in Python, that survive…
lostmsu Dec 18, 2020
5c14aad
Merge branch 'master' into domain-reload-test-cases-fixes
BadSingleton Dec 18, 2020
00c19d5
Merge branch 'master' into domain-reload-test-cases-fixes
BadSingleton Jan 4, 2021
833e836
Fix break introduced by merge
BadSingleton Jan 4, 2021
62ae107
Code review fixes
BadSingleton Jan 4, 2021
eedbae5
Merge remote-tracking branch 'upstream/master' into domain-reload-tes…
BadSingleton Jan 5, 2021
73f39bc
Add the PID of the test runner
BadSingleton Jan 6, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge remote-tracking branch 'upstream/master' into domain-reload-tes…
…t-cases-fixes
  • Loading branch information
BadSingleton committed Dec 10, 2020
commit 421f665e8ab7d6e9822ec4e0ad6dc034cc39f6e9
60 changes: 24 additions & 36 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,65 +5,53 @@ on: [ pull_request, push ]
jobs:
build-test:
name: Build and Test
runs-on: ubuntu-16.04
runs-on: ${{ matrix.os }}-latest

strategy:
fail-fast: false
matrix:
python: [3.6,3.7,3.8,3.9]
shutdown_mode: [Normal,Soft]
toolset: [Mono,.NET]
include:
- toolset: .NET
BUILD_OPTS: --xplat
RUN_TESTS: dotnet
EMBED_TESTS_PATH: netcoreapp3.1_publish/
PERF_TESTS_PATH: net461/
- toolset: Mono
BUILD_OPTS: ""
RUN_TESTS: "mono ./packages/NUnit.*/tools/nunit3-console.exe"
EMBED_TESTS_PATH: ""
PERF_TESTS_PATH: ""

os: [windows, ubuntu, macos]
python: [3.6, 3.7, 3.8, 3.9]
platform: [x64]
shutdown_mode: [Normal, Soft]

env:
BUILD_OPTS: ${{ matrix.BUILD_OPTS }}
RUN_TESTS: ${{ matrix.RUN_TESTS }}
EMBED_TESTS_PATH: ${{ matrix.EMBED_TESTS_PATH }}
PERF_TESTS_PATH: ${{ matrix.PERF_TESTS_PATH }}
PYTHONNET_SHUTDOWN_MODE: ${{ matrix.SHUTDOWN_MODE }}

steps:
- name: Set Environment on macOS
uses: maxim-lobanov/setup-xamarin@v1
if: ${{ matrix.os == 'macos' }}
with:
mono-version: latest

- name: Checkout code
uses: actions/checkout@v2

- name: Install Mono
if: ${{ matrix.toolset == 'Mono' }}
run: |
sudo apt update
sudo apt install mono-devel ca-certificates-mono -y

- name: Install .NET
if: ${{ matrix.toolset == '.NET' }}
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.x

- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
architecture: ${{ matrix.platform }}

- name: Install dependencies
run: |
pip install --upgrade setuptools # TEMP - due to setuptools 36.2.0 bug
pip install --upgrade -r requirements.txt

- name: Install
- name: Build and Install
run: |
echo $BUILD_OPTS
python setup.py install $BUILD_OPTS
python setup.py configure
pip install -v .

- name: Python Tests
run: pytest

- name: .NET Tests
run: $RUN_TESTS src/embed_tests/bin/$EMBED_TESTS_PATH/Python.EmbeddingTest.dll --labels=All
- name: Run Embedding tests
run: dotnet test --runtime any-${{ matrix.platform }} src/embed_tests/
if: ${{ matrix.os != 'macos' }} # Not working right now, doesn't find libpython

# TODO: Run perf tests
# TODO: Run mono tests on Windows?
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
/src/runtime/interopNative.cs

# Configuration data
configured.props

# General binaries and Build results
*.dll
*.exe
Expand All @@ -17,6 +20,7 @@ __pycache__/
build/
dist/
*.egg-info/
.eggs/

# Unit test / coverage reports
htmlcov/
Expand Down
17 changes: 17 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<Project>
<PropertyGroup>
<VersionPrefix>3.0.0</VersionPrefix>
<AssemblyCopyright>Copyright (c) 2006-2020 The Contributors of the Python.NET Project</AssemblyCopyright>
<AssemblyCompany>pythonnet</AssemblyCompany>
<AssemblyProduct>Python.NET</AssemblyProduct>
<LangVersion>7.3</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="NonCopyableAnalyzer" Version="0.6.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildThisFileDirectory)configured.props" Condition="Exists('$(MSBuildThisFileDirectory)configured.props')" />
</Project>
7 changes: 0 additions & 7 deletions NuGet.config

This file was deleted.

37 changes: 6 additions & 31 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,11 @@ platform:

environment:
global:
PYTHONUNBUFFERED: True
PYTHONUNBUFFERED: 'True'
PYTHONWARNINGS: 'ignore:::wheel.pep425tags:'
CODECOV_ENV: PYTHON_VERSION, PLATFORM

matrix:
- PYTHON_VERSION: 3.9
BUILD_OPTS: --xplat
- PYTHON_VERSION: 3.8
BUILD_OPTS: --xplat
- PYTHON_VERSION: 3.7
BUILD_OPTS: --xplat
- PYTHON_VERSION: 3.6
BUILD_OPTS: --xplat
- PYTHON_VERSION: 3.9
- PYTHON_VERSION: 3.8
- PYTHON_VERSION: 3.7
Expand All @@ -47,35 +39,18 @@ init:
install:
- python -m pip install -U pip
- pip install --upgrade -r requirements.txt --quiet
- pip install pycparser --quiet

# Install OpenCover. Can't put on `packages.config`, not Mono compatible
- .\tools\nuget\nuget.exe install OpenCover -OutputDirectory packages -Verbosity quiet

build_script:
- python setup.py configure
# 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 %BUILD_OPTS%
- python setup.py bdist_wheel

test_script:
- pip install --no-index --find-links=.\dist\ pythonnet
- ps: .\ci\appveyor_run_tests.ps1

on_finish:
# Temporary disable multiple upload due to codecov limit of 20 per commit.
# https://docs.codecov.io/blog/week-8-2017
- coverage xml -i
# - codecov --file coverage.xml --flags setup_windows
# - codecov --file py.coverage --flags python_tests
# - codecov --file cs.coverage --flags embedded_tests
- codecov --file py.coverage cs.coverage coverage.xml --flags setup_windows
#- ps: .\ci\appveyor_run_tests.ps1
- pytest
- dotnet test src/embed_tests/

artifacts:
- path: dist\*
- path: '.\src\runtime\bin\*.nupkg'

notifications:
- provider: Slack
incoming_webhook:
secure: 2S/t6rGHdbwoxehnvn5KgfsHrBFEtwnPD7M5olGErmz70oWFVpqoWd/EvDwh7rKZGdOTjDmpwcukc2xi5VRaGHbBAqFYS3tAdgAMrcaTNWs=
41 changes: 41 additions & 0 deletions clr.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
"""
Legacy Python.NET loader for backwards compatibility
"""

def _get_netfx_path():
import os, sys

if sys.maxsize > 2 ** 32:
arch = "amd64"
else:
arch = "x86"

return os.path.join(os.path.dirname(__file__), "pythonnet", "netfx", arch, "clr.pyd")


def _get_mono_path():
import os, glob

paths = glob.glob(os.path.join(os.path.dirname(__file__), "pythonnet", "mono", "clr.*so"))
return paths[0]


def _load_clr():
import sys
from importlib import util

if sys.platform == "win32":
path = _get_netfx_path()
else:
path = _get_mono_path()

del sys.modules[__name__]

spec = util.spec_from_file_location("clr", path)
clr = util.module_from_spec(spec)
spec.loader.exec_module(clr)

sys.modules[__name__] = clr


_load_clr()
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["setuptools>=42", "wheel", "setuptools_scm[toml]>=3.4", "pycparser"]
build-backend = "setuptools.build_meta"
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.
0