Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Last line of defense, best effort serialization #15

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 484 commits into from
May 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
484 commits
Select commit Hold shift + click to select a range
58df35b
include README.md into NuGet package
lostmsu Oct 15, 2021
5d6e5d5
use reference types instead of IntPtr where possible in runtime.cs
lostmsu Oct 17, 2021
2d33902
switched converter.cs to the new style references
lostmsu Oct 17, 2021
f8b761a
switched most of classbase.cs to the new style references (except cro…
lostmsu Oct 17, 2021
09d8e41
switched pyobject.cs to the new style references
lostmsu Oct 17, 2021
1b58cf4
mostly switched moduleobject.cs to the new style references
lostmsu Oct 17, 2021
c05c6ec
switched methodbinder.cs to the new style references
lostmsu Oct 17, 2021
d626f7e
partially switched classderived.cs to the new reference style
lostmsu Oct 17, 2021
ff60ec4
switched arrayobject.cs to the new style references
lostmsu Oct 17, 2021
0010fa0
switched delegatemanager.cs to the new style references
lostmsu Oct 17, 2021
178a359
partially switched metatype.cs to the new style references
lostmsu Oct 18, 2021
9764b25
switched typemanager.cs to the new style references
lostmsu Oct 18, 2021
11edcc3
switched pytype.cs to the new style references
lostmsu Oct 18, 2021
2e71874
mass enable nullable types
lostmsu Oct 18, 2021
3076040
fixed nullablity in arrayobject.cs
lostmsu Oct 18, 2021
56f3bd5
fixed nullability in assemblymanager.cs
lostmsu Oct 18, 2021
58cb0e6
switched classmanager.cs to the new style references
lostmsu Oct 18, 2021
2095b46
switched classobject.cs to the new style references
lostmsu Oct 18, 2021
f6b84da
partially switched managedtype.cs to the new style references
lostmsu Oct 18, 2021
ee65632
partially switched classmanager.cs to the new style references
lostmsu Oct 18, 2021
5266dc4
PyIdentifier public members to return borrowed references
lostmsu Oct 6, 2021
0bc3670
added nullability annotations to methodbinder.cs
lostmsu Oct 18, 2021
de9a8cb
switched methodbinding.cs and methodobject.cs to the new style refere…
lostmsu Oct 18, 2021
9195c30
switched overload.cs to the new style references
lostmsu Oct 18, 2021
590de7a
switched propertyobject.cs to the new style references
lostmsu Oct 18, 2021
7fa537a
switched delegateobject.cs to the new style references
lostmsu Oct 18, 2021
49124fc
switched module.cs to the new style references
lostmsu Oct 18, 2021
9db9b0b
nullability annotations for PyObject
lostmsu Oct 18, 2021
00fd17a
switched modulefunctionobject.cs to the new style references
lostmsu Oct 18, 2021
5798b41
minor refactorings
lostmsu Oct 18, 2021
ebdf7c5
partially switched moduleobject.cs and importhook.cs to the new style…
lostmsu Oct 18, 2021
5ad09e4
switched exceptions.cs to the new style references
lostmsu Oct 18, 2021
d1abd9a
switched interfaceobject.cs to the new style references
lostmsu Oct 18, 2021
43a862a
switched pythonexception.cs to the new style references
lostmsu Oct 18, 2021
1d80162
switched pytuple.cs to the new style references
lostmsu Oct 18, 2021
0241b38
switched eventobject.cs and eventbiding.cs to the new style references
lostmsu Oct 18, 2021
2ac952a
switched all PyObject derived classes to the new style references
lostmsu Oct 18, 2021
7adf98a
implemented non-confusing PyModule_AddObject
lostmsu Oct 18, 2021
2dd3f8f
switched pythonengine.cs to the new style references
lostmsu Oct 18, 2021
3b79019
switched fieldobject.cs and constructorbinding.cs to the new style re…
lostmsu Oct 18, 2021
9b990c1
switched finalizer.cs to the new style references
lostmsu Oct 19, 2021
027e529
switched debughelper.cs to the new style references
lostmsu Oct 19, 2021
4793818
switched converter extensions and sample codecs to the new style refe…
lostmsu Oct 19, 2021
0d60500
switched collection wrappers (from sample codec) to the new style ref…
lostmsu Oct 19, 2021
cf606a2
switched iterator.cs and indexer.cs to the new style references
lostmsu Oct 19, 2021
bb84c48
getting rid of a few minor warnings and compile errors
lostmsu Oct 19, 2021
e295679
switched to new references in some tests
lostmsu Oct 19, 2021
7a9e411
switched state serialization to new reference types (untested)
lostmsu Oct 19, 2021
9a9ed3b
minor error fixes
lostmsu Oct 19, 2021
581f695
assume remaning manual refcounting is not needed, because we use smar…
lostmsu Oct 19, 2021
07f1657
fixed new reference uses, that are not allowed in C#
lostmsu Oct 19, 2021
7deebd4
renamed parameter in tp_dealloc functions for clarity
lostmsu Oct 19, 2021
8619e77
allowed untested calls to PyObject_GC_Del and XDecref (3 in total)
lostmsu Oct 19, 2021
672aef6
fixed compile errors in TypeMethod (untested)
lostmsu Oct 19, 2021
c4909d4
workaround for analyzer not permitting copying a reference as the las…
lostmsu Oct 19, 2021
6fa2004
switched tests to match the new reference changes
lostmsu Oct 19, 2021
14949fb
fixed thunk loading for slots, that use new reference types
lostmsu Oct 19, 2021
0728e21
fixed PyObject_DelAttr load from DLL failing
lostmsu Oct 19, 2021
fe4c481
fixed uses of Marshal.Read/Marshal.Write overloads with first argumen…
lostmsu Oct 19, 2021
4346d41
fixed OnSerialized and OnDeserialized in PyObject not being typed cor…
lostmsu Oct 19, 2021
62e193a
fixed bad equality comparisons
lostmsu Oct 20, 2021
2fa8b9c
improved reliability of Clean and Dealloc implementations
lostmsu Oct 20, 2021
d6607b0
bad if condition
lostmsu Oct 20, 2021
6335d97
improved GetThunk reliability
lostmsu Oct 20, 2021
d649d6c
fixed circular dependency in Runtime PyMembers and InternString initi…
lostmsu Oct 20, 2021
d1bc193
tiny refactor
lostmsu Oct 20, 2021
32c4bb6
switched generictype.cs to the new style references
lostmsu Oct 20, 2021
a1427ac
increfs in OnSave are no longer necessary with the new references
lostmsu Oct 20, 2021
cd97a46
fixed MethodBinding failing for reference types
lostmsu Oct 20, 2021
05ecbcf
nullability annotation fix in MaybeMethodBase
lostmsu Oct 20, 2021
a3591b6
minor improvements
lostmsu Oct 20, 2021
ac336a8
remove unused PythonMethodAttribute
lostmsu Oct 22, 2021
7ed0c7a
WIP
lostmsu Oct 24, 2021
d6a853f
avoid generating and handling useless SerializationException when May…
lostmsu Oct 28, 2021
b0c25c1
finalizer does not attempt to finalize objects when runtime is shut down
lostmsu Oct 28, 2021
5ca474a
PyType Dict and MRO properties to assist debugging
lostmsu Oct 28, 2021
48078b3
WIP 2
lostmsu Oct 28, 2021
a624dd8
fixed PyObject disposal crashing when runtime is still finalizing
lostmsu Oct 29, 2021
e7ab071
arrays: use 64 bit indexing, and avoid first chance .NET exceptions o…
lostmsu Oct 29, 2021
cbe1dd2
refactored conditional ClassBase slot initialization
lostmsu Oct 29, 2021
d5f1c48
removed DisposePythonWrappersForClrTypes
lostmsu Oct 29, 2021
74d87c5
simplified outdated condition in ClassBase.tp_clear
lostmsu Oct 29, 2021
82d6c33
sprinkled a few DebuggerHidden to make debugging easier
lostmsu Oct 29, 2021
eeebcd7
fixed derived classes not inheriting slots correctly
lostmsu Oct 29, 2021
8ee8d3d
remove unused TypeManager._slotImpls
lostmsu Oct 29, 2021
1a4ada7
fixed TestRuntime not building in Release mode
lostmsu Oct 30, 2021
a610aa3
can't really clear managed references to Python objects from ManagedT…
lostmsu Oct 30, 2021
03f32cb
PythonException is serializable
lostmsu Oct 30, 2021
b1c9f5b
EventObject no longer used for static events. EventBinding is constru…
lostmsu Oct 30, 2021
cb4bb9a
use a special class to stub .NET types that no longer exist after a d…
lostmsu Nov 2, 2021
652f946
make EventHandlerCollection serializable
lostmsu Nov 2, 2021
84db670
fixed MaybeMemberInfo always failing for properties
lostmsu Nov 2, 2021
56fafe3
fixed construct_removed_class domain reload test case
lostmsu Nov 2, 2021
d33dcdd
domain reload test runner can run test by index
lostmsu Nov 2, 2021
b737e10
minor docs change
lostmsu Nov 2, 2021
d3e4fba
assert check in GetUnmanagedBaseType for null base
lostmsu Nov 2, 2021
e003e12
PythonEngine .Exec and .Eval no longer work with raw pointers
lostmsu Nov 9, 2021
d0a6f44
a few annotation to ease debugging
lostmsu Nov 9, 2021
e31f7ba
ensure Python types continue to exist when registered decoders for th…
lostmsu Nov 9, 2021
48c0dfc
GC-related WIP
lostmsu Nov 9, 2021
4f657d4
Track Runtime run number. Assert, that PyObjects are only disposed in…
lostmsu Mar 3, 2020
62e2fb4
dispose registered codecs and interop configuration during shutdown
lostmsu Nov 12, 2021
1897d1b
Finalizer raises FinalizationException when it sees an object from pr…
lostmsu Nov 12, 2021
3909639
allow tests to pass when objects are leaking due to being GCed after …
lostmsu Nov 12, 2021
60d90c6
removed code testing possiblity to dispose objects after domain restart
lostmsu Nov 12, 2021
9e815a6
allow leaking PyObject instances when CLR is stared from Python
lostmsu Nov 12, 2021
8611dde
WaitForFullGCComplete was never needed, and was used incorrectly
lostmsu Nov 12, 2021
39f51fe
Drop remaining references to AppVeyor
filmor Nov 13, 2021
94b1a71
Disable SourceLink VCS reading for now
filmor Nov 14, 2021
3328d7d
Fix readme and setup.py for uploading to pypi
filmor Nov 19, 2021
6383a28
remove finalizer assert for raw pointer value; skip collection assert…
lostmsu Nov 22, 2021
47b3913
renamed run system property to __pythonnet_run__ to be consistent wit…
lostmsu Nov 23, 2021
55abd29
Merge pull request #1074 from losttech/bugs/1073
filmor Nov 23, 2021
b7e8fdc
use .NET 6.0 LTS and C# 10
lostmsu Nov 23, 2021
44d65d9
merge latest master
lostmsu Nov 23, 2021
cb58147
merge latest changes from upstream
lostmsu Nov 23, 2021
2fdbf0e
added TraceAlloc solution configuration
lostmsu Nov 24, 2021
a8ef06c
fixed sending PyObject across domain boundary
lostmsu Nov 24, 2021
7167229
fixed accidental premature disposal of Runtime.PyNone
lostmsu Nov 24, 2021
ab11fa2
made freeing GCHandles more robust
lostmsu Nov 24, 2021
7a4daeb
removed bad assert in generated constructor for derived classes
lostmsu Nov 24, 2021
e422367
fixed __pyobj__ access
lostmsu Nov 24, 2021
a74ea86
minor
lostmsu Nov 24, 2021
0325a8c
fixed Python derived types trying to double-free GCHandle when collec…
lostmsu Nov 24, 2021
85fab3b
reinstate collection assert on shutdown from Python
lostmsu Nov 24, 2021
932fce2
fixed crash when Python derived class instances survive past early sh…
lostmsu Nov 24, 2021
c2e207a
delay nulling GC handles of reflected instances until the last moment…
lostmsu Nov 24, 2021
c8f0f09
fixed assert in XDecref in case _Py_IsFinalizing is not present
lostmsu Nov 24, 2021
e269cf0
when initialized from Python, reset slots implemented in CLR: CLR mig…
lostmsu Nov 25, 2021
d7d5cb7
fixed minor warnings
lostmsu Nov 25, 2021
d6edace
fixed line endings in intern_.cs
lostmsu Nov 25, 2021
a86994f
use NonCopyableAnalyzer 0.7.0-m05
lostmsu Nov 25, 2021
42b9665
update NonCopyableAnalyzer to latest version with our changes upstreamed
lostmsu Nov 29, 2021
bc5b084
Merge pull request #1624 from losttech/u/NonCopyable/0.7.0
filmor Nov 29, 2021
2e040ea
Merge pull request #2 from losttech/ManagedType-DontKeepBorrowedRefs
lostmsu Dec 9, 2021
b614dba
merge latest master
lostmsu Dec 9, 2021
f09a48b
fixed MacOS bad assembly test by using PythonDLL (which is never a .N…
lostmsu Dec 9, 2021
8c0fcf6
Add manifest file to include C# sources
filmor Dec 13, 2021
a0e8cb3
Fix passing of dotnet config to setup.py
filmor Dec 13, 2021
3794fea
Merge branch 'master' into precise-API-references
lostmsu Dec 14, 2021
8754ed1
Merge pull request #1603 from losttech/precise-API-references
lostmsu Dec 14, 2021
ac74383
fixed all warnings except explicit ones
lostmsu Dec 15, 2021
640e97b
Add Python 3.10 to the list of supported versions
filmor Dec 19, 2021
332cae9
Match generic and private methods upon runtime reload
lostmsu Dec 18, 2021
48c0ca6
"No method matches given arguments" message now includes type name
lostmsu Dec 21, 2021
9fb7e65
bring NuGet preview CI job in line with main
lostmsu Dec 23, 2021
806f79e
Require newest available clr-loader (#1643)
filmor Dec 23, 2021
216c705
Fix the PyGILState_STATE type
filmor Dec 23, 2021
dfeb354
Fix warning regarding undefined __module__ on GC Offset Base
filmor Dec 23, 2021
53836de
`ShutdownMode` has been removed. The only shutdown mode supported now…
lostmsu Dec 20, 2021
e9c3a3d
fixed InterfaceObject and MethodObject not being serializable
lostmsu Dec 20, 2021
2596cdf
fixed Python derived types crashing on shutdown of Python process
lostmsu Dec 20, 2021
ec8b69f
attempt to fix crash on shutdown of Python executable
lostmsu Dec 20, 2021
8d61215
when process is exiting, there's no need to save live .NET objects as…
lostmsu Dec 27, 2021
cc72be4
moved Py class into its own file (#1649)
lostmsu Dec 29, 2021
8d6a918
added a regression test for https://github.com/pythonnet/pythonnet/is…
lostmsu Dec 30, 2021
fc31de1
base accessors were not exposed to Python because .NET PropertyInfo G…
lostmsu Dec 28, 2021
c4238d9
reworked the way .NET objects are constructed from Python
lostmsu Dec 29, 2021
fabb22c
improved support for generic method overloading
lostmsu Jan 4, 2022
7e5cc29
use the same facility to access Py_NoSiteFlag as the one used to load…
lostmsu Jan 6, 2022
efad01c
provide `__int__` instance method on .NET enum types to support int(E…
lostmsu Jan 6, 2022
88850f5
cleanup PyBuffer a bit:
lostmsu Jan 6, 2022
7450c5c
added support for byref parameters when overriding .NET methods from …
lostmsu Jan 6, 2022
7e2ec4d
Performance tests with baseline from Pypi (#1667)
filmor Jan 9, 2022
5cb4029
Move code to subdirectories and rename or split up
filmor Jan 8, 2022
c294582
Remove obsolete documented remark on Exception types
filmor Jan 8, 2022
67dded2
Merge pull request #1665 from filmor/move-everything-around
filmor Jan 9, 2022
f81b1c6
Add ARM64 CI action (#1669)
lostmsu Jan 9, 2022
75f4398
Only run CI on pushes to master and on all pull requests (#1670)
filmor Jan 9, 2022
f69753c
allow Python not passing fake arguments for out parameters (#1672)
eirannejad Jan 14, 2022
b7fb03a
added todo note to ensure CLA is signed
eirannejad Jan 15, 2022
ca1a72b
Add tests for exception leaking.
BadSingleton Jan 24, 2022
dd5a8de
We can drop the import hack as we are now using the newer import mech…
filmor Jan 28, 2022
dd3302a
Update CHANGELOG.md (#1690)
nobbi1991 Jan 31, 2022
ad0d4e7
allow dynamic PyObject conversion to IEnumerable when the object is a…
lostmsu Feb 17, 2022
7637884
removed dead code
lostmsu Feb 28, 2022
303378a
add GitHub URL for PyPi (#1708)
andriyor Mar 3, 2022
eec30c0
make methods of PyObject inherited from its base C# classes GIL-safe
lostmsu Mar 3, 2022
5e041af
on runtime shutdown from Python release all slot holders, not only th…
lostmsu Mar 4, 2022
e9cbb87
do not attempt to manually delete derived class instances after TypeM…
lostmsu Apr 7, 2022
0e57cdd
support for BigInteger <-> PyInt (#1710)
lostmsu Apr 8, 2022
58bd58c
Ensure that shutdown is called from Python
lostmsu Apr 8, 2022
1cf616d
Merge pull request #1712 from losttech/bugs/ShutdownSegFault
filmor Apr 8, 2022
50da522
clear weakref list when reflected object is destroyed (#1758)
lostmsu Apr 9, 2022
86c6a7f
clear weak reference list when an extension type is destroyed (#1761)
lostmsu Apr 10, 2022
5af1961
fixed NativeTypeSpec on 32 bit platforms
lostmsu Apr 10, 2022
8503726
enable x86 testing on Windows in CI
lostmsu Apr 10, 2022
ab6d2c5
Merge pull request #1765 from losttech/bugs/32bit-1729
filmor Apr 11, 2022
80dc9f0
Implement IConvertible interface on PyObject
filmor Apr 10, 2022
090ff9f
Ensure that codec tests are run (#1763)
filmor Apr 25, 2022
7247da5
Fix decimal default parameters (#1773)
filmor Apr 26, 2022
bbfa252
workaround for potentially buggy threading in Mono (#1779)
lostmsu May 4, 2022
5eccd45
Use Py.GIL directly, now that it doesn't try to init anymore
filmor Mar 10, 2022
d2d3ba6
Modernise syntax a bit
filmor Mar 30, 2022
d899083
Fix Py.SetArgv for systems that don't support GetCommandLineArgs
filmor Mar 30, 2022
aa5b54b
Modernise syntax in ClassDerived
filmor Mar 30, 2022
37f1235
Merge pull request #1760 from filmor/misc-fixes
filmor May 4, 2022
df3b569
Fix enum codec
filmor Nov 23, 2021
4f070f2
Add unit test for enum encoder
filmor May 4, 2022
7d6e27a
Allow conversion of UInt64 based enums
filmor May 4, 2022
ac75e0c
Merge pull request #1621 from pythonnet/fix-enum-codec
filmor May 4, 2022
a80c685
disallow runtime shutdown when the Python error indicator is set, as …
lostmsu May 4, 2022
2910800
type name generator ignored names of nested classes
lostmsu May 7, 2022
cf8823f
added regression test for "in Dictionary.Keys" check
lostmsu May 7, 2022
f48d7a9
ClassGeneric.GetClass now returns BorrowedReference to indicate that …
lostmsu May 7, 2022
537ddf4
allow casting objects to generic .NET interfaces without specifying g…
lostmsu May 7, 2022
d854332
a few collection mixins now properly handle private interface impleme…
lostmsu May 7, 2022
87d4db9
Merge pull request #1786 from losttech/bugs/KeyCollection
lostmsu May 20, 2022
e258cee
Drop Python 3.6 support (#1795)
filmor May 23, 2022
987b2ee
Move to modern setuptools with pyproject.toml (#1793)
filmor May 23, 2022
1492d7d
expose Min/MaxSupportedVersion and IsSupportedVersion on PythonEngine
lostmsu May 25, 2022
26d1039
Ensure that codecs are definitely clean in tests
filmor May 26, 2022
2e1652b
Ensure that the RawProxyEncoder is removed again
filmor May 26, 2022
3cb2529
Merge pull request #1799 from pythonnet/SupportedVersions
filmor May 26, 2022
c1dab27
Add explicit tests for vararg call (#1805)
filmor May 31, 2022
31b9c4e
Add necessary `Initialize()` call to the README
filmor May 31, 2022
5ee587d
Fix demo scripts
filmor May 29, 2022
a6e4353
Fix remaining issues with wordpad demo
filmor Jun 9, 2022
4d1e09a
fixed ForbidPythonThreadsAttribute being ignored in certain scenarios…
filmor Jun 13, 2022
43d1640
Add test for simple enum int conversion (#1811)
filmor Jun 13, 2022
f5de0bf
Drop vendored find_libpython
filmor Jun 14, 2022
7da7889
Allow configuring .NET runtimes via environment variables
filmor Jun 17, 2022
70e2e0a
Merge pull request #1817 from filmor/env-config
filmor Jun 24, 2022
a49f3a8
Take GIL when checking if error occurred on shutdown (#1836)
filmor Jun 27, 2022
28a78ed
Bump version to 3.0.0-rc1
filmor Jun 27, 2022
e84731f
implemented dynamic equality and inequality for PyObject instances
lostmsu Jun 30, 2022
2edd800
Fix broken prefix and debug leftover
filmor Jun 28, 2022
4b6ac12
Bump release candidate version
filmor Jul 5, 2022
2016371
Make MANIFEST.in more explicit
filmor Jul 6, 2022
d484797
Use informational version as clr's __version__ attribute
filmor Jul 8, 2022
25f21f9
Drop obsolete packages.config
filmor Jul 11, 2022
332f8e7
Fix (U)IntPtr construction (#1861)
filmor Jul 11, 2022
60a719c
Implement non-simple String constructors explicitly (#1862)
filmor Jul 11, 2022
b79ae2f
Fix missing docstring for types with custom constructors (#1865)
filmor Jul 11, 2022
863397a
Bump release candidate version
filmor Jul 11, 2022
59b1c51
Finalizer.Instance.Collect() and Runtime.TryCollectingGarbage(...) ar…
lostmsu Jul 14, 2022
469ec67
fixed leak in NewReference.Move
lostmsu Jul 14, 2022
9bb8fe6
Merge pull request #1873 from losttech/bugs/ctor-leak
filmor Jul 14, 2022
93631af
Bump release candidate version
filmor Jul 16, 2022
a5e9b55
Generate XML documentation on build and add to it NuGet package (#1878)
lostmsu Jul 16, 2022
c75ee46
Last line of defense, best effort serialization
BadSingleton Jun 23, 2022
b59e2bb
Add nested class support
BadSingleton Jun 30, 2022
1002105
fixup! Add nested class support
BadSingleton Jun 30, 2022
d2f1ab6
Workaround for mono attribute bug
BadSingleton Jul 6, 2022
1f9d221
fixup! Workaround for mono attribute bug
BadSingleton Jul 7, 2022
34b7445
got rid of a few deprecation warnings that pollute GitHub code review
lostmsu Jun 30, 2022
e5546cb
Ensure that version.txt is always read from repo root
filmor Jul 6, 2022
7ffad42
docs: Fix a few typos
timgates42 Jul 16, 2022
e09115f
Merge remote-tracking branch 'unity/unity-custom' into last-ditch-ser…
BadSingleton May 26, 2023
0cc7069
adjustment to make the tests pass
BadSingleton May 26, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ Check all those that are applicable and complete.

- [ ] Make sure to include one or more tests for your change
- [ ] If an enhancement PR, please create docs and at best an example
- [ ] Ensure you have signed the [.NET Foundation CLA](https://cla.dotnetfoundation.org/pythonnet/pythonnet)
- [ ] Add yourself to [`AUTHORS`](../blob/master/AUTHORS.md)
- [ ] Updated the [`CHANGELOG`](../blob/master/CHANGELOG.md)
56 changes: 56 additions & 0 deletions .github/workflows/ARM.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Main (ARM)

on:
push:
branches:
- master
pull_request:

jobs:
build-test-arm:
name: Build and Test ARM64
runs-on: [self-hosted, linux, ARM64]
timeout-minutes: 15

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

- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.x'

- name: Clean previous install
run: |
pip uninstall -y pythonnet

- name: Install dependencies
run: |
pip install --upgrade -r requirements.txt
pip install pytest numpy # for tests

- name: Build and Install
run: |
pip install -v .

- name: Set Python DLL path (non Windows)
run: |
echo PYTHONNET_PYDLL=$(python -m find_libpython) >> $GITHUB_ENV

- name: Embedding tests
run: dotnet test --logger "console;verbosity=detailed" src/embed_tests/

- name: Python Tests (Mono)
run: python -m pytest --runtime mono

- name: Python Tests (.NET Core)
run: python -m pytest --runtime coreclr

- name: Python tests run from .NET
run: dotnet test src/python_tests_runner/

#- name: Perf tests
# run: |
# pip install --force --no-deps --target src/perf_tests/baseline/ pythonnet==2.5.2
# dotnet test --configuration Release --logger "console;verbosity=detailed" src/perf_tests/
64 changes: 48 additions & 16 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
name: GitHub Actions
name: Main

on: [ pull_request, push ]
on:
push:
branches:
- master
pull_request:

jobs:
build-test:
name: Build and Test
runs-on: ${{ matrix.os }}-latest
timeout-minutes: 5
timeout-minutes: 15

strategy:
fail-fast: false
matrix:
os: [windows, ubuntu, macos]
python: [3.6, 3.7, 3.8, 3.9]
platform: [x64]
shutdown_mode: [Normal, Soft]

env:
PYTHONNET_SHUTDOWN_MODE: ${{ matrix.SHUTDOWN_MODE }}
python: ["3.7", "3.8", "3.9", "3.10"]
platform: [x64, x86]
exclude:
- os: ubuntu
platform: x86
- os: macos
platform: x86

steps:
- name: Set Environment on macOS
Expand All @@ -31,6 +36,8 @@ jobs:

- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.x'

- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v2
Expand All @@ -41,22 +48,47 @@ jobs:
- name: Install dependencies
run: |
pip install --upgrade -r requirements.txt
pip install numpy # for tests

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

- name: Python Tests
run: pytest
- name: Set Python DLL path (non Windows)
if: ${{ matrix.os != 'windows' }}
run: |
echo PYTHONNET_PYDLL=$(python -m find_libpython) >> $GITHUB_ENV

- name: Set Python DLL path (Windows)
if: ${{ matrix.os == 'windows' }}
run: |
Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append -InputObject "PYTHONNET_PYDLL=$(python -m find_libpython)"

- name: Embedding tests
run: dotnet test --runtime any-${{ matrix.platform }} src/embed_tests/
if: ${{ matrix.os != 'macos' }} # Not working right now, doesn't find libpython
run: dotnet test --runtime any-${{ matrix.platform }} --logger "console;verbosity=detailed" src/embed_tests/
env:
MONO_THREADS_SUSPEND: preemptive # https://github.com/mono/mono/issues/21466

- name: Python Tests (Mono)
if: ${{ matrix.os != 'windows' }}
run: pytest --runtime mono

# TODO: Run these tests on Windows x86
- name: Python Tests (.NET Core)
if: ${{ matrix.platform == 'x64' }}
run: pytest --runtime coreclr

- name: Python Tests (.NET Framework)
if: ${{ matrix.os == 'windows' }}
run: pytest --runtime netfx

- name: Python tests run from .NET
run: dotnet test --runtime any-${{ matrix.platform }} src/python_tests_runner/
if: ${{ matrix.os == 'windows' }} # Not working for others right now

# TODO: Run perf tests
- name: Perf tests
if: ${{ (matrix.python == '3.8') && (matrix.platform == 'x64') }}
run: |
pip install --force --no-deps --target src/perf_tests/baseline/ pythonnet==2.5.2
dotnet test --configuration Release --runtime any-${{ matrix.platform }} --logger "console;verbosity=detailed" src/perf_tests/

# TODO: Run mono tests on Windows?
63 changes: 63 additions & 0 deletions .github/workflows/nuget-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: NuGet Preview Release

on:
schedule:
- cron: "5 4 3 */1 *" # once a month, at 4:05 on 3rd
workflow_dispatch:

jobs:
release:
name: Release Preview
runs-on: ubuntu-latest
environment: NuGet
timeout-minutes: 10

env:
PYTHONNET_SHUTDOWN_MODE: Normal

steps:
- name: Get Date
run: |
echo "DATE_VER=$(date "+%Y-%m-%d")" >> $GITHUB_ENV

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

- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.x'

- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
architecture: x64

- name: Install dependencies
run: |
pip install --upgrade -r requirements.txt
pip install numpy # for tests

- name: Build and Install
run: |
pip install -v .

- name: Set Python DLL path (non Windows)
if: ${{ matrix.os != 'windows' }}
run: |
echo PYTHONNET_PYDLL=$(python -m find_libpython) >> $GITHUB_ENV

- name: Python Tests
run: pytest

- name: Embedding tests
run: dotnet test --runtime any-ubuntu src/embed_tests/

- name: Pack
run: dotnet pack --configuration Release --version-suffix preview${{env.DATE_VER}} --output "Release-Preview"

- name: Publish NuGet
run: |
dotnet nuget push --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_MONTHLY }} Release-Preview/*.nupkg
dotnet nuget push --skip-duplicate --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_MONTHLY }} Release-Preview/*.snupkg
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
/src/runtime/interopNative.cs

# Configuration data
configured.props
/src/perf_tests/baseline/

# General binaries and Build results
*.dll
Expand Down
2 changes: 2 additions & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
- Meinrad Recheis ([@henon](https://github.com/henon))
- Mohamed Koubaa ([@koubaa](https://github.com/koubaa))
- Patrick Stewart ([@patstew](https://github.com/patstew))
- Peter Kese ([@pkese](https://github.com/pkese))
- Raphael Nestler ([@rnestler](https://github.com/rnestler))
- Rickard Holmberg ([@rickardraysearch](https://github.com/rickardraysearch))
- Sam Winstanley ([@swinstanley](https://github.com/swinstanley))
Expand Down Expand Up @@ -83,3 +84,4 @@
- ([@DanBarzilian](https://github.com/DanBarzilian))
- ([@alxnull](https://github.com/alxnull))
- ([@gpetrou](https://github.com/gpetrou))
- Ehsan Iran-Nejad ([@eirannejad](https://github.com/eirannejad))
112 changes: 96 additions & 16 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,47 +12,124 @@ This document follows the conventions laid out in [Keep a CHANGELOG][].
- Ability to instantiate new .NET arrays using `Array[T](dim1, dim2, ...)` syntax
- Python operator method will call C# operator method for supported binary and unary operators ([#1324][p1324]).
- Add GetPythonThreadID and Interrupt methods in PythonEngine
- Ability to implement delegates with `ref` and `out` parameters in Python, by returning the modified parameter values in a tuple. ([#1355][i1355])
- Ability to override .NET methods that have `out` or `ref` in Python by returning the modified parameter values in a tuple. ([#1481][i1481])
- `PyType` - a wrapper for Python type objects, that also permits creating new heap types from `TypeSpec`
- Improved exception handling:
* exceptions can now be converted with codecs
* `InnerException` and `__cause__` are propagated properly
- `__name__` and `__signature__` to reflected .NET methods
- .NET collection types now implement standard Python collection interfaces from `collections.abc`.
See [Mixins/collections.py](src/runtime/Mixins/collections.py).
- you can cast objects to generic .NET interfaces without specifying generic arguments as long as there is no ambiguity.
- .NET arrays implement Python buffer protocol
- Python integer interoperability with `System.Numerics.BigInteger`
- Python.NET will correctly resolve .NET methods, that accept `PyList`, `PyInt`,
and other `PyObject` derived types when called from Python.
- .NET classes, that have `__call__` method are callable from Python
- `PyIterable` type, that wraps any iterable object in Python
- `PythonEngine` properties for supported Python versions: `MinSupportedVersion`, `MaxSupportedVersion`, and `IsSupportedVersion`
- The runtime that is loaded on `import clr` can now be configured via environment variables


### Changed
- Drop support for Python 2, 3.4, and 3.5
- Drop support for Python 2, 3.4, 3.5, and 3.6
- `wchar_t` size aka `Runtime.UCS` is now determined at runtime
- `clr.AddReference` may now throw errors besides `FileNotFoundException`, that provide more
details about the cause of the failure
- `clr.AddReference` no longer adds ".dll" implicitly
- `PyIter(PyObject)` constructor replaced with static `PyIter.GetIter(PyObject)` method
- Python runtime can no longer be shut down if the Python error indicator is set, as it would have unpredictable behavior
- BREAKING: Return values from .NET methods that return an interface are now automatically
wrapped in that interface. This is a breaking change for users that rely on being
able to access members that are part of the implementation class, but not the
interface. Use the new __implementation__ or __raw_implementation__ properties to
interface. Use the new `__implementation__` or `__raw_implementation__` properties to
if you need to "downcast" to the implementation class.
- BREAKING: `==` and `!=` operators on `PyObject` instances now use Python comparison
(previously was equivalent to `object.ReferenceEquals(,)`)
- BREAKING: Parameters marked with `ParameterAttributes.Out` are no longer returned in addition
to the regular method return value (unless they are passed with `ref` or `out` keyword).
- BREAKING: Drop support for the long-deprecated CLR.* prefix.
- `PyObject` now implements `IEnumerable<PyObject>` in addition to `IEnumerable`
- floating point values passed from Python are no longer silently truncated
when .NET expects an integer [#1342][i1342]
- More specific error messages for method argument mismatch
- members of `PyObject` inherited from `System.Object and `DynamicObject` now autoacquire GIL
- BREAKING: when inheriting from .NET types in Python if you override `__init__` you
must explicitly call base constructor using `super().__init__(.....)`. Not doing so will lead
to undefined behavior.
- BREAKING: most `PyScope` methods will never return `null`. Instead, `PyObject` `None` will be returned.
- BREAKING: `PyScope` was renamed to `PyModule`
- BREAKING: Methods with `ref` or `out` parameters and void return type return a tuple of only the `ref` and `out` parameters.
- BREAKING: to call Python from .NET `Runtime.PythonDLL` property must be set to Python DLL name
or the DLL must be loaded in advance. This must be done before calling any other Python.NET functions.
- BREAKING: `PyObject.Length()` now raises a `PythonException` when object does not support a concept of length.
- BREAKING: disabled implicit conversion from C# enums to Python `int` and back.
One must now either use enum members (e.g. `MyEnum.Option`), or use enum constructor
(e.g. `MyEnum(42)` or `MyEnum(42, True)` when `MyEnum` does not have a member with value 42).
- Sign Runtime DLL with a strong name
- Implement loading through `clr_loader` instead of the included `ClrModule`, enables
support for .NET Core
- BREAKING: .NET and Python exceptions are preserved when crossing Python/.NET boundary
- BREAKING: custom encoders are no longer called for instances of `System.Type`
- `PythonException.Restore` no longer clears `PythonException` instance.
- Replaced the old `__import__` hook hack with a PEP302-style Meta Path Loader
- BREAKING: Names of .NET types (e.g. `str(__class__)`) changed to better support generic types
- BREAKING: overload resolution will no longer prefer basic types. Instead, first matching overload will
be chosen.
- BREAKING: acquiring GIL using `Py.GIL` no longer forces `PythonEngine` to initialize
- BREAKING: `Exec` and `Eval` from `PythonEngine` no longer accept raw pointers.
- BREAKING: .NET collections and arrays are no longer automatically converted to
Python collections. Instead, they implement standard Python
collection interfaces from `collections.abc`.
See [Mixins/collections.py](src/runtime/Mixins/collections.py).
- BREAKING: When trying to convert Python `int` to `System.Object`, result will
be of type `PyInt` instead of `System.Int32` due to possible loss of information.
Python `float` will continue to be converted to `System.Double`.
- BREAKING: Python.NET will no longer implicitly convert types like `numpy.float64`, that implement `__float__` to
`System.Single` and `System.Double`. An explicit conversion is required on Python or .NET side.
- BREAKING: `PyObject.GetHashCode` can fail.
- BREAKING: Python.NET will no longer implicitly convert any Python object to `System.Boolean`.
- BREAKING: `PyObject.GetAttr(name, default)` now only ignores `AttributeError` (previously ignored all exceptions).
- BREAKING: `PyObject` no longer implements `IEnumerable<PyObject>`.
Instead, `PyIterable` does that.
- BREAKING: `IPyObjectDecoder.CanDecode` `objectType` parameter type changed from `PyObject` to `PyType`

### Fixed

- Fix incorrect dereference of wrapper object in `tp_repr`, which may result in a program crash
- Fix incorrect dereference in params array handling
- Fixes issue with function resolution when calling overloaded function with keyword arguments from python ([#1097][i1097])
- Fix `object[]` parameters taking precedence when should not in overload resolution
- Fixed a bug where all .NET class instances were considered Iterable
- Fix incorrect choice of method to invoke when using keyword arguments.
- Fix non-delegate types incorrectly appearing as callable.
- Indexers can now be used with interface objects
- Fixed a bug where indexers could not be used if they were inherited
- Made it possible to use `__len__` also on `ICollection<>` interface objects
- Fixed issue when calling PythonException.Format where another exception would be raise for unnormalized exceptions
- Made it possible to call `ToString`, `GetHashCode`, and `GetType` on inteface objects
- Fixed objects returned by enumerating `PyObject` being disposed too soon
- Incorrectly using a non-generic type with type parameters now produces a helpful Python error instead of throwing NullReferenceException
- Fix incorrect dereference of wrapper object in `tp_repr`, which may result in a program crash
- Fixed parameterless .NET constructor being silently called when a matching constructor overload is not found ([#238][i238])
- Fix incorrect dereference in params array handling
- Fixes issue with function resolution when calling overloaded function with keyword arguments from python ([#1097][i1097])
- Fix `object[]` parameters taking precedence when should not in overload resolution
- Fixed a bug where all .NET class instances were considered Iterable
- Fix incorrect choice of method to invoke when using keyword arguments.
- Fix non-delegate types incorrectly appearing as callable.
- Indexers can now be used with interface objects
- Fixed a bug where indexers could not be used if they were inherited
- Made it possible to use `__len__` also on `ICollection<>` interface objects
- Fixed issue when calling PythonException.Format where another exception would be raise for unnormalized exceptions
- Made it possible to call `ToString`, `GetHashCode`, and `GetType` on inteface objects
- Fixed objects returned by enumerating `PyObject` being disposed too soon
- Incorrectly using a non-generic type with type parameters now produces a helpful Python error instead of throwing NullReferenceException
- `import` may now raise errors with more detail than "No module named X"
- Exception stacktraces on `PythonException.StackTrace` are now properly formatted
- Providing an invalid type parameter to a generic type or method produces a helpful Python error
- Empty parameter names (as can be generated from F#) do not cause crashes
- Unicode strings with surrogates were truncated when converting from Python
- `Reload` mode now supports generic methods (previously Python would stop seeing them after reload)
- Temporarily fixed issue resolving method overload when method signature has `out` parameters ([#1672](i1672))
- Decimal default parameters are now correctly taken into account

### Removed

- `ShutdownMode` has been removed. The only shutdown mode supported now is an equivalent of `ShutdownMode.Reload`.
There is no need to specify it.
- implicit assembly loading (you have to explicitly `clr.AddReference` before doing import)
- messages in `PythonException` no longer start with exception type
- `PyScopeManager`, `PyScopeException`, `PyScope` (use `PyModule` instead)
- support for .NET Framework 4.0-4.6; Mono before 5.4. Python.NET now requires .NET Standard 2.0
(see [the matrix](https://docs.microsoft.com/en-us/dotnet/standard/net-standard#net-implementation-support))

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

Expand Down Expand Up @@ -813,3 +890,6 @@ This version improves performance on benchmarks significantly compared to 2.3.
[p534]: https://github.com/pythonnet/pythonnet/pull/534
[i449]: https://github.com/pythonnet/pythonnet/issues/449
[i1342]: https://github.com/pythonnet/pythonnet/issues/1342
[i238]: https://github.com/pythonnet/pythonnet/issues/238
[i1481]: https://github.com/pythonnet/pythonnet/issues/1481
[i1672]: https://github.com/pythonnet/pythonnet/pull/1672
Loading