Граф коммитов

1907 Коммитов

Автор SHA1 Сообщение Дата
Victor Nova 58df35bdeb include README.md into NuGet package
as suggested in https://devblogs.microsoft.com/nuget/add-a-readme-to-your-nuget-package/

implements https://github.com/pythonnet/pythonnet/issues/1598
2021-10-16 16:48:59 -07:00
Victor Nova 3f335db25d fixed recursive dependency in clr module initialization when there's a public class that implements IEnumerable in global namespace
https://github.com/pythonnet/pythonnet/issues/1601

the fix is to delay updating clr module dict with contents of .NET namespaces until after our internal modules are loaded
2021-10-16 16:44:50 -07:00
Victor bc3265d1d3
make .NET objects that have __call__ method callable from Python (#1589)
Implemented by adding tp_call to ClassBase, that uses reflection to find __call__ methods in .NET

fixes https://github.com/pythonnet/pythonnet/issues/890

this is an amalgamation of d46878c7,  5bb10073, and 960457f5 from https://github.com/losttech/pythonnet
2021-10-14 19:49:04 +02:00
Benedikt Reinartz f591024d1e Drop Appveyor CI 2021-10-14 10:28:22 -07:00
Benedikt Reinartz edc471e13b Update CI configuration for Python 3.10
Also increase CI timeout for now as some dependencies have no wheels
available, yet, and are thus compiled during CI.
2021-10-14 10:28:22 -07:00
Benedikt Reinartz 4825462d46 Add Python 3.10 support
- Add Python 3.10 typeoffsets
- Replace call to (removed) `PyUnicode_GetMax` by platform detection, as
  AFAIK only Windows uses 16bit wchar_t
2021-10-14 10:28:22 -07:00
Benedikt Reinartz dea6bcbff2 Fix runtime loading error message 2021-10-14 10:28:22 -07:00
Félix Bourbonnais 2742815003
Remove a deprecated attribute in PropertyObject (#1595) 2021-10-12 18:12:25 +02:00
Victor Nova 71f6ed9617 added a regression test for https://github.com/pythonnet/pythonnet/issues/451 2021-10-06 20:34:37 -07:00
Victor Nova c9626dfd0e disabled using __float__ during implicit conversions to .NET floating point types
arbitrary Python objects are no longer implicitly converted to .NET bool type

this is a continuation of https://github.com/pythonnet/pythonnet/pull/1568
2021-10-05 09:25:47 -07:00
Victor Nova 8d93c39d0f Changed signature of IPyObjectDecoder.CanDecode
first parameter (objectType) type changed from PyObject to PyType
2021-10-02 06:52:35 -07:00
Victor Nova 79e34bcdc2 PyObject.GetPythonType returns PyType 2021-10-01 23:40:51 -07:00
Victor Nova d48f512aad fixed: TupleCodec not respecting element type 2021-10-01 21:31:59 -07:00
Victor Nova dee41b8eb7 newer .NET SDK might push symbols package along with the main package, so when pushing symbols package, allow conflicts 2021-10-01 17:24:23 -07:00
Victor Nova bcbed525d4 embedded the icon into NuGet package 2021-10-01 17:22:38 -07:00
Victor Nova c1653f51d5 allow user-created instances of PySequence and PyIterable 2021-10-01 17:12:40 -07:00
Victor Nova 0355ebc070 expose PyType.Get 2021-10-01 16:56:24 -07:00
Victor Nova 9b7dbae876 fixed nullability annotation on ConverterExtension.ToPython 2021-10-01 16:36:58 -07:00
Victor Nova 5d0d01abe6 safer GetAttr(name, default)
fixes https://github.com/pythonnet/pythonnet/issues/1036
2021-10-01 13:07:32 -07:00
Victor Nova f857d59e66 When reflecting nested types, ensure their corresponding PyType is allocated.
fixes https://github.com/pythonnet/pythonnet/issues/1414

Without this fix attempting to use a nested .NET class that derives from its parent would cause a crash due to false mutual dependency.
2021-10-01 13:06:47 -07:00
Victor Milovanov 748d3d79b8 implemented __signature__ and __name__ on methodbinding 2021-09-30 19:34:07 -07:00
Victor Nova 66716db6ae PyScope/PyModule cleanup
removed PyScopeManager
merged PyScope into PyModule
minor behavioral changes
2021-09-30 12:33:54 -07:00
Victor Nova 8846fd2f12 cleaning up public API 2021-09-30 11:43:49 -07:00
Victor Nova 23ec9d2549 raise BadPythonDllException (internal, derived from MissingMethodException) instead of confusing TypeLoadException when PythonDLL was not configured properly 2021-09-28 23:01:13 -07:00
Victor Nova fc989d5bb3 fixed FileLoadException when trying to do clr.AddReference('/full/lib/path.dll')
Before trying to load an assembly by its full path we were trying to call `Assembly.Load` on it. `Assembly.Load` interprets its argument as a valid `AssemblyName`. However full paths are not valid assembly names, so that call would throw `FileLoadException`, which we did not handle.

reported in 9d5f57973b (commitcomment-57061082)

Related: https://github.com/pythonnet/pythonnet/issues/1514
2021-09-27 17:10:03 -07:00
Victor Nova 497c22a38b fixup! Disable implicit conversions, that might lose information:
fixes for https://github.com/pythonnet/pythonnet/pull/1568
2021-09-27 16:18:28 -07:00
Victor Nova 1ca0bdb727 fixed conversion tests to match new behavior 2021-09-27 14:52:40 -07:00
Victor Nova b13bafdf37 Introduced PyIterable, PyObject no longer implements IEnumerable<PyObject> 2021-09-27 14:52:40 -07:00
Victor Nova 5370dc8486 Disable implicit conversions, that might lose information:
PyInt -> int32
.NET arrays and collections -> Python list (due to mutability)
2021-09-27 14:52:40 -07:00
Victor Nova 9c4a829ca2 fixed ImportHook not seeing namespaces in assemblies loaded via direct call to Assembly.Load* methods 2021-09-23 23:00:25 -07:00
Victor Nova 9d5f57973b simplify assembly ResolveHandler, and use official assembly name parsing method 2021-09-23 23:00:25 -07:00
Victor Nova 3808c3d2e7 fixed __cause__ on constructor overload bind failure 2021-09-23 13:40:16 -07:00
Victor Nova 0a89e6f1f4 remove risky finalization code from Dispatcher, and use reference types 2021-09-22 21:40:43 -07:00
Victor Nova f64194cab4 made InterruptTest more robust 2021-09-22 21:39:49 -07:00
Victor Milovanov 3e1fc5b3ee allow Python to overwrite .NET methods 2021-09-22 20:17:42 -07:00
Victor 12defa7b59
Merge pull request #1543 from losttech/standard-mixins
Mixins for standard .NET collections that implement `collections.abc` interfaces
2021-09-22 19:58:27 -07:00
Victor Nova 6ae373c23d merge latest master 2021-09-22 19:39:24 -07:00
Victor Nova 2b0e322bf3 Do not clean tpHandle in ClassBase.tp_clear - it might be used in tp_dealloc
fixes https://github.com/pythonnet/pythonnet/pull/1566
2021-09-22 19:35:43 -07:00
Victor Nova 4ff080e0c0 added regression test for https://github.com/pythonnet/pythonnet/issues/1565 (unable to gc collect an instance of python derived type) 2021-09-22 19:35:43 -07:00
Victor Nova 70b684a4e8 added a few debug guards 2021-09-22 19:35:43 -07:00
Victor Milovanov 832126c5ae enabled decoding instanceless exceptions
Added new class clr.interop.PyErr with optional type, value, and traceback attributes. User can register decoders for it, that would let them decode instanceless (and even typeless) Python exceptions.

These decoders will be invoked before the regular exception instance decoders.
2021-09-22 14:04:57 -07:00
Victor Nova 197689e07e added a workaround for tp_clear implementations, that do not check, that they are not the first in tp_clear's MRO
https://bugs.python.org/issue45266
2021-09-22 12:36:00 -07:00
Victor Nova 85adb1b0df ensure all unit tests have similar SetUp and TearDown procedures when a running PythonEngine is needed 2021-09-22 12:23:28 -07:00
Victor Milovanov 6b20409df7 refactored LoadExtraModules for Mixins into LoadSubmodule + LoadMixins 2021-09-22 10:47:47 -07:00
Victor Nova a38849ea9f mentioned collection mixins in changelog 2021-09-22 10:47:47 -07:00
Victor Nova b77b7ceb74 added a few tests for collection mixins 2021-09-22 10:47:47 -07:00
Victor Milovanov 38ac73b9e8 fixed mixin calls to TryGetValue 2021-09-22 10:47:47 -07:00
Victor Milovanov 85897e340c fixed implementation of mixins for Mapping and MutableMapping (still untested) 2021-09-22 10:47:47 -07:00
Victor Milovanov cd044c8a09 fixed MappingMixin implementation (untested) 2021-09-22 10:47:47 -07:00
Victor Milovanov 5cb300a7a8 added a few mixins to reflected .NET collection types, that implement corresponding pythonic interfaces 2021-09-22 10:47:47 -07:00