pythonnet 3.0.4__tar.gz → 3.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (217) hide show
  1. {pythonnet-3.0.4 → pythonnet-3.1.0}/AUTHORS.md +3 -1
  2. {pythonnet-3.0.4 → pythonnet-3.1.0}/Directory.Build.props +12 -6
  3. {pythonnet-3.0.4 → pythonnet-3.1.0}/MANIFEST.in +1 -0
  4. {pythonnet-3.0.4 → pythonnet-3.1.0}/PKG-INFO +8 -9
  5. {pythonnet-3.0.4 → pythonnet-3.1.0}/pyproject.toml +24 -8
  6. pythonnet-3.1.0/pythonnet/_pyinstaller/__init__.py +4 -0
  7. pythonnet-3.1.0/pythonnet/_pyinstaller/hook-clr.py +9 -0
  8. {pythonnet-3.0.4 → pythonnet-3.1.0}/pythonnet.egg-info/PKG-INFO +8 -9
  9. {pythonnet-3.0.4 → pythonnet-3.1.0}/pythonnet.egg-info/SOURCES.txt +13 -3
  10. pythonnet-3.1.0/pythonnet.egg-info/entry_points.txt +2 -0
  11. pythonnet-3.1.0/pythonnet.egg-info/requires.txt +1 -0
  12. {pythonnet-3.0.4 → pythonnet-3.1.0}/pythonnet.sln +1 -4
  13. {pythonnet-3.0.4 → pythonnet-3.1.0}/setup.py +41 -13
  14. pythonnet-3.1.0/src/compat/Python.Runtime.Compat.csproj +13 -0
  15. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/AssemblyManager.cs +5 -0
  16. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/ClassManager.cs +17 -0
  17. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Codecs/IterableDecoder.cs +55 -55
  18. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Codecs/ListDecoder.cs +50 -50
  19. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Codecs/SequenceDecoder.cs +48 -48
  20. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/CollectionWrappers/ListWrapper.cs +3 -0
  21. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/CollectionWrappers/SequenceWrapper.cs +16 -7
  22. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/InteropConfiguration.cs +1 -0
  23. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Loader.cs +23 -0
  24. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/MethodBinder.cs +5 -0
  25. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Mixins/CollectionMixinsProvider.cs +6 -0
  26. pythonnet-3.1.0/src/runtime/Mixins/DynamicObjectMixinsProvider.cs +47 -0
  27. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Mixins/collections.py +16 -0
  28. pythonnet-3.1.0/src/runtime/Mixins/dlr.py +18 -0
  29. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Native/CustomMarshaler.cs +4 -21
  30. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Native/PyIdentifier_.cs +3 -3
  31. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Native/PyIdentifier_.tt +1 -1
  32. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Native/TypeOffset.cs +15 -0
  33. pythonnet-3.1.0/src/runtime/Native/TypeOffset313.cs +152 -0
  34. pythonnet-3.1.0/src/runtime/Native/TypeOffset314.cs +153 -0
  35. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Python.Runtime.csproj +3 -6
  36. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/PythonEngine.cs +8 -8
  37. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/PythonTypes/PyFloat.cs +2 -0
  38. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/PythonTypes/PyInt.cs +2 -0
  39. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/PythonTypes/PyObject.cs +6 -0
  40. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/PythonTypes/PyType.cs +6 -0
  41. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Runtime.Delegates.cs +14 -5
  42. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Runtime.cs +21 -40
  43. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/StateSerialization/RuntimeData.cs +3 -1
  44. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/TypeManager.cs +197 -0
  45. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Types/ArrayObject.cs +6 -0
  46. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Types/ClassBase.cs +51 -12
  47. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Types/ClassDerived.cs +37 -0
  48. pythonnet-3.1.0/src/runtime/Types/DynamicObjectMemberAccessor.cs +203 -0
  49. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Types/ExtensionType.cs +10 -0
  50. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Types/Indexer.cs +2 -2
  51. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Types/ManagedTypes.cd +1 -1
  52. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Types/MetaType.cs +43 -1
  53. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Types/MethodBinding.cs +12 -8
  54. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Types/MethodObject.cs +1 -1
  55. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Types/ModuleObject.cs +14 -12
  56. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Types/OverloadMapper.cs +12 -3
  57. pythonnet-3.1.0/src/runtime/Util/ConcurrentLruCache.cs +103 -0
  58. pythonnet-3.1.0/src/runtime/Util/PythonEnvironment.cs +188 -0
  59. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Util/ReflectionPolyfills.cs +1 -1
  60. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Util/ReflectionUtil.cs +7 -0
  61. {pythonnet-3.0.4 → pythonnet-3.1.0}/tests/test_array.py +3 -4
  62. pythonnet-3.1.0/tests/test_disposable.py +111 -0
  63. pythonnet-3.1.0/tests/test_dynamic.py +218 -0
  64. {pythonnet-3.0.4 → pythonnet-3.1.0}/tests/test_field.py +0 -1
  65. {pythonnet-3.0.4 → pythonnet-3.1.0}/tests/test_import.py +5 -0
  66. {pythonnet-3.0.4 → pythonnet-3.1.0}/tests/test_indexer.py +36 -0
  67. {pythonnet-3.0.4 → pythonnet-3.1.0}/tests/test_method.py +129 -100
  68. {pythonnet-3.0.4 → pythonnet-3.1.0}/tests/test_mp_length.py +63 -63
  69. pythonnet-3.1.0/version.txt +1 -0
  70. pythonnet-3.0.4/pythonnet.egg-info/requires.txt +0 -1
  71. pythonnet-3.0.4/src/runtime/Native/TypeOffset37.cs +0 -136
  72. pythonnet-3.0.4/src/runtime/Native/TypeOffset38.cs +0 -138
  73. pythonnet-3.0.4/src/runtime/Native/TypeOffset39.cs +0 -138
  74. pythonnet-3.0.4/version.txt +0 -1
  75. {pythonnet-3.0.4 → pythonnet-3.1.0}/LICENSE +0 -0
  76. {pythonnet-3.0.4 → pythonnet-3.1.0}/README.rst +0 -0
  77. {pythonnet-3.0.4 → pythonnet-3.1.0}/clr.py +0 -0
  78. {pythonnet-3.0.4 → pythonnet-3.1.0}/pythonnet/__init__.py +0 -0
  79. {pythonnet-3.0.4 → pythonnet-3.1.0}/pythonnet.egg-info/dependency_links.txt +0 -0
  80. {pythonnet-3.0.4 → pythonnet-3.1.0}/pythonnet.egg-info/not-zip-safe +0 -0
  81. {pythonnet-3.0.4 → pythonnet-3.1.0}/pythonnet.egg-info/top_level.txt +0 -0
  82. {pythonnet-3.0.4 → pythonnet-3.1.0}/setup.cfg +0 -0
  83. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/pythonnet.snk +0 -0
  84. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Codecs/DecoderGroup.cs +0 -0
  85. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Codecs/EncoderGroup.cs +0 -0
  86. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Codecs/EnumPyIntCodec.cs +0 -0
  87. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Codecs/IPyObjectDecoder.cs +0 -0
  88. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Codecs/IPyObjectEncoder.cs +0 -0
  89. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Codecs/PyObjectConversions.cs +0 -0
  90. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Codecs/RawProxyEncoder.cs +0 -0
  91. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Codecs/TupleCodecs.cs +0 -0
  92. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/CollectionWrappers/IterableWrapper.cs +0 -0
  93. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Converter.cs +0 -0
  94. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/DefaultBaseTypeProvider.cs +0 -0
  95. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/DelegateManager.cs +0 -0
  96. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Exceptions.cs +0 -0
  97. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Finalizer.cs +0 -0
  98. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/IPythonBaseTypeProvider.cs +0 -0
  99. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/ImportHook.cs +0 -0
  100. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Interfaces.cs +0 -0
  101. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/InternString.cs +0 -0
  102. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/InternalPythonnetException.cs +0 -0
  103. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Interop.cs +0 -0
  104. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Native/ABI.cs +0 -0
  105. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Native/BorrowedReference.cs +0 -0
  106. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Native/GeneratedTypeOffsets.cs +0 -0
  107. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Native/ITypeOffsets.cs +0 -0
  108. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Native/LibDL.cs +0 -0
  109. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Native/LibraryLoader.cs +0 -0
  110. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Native/NativeCall.cs +0 -0
  111. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Native/NativeFunc.cs +0 -0
  112. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Native/NativeTypeSpec.cs +0 -0
  113. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Native/NewReference.cs +0 -0
  114. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Native/PyBufferInterface.cs +0 -0
  115. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Native/PyCompilerFlags.cs +0 -0
  116. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Native/PyGILState.cs +0 -0
  117. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Native/PyInterpreterState.cs +0 -0
  118. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Native/PyMemberFlags.cs +0 -0
  119. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Native/PyMemberType.cs +0 -0
  120. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Native/PyMethodFlags.cs +0 -0
  121. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Native/PyThreadState.cs +0 -0
  122. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Native/ReferenceExtensions.cs +0 -0
  123. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Native/StolenReference.cs +0 -0
  124. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Native/StrPtr.cs +0 -0
  125. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Native/TypeOffset310.cs +0 -0
  126. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Native/TypeOffset311.cs +0 -0
  127. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Native/TypeOffset312.cs +0 -0
  128. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Properties/AssemblyInfo.cs +0 -0
  129. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Py.cs +0 -0
  130. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/PyExportAttribute.cs +0 -0
  131. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/PythonBaseTypeProviderGroup.cs +0 -0
  132. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/PythonException.cs +0 -0
  133. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/PythonTypes/PyBuffer.cs +0 -0
  134. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/PythonTypes/PyDict.cs +0 -0
  135. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/PythonTypes/PyFloat.IComparable.cs +0 -0
  136. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/PythonTypes/PyInt.IComparable.cs +0 -0
  137. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/PythonTypes/PyIter.cs +0 -0
  138. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/PythonTypes/PyIterable.cs +0 -0
  139. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/PythonTypes/PyList.cs +0 -0
  140. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/PythonTypes/PyModule.cs +0 -0
  141. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/PythonTypes/PyNumber.cs +0 -0
  142. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/PythonTypes/PyObject.IConvertible.cs +0 -0
  143. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/PythonTypes/PySequence.cs +0 -0
  144. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/PythonTypes/PyString.cs +0 -0
  145. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/PythonTypes/PyTuple.cs +0 -0
  146. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/PythonTypes/TypeSpec.cs +0 -0
  147. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/README.md +0 -0
  148. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Resources/clr.py +0 -0
  149. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Resources/interop.py +0 -0
  150. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/RuntimeState.cs +0 -0
  151. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/StateSerialization/CLRMappedItem.cs +0 -0
  152. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/StateSerialization/CLRWrapperCollection.cs +0 -0
  153. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/StateSerialization/ClassManagerState.cs +0 -0
  154. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/StateSerialization/ICLRObjectStorer.cs +0 -0
  155. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/StateSerialization/ImportHookState.cs +0 -0
  156. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/StateSerialization/MaybeMemberInfo.cs +0 -0
  157. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/StateSerialization/MaybeMethodBase.cs +0 -0
  158. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/StateSerialization/MaybeType.cs +0 -0
  159. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/StateSerialization/MetatypeState.cs +0 -0
  160. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/StateSerialization/NoopFormatter.cs +0 -0
  161. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/StateSerialization/PythonNetState.cs +0 -0
  162. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/StateSerialization/SharedObjectsState.cs +0 -0
  163. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/StateSerialization/TypeManagerState.cs +0 -0
  164. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/StateSerialization/UnloadedClass.cs +0 -0
  165. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Types/ClassObject.cs +0 -0
  166. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Types/ClrModule.cs +0 -0
  167. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Types/ClrObject.cs +0 -0
  168. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Types/DelegateObject.cs +0 -0
  169. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Types/EventBinding.cs +0 -0
  170. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Types/EventObject.cs +0 -0
  171. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Types/ExceptionClassObject.cs +0 -0
  172. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Types/FieldObject.cs +0 -0
  173. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Types/GenericType.cs +0 -0
  174. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Types/InterfaceObject.cs +0 -0
  175. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Types/Iterator.cs +0 -0
  176. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Types/ManagedType.cs +0 -0
  177. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Types/ModuleFunctionObject.cs +0 -0
  178. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Types/ModulePropertyObject.cs +0 -0
  179. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Types/MpLengthSlot.cs +0 -0
  180. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Types/OperatorMethod.cs +0 -0
  181. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Types/PropertyObject.cs +0 -0
  182. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Types/ReflectedClrType.cs +0 -0
  183. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Types/UnsafeReferenceWithRun.cs +0 -0
  184. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Util/CodeGenerator.cs +0 -0
  185. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Util/DebugUtil.cs +0 -0
  186. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Util/Encodings.cs +0 -0
  187. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Util/EventHandlerCollection.cs +0 -0
  188. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Util/GenericUtil.cs +0 -0
  189. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Util/InitOnly.cs +0 -0
  190. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Util/NonCopyableAttribute.cs +0 -0
  191. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Util/NullOnly.cs +0 -0
  192. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Util/OpsHelper.cs +0 -0
  193. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Util/ParameterHelper.cs +0 -0
  194. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Util/PythonReferenceComparer.cs +0 -0
  195. {pythonnet-3.0.4 → pythonnet-3.1.0}/src/runtime/Util/Util.cs +0 -0
  196. {pythonnet-3.0.4 → pythonnet-3.1.0}/tests/test_callback.py +0 -0
  197. {pythonnet-3.0.4 → pythonnet-3.1.0}/tests/test_class.py +0 -0
  198. {pythonnet-3.0.4 → pythonnet-3.1.0}/tests/test_clrmethod.py +0 -0
  199. {pythonnet-3.0.4 → pythonnet-3.1.0}/tests/test_codec.py +0 -0
  200. {pythonnet-3.0.4 → pythonnet-3.1.0}/tests/test_collection_mixins.py +0 -0
  201. {pythonnet-3.0.4 → pythonnet-3.1.0}/tests/test_constructors.py +0 -0
  202. {pythonnet-3.0.4 → pythonnet-3.1.0}/tests/test_conversion.py +0 -0
  203. {pythonnet-3.0.4 → pythonnet-3.1.0}/tests/test_delegate.py +0 -0
  204. {pythonnet-3.0.4 → pythonnet-3.1.0}/tests/test_docstring.py +0 -0
  205. {pythonnet-3.0.4 → pythonnet-3.1.0}/tests/test_engine.py +0 -0
  206. {pythonnet-3.0.4 → pythonnet-3.1.0}/tests/test_enum.py +0 -0
  207. {pythonnet-3.0.4 → pythonnet-3.1.0}/tests/test_event.py +0 -0
  208. {pythonnet-3.0.4 → pythonnet-3.1.0}/tests/test_exceptions.py +0 -0
  209. {pythonnet-3.0.4 → pythonnet-3.1.0}/tests/test_generic.py +0 -0
  210. {pythonnet-3.0.4 → pythonnet-3.1.0}/tests/test_interface.py +0 -0
  211. {pythonnet-3.0.4 → pythonnet-3.1.0}/tests/test_module.py +0 -0
  212. {pythonnet-3.0.4 → pythonnet-3.1.0}/tests/test_property.py +0 -0
  213. {pythonnet-3.0.4 → pythonnet-3.1.0}/tests/test_recursive_types.py +0 -0
  214. {pythonnet-3.0.4 → pythonnet-3.1.0}/tests/test_repr.py +0 -0
  215. {pythonnet-3.0.4 → pythonnet-3.1.0}/tests/test_subclass.py +0 -0
  216. {pythonnet-3.0.4 → pythonnet-3.1.0}/tests/test_sysargv.py +0 -0
  217. {pythonnet-3.0.4 → pythonnet-3.1.0}/tests/test_thread.py +0 -0
@@ -9,7 +9,7 @@
9
9
  - Barton Cline ([@BartonCline](https://github.com/BartonCline))
10
10
  - Brian Lloyd ([@brianlloyd](https://github.com/brianlloyd))
11
11
  - David Anthoff ([@davidanthoff](https://github.com/davidanthoff))
12
- - Denis Akhiyarov ([@denfromufa](https://github.com/denfromufa))
12
+ - Denis Akhiyarov ([@den-run-ai](https://github.com/den-run-ai))
13
13
  - Tony Roberts ([@tonyroberts](https://github.com/tonyroberts))
14
14
  - Victor Uriarte ([@vmuriart](https://github.com/vmuriart))
15
15
 
@@ -59,6 +59,7 @@
59
59
  - Peter Kese ([@pkese](https://github.com/pkese))
60
60
  - Raphael Nestler ([@rnestler](https://github.com/rnestler))
61
61
  - Rickard Holmberg ([@rickardraysearch](https://github.com/rickardraysearch))
62
+ - Roberto Pastor Muela ([@RobPasMue](https://github.com/RobPasMue))
62
63
  - Sam Winstanley ([@swinstanley](https://github.com/swinstanley))
63
64
  - Sean Freitag ([@cowboygneox](https://github.com/cowboygneox))
64
65
  - Serge Weinstock ([@sweinst](https://github.com/sweinst))
@@ -88,3 +89,4 @@
88
89
  - Ehsan Iran-Nejad ([@eirannejad](https://github.com/eirannejad))
89
90
  - ([@legomanww](https://github.com/legomanww))
90
91
  - ([@gertdreyer](https://github.com/gertdreyer))
92
+ - Kerbiter ([@Metadorius](https://github.com/Metadorius))
@@ -1,24 +1,30 @@
1
1
  <?xml version="1.0"?>
2
2
  <Project>
3
3
  <PropertyGroup>
4
- <AssemblyCopyright>Copyright (c) 2006-2022 The Contributors of the Python.NET Project</AssemblyCopyright>
4
+ <AssemblyCopyright>Copyright (c) 2006-2025 The Contributors of the Python.NET Project</AssemblyCopyright>
5
5
  <AssemblyCompany>pythonnet</AssemblyCompany>
6
6
  <AssemblyProduct>Python.NET</AssemblyProduct>
7
- <LangVersion>10.0</LangVersion>
7
+ <LangVersion>14</LangVersion>
8
8
  <IsPackable>false</IsPackable>
9
+ <DeterministicSourcePaths>true</DeterministicSourcePaths>
9
10
  <FullVersion>$([System.IO.File]::ReadAllText("$(MSBuildThisFileDirectory)version.txt").Trim())</FullVersion>
10
11
  <VersionPrefix>$(FullVersion.Split('-', 2)[0])</VersionPrefix>
11
12
  <VersionSuffix Condition="$(FullVersion.Contains('-'))">$(FullVersion.Split('-', 2)[1])</VersionSuffix>
13
+ <RepositoryRoot>$(MSBuildThisFileDirectory)</RepositoryRoot>
14
+ </PropertyGroup>
15
+ <PropertyGroup Condition="'$(Configuration)'=='Release'">
16
+ <DebugSymbols>False</DebugSymbols>
17
+ <DebugType>None</DebugType>
12
18
  </PropertyGroup>
13
19
  <ItemGroup>
14
- <PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
15
- <PackageReference Include="Microsoft.Net.Compilers.Toolset" Version="4.0.1">
20
+ <PackageReference Include="Microsoft.CSharp" Version="4.*" />
21
+ <PackageReference Include="Microsoft.Net.Compilers.Toolset" Version="5.*">
16
22
  <PrivateAssets>all</PrivateAssets>
17
23
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
18
24
  </PackageReference>
19
- <PackageReference Include="NonCopyableAnalyzer" Version="0.7.0">
25
+ <!-- PackageReference Include="NonCopyableAnalyzer" Version="0.7.0">
20
26
  <PrivateAssets>all</PrivateAssets>
21
27
  <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
22
- </PackageReference>
28
+ </PackageReference -->
23
29
  </ItemGroup>
24
30
  </Project>
@@ -1,6 +1,7 @@
1
1
  graft src/runtime
2
2
  prune src/runtime/obj
3
3
  prune src/runtime/bin
4
+ graft src/compat
4
5
  include src/pythonnet.snk
5
6
  include Directory.Build.*
6
7
  include pythonnet.sln
@@ -1,30 +1,29 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: pythonnet
3
- Version: 3.0.4
3
+ Version: 3.1.0
4
4
  Summary: .NET and Mono integration for Python
5
5
  Author-email: "The Contributors of the Python.NET Project" <pythonnet@python.org>
6
- License: MIT
6
+ License-Expression: MIT
7
7
  Project-URL: Homepage, https://pythonnet.github.io/
8
8
  Project-URL: Sources, https://github.com/pythonnet/pythonnet
9
9
  Classifier: Development Status :: 5 - Production/Stable
10
10
  Classifier: Intended Audience :: Developers
11
- Classifier: License :: OSI Approved :: MIT License
12
11
  Classifier: Programming Language :: C#
13
12
  Classifier: Programming Language :: Python :: 3
14
- Classifier: Programming Language :: Python :: 3.7
15
- Classifier: Programming Language :: Python :: 3.8
16
- Classifier: Programming Language :: Python :: 3.9
17
13
  Classifier: Programming Language :: Python :: 3.10
18
14
  Classifier: Programming Language :: Python :: 3.11
19
15
  Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Programming Language :: Python :: 3.13
17
+ Classifier: Programming Language :: Python :: 3.14
20
18
  Classifier: Operating System :: Microsoft :: Windows
21
19
  Classifier: Operating System :: POSIX :: Linux
22
20
  Classifier: Operating System :: MacOS :: MacOS X
23
- Requires-Python: <3.13,>=3.7
21
+ Requires-Python: <3.15,>=3.10
24
22
  Description-Content-Type: text/x-rst
25
23
  License-File: LICENSE
26
24
  License-File: AUTHORS.md
27
- Requires-Dist: clr_loader<0.3.0,>=0.2.6
25
+ Requires-Dist: clr_loader<0.4.0,>=0.3.1
26
+ Dynamic: license-file
28
27
 
29
28
  pythonnet - Python.NET
30
29
  ===========================
@@ -1,32 +1,30 @@
1
1
  [build-system]
2
- requires = ["setuptools>=61", "wheel"]
2
+ requires = ["setuptools>=80", "packaging>=24", "pyproject-parser>=0.14"]
3
3
  build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "pythonnet"
7
7
  description = ".NET and Mono integration for Python"
8
- license = {text = "MIT"}
8
+ license = "MIT"
9
9
 
10
10
  readme = "README.rst"
11
11
 
12
12
  dependencies = [
13
- "clr_loader>=0.2.6,<0.3.0"
13
+ "clr_loader>=0.3.1,<0.4.0"
14
14
  ]
15
15
 
16
- requires-python = ">=3.7, <3.13"
16
+ requires-python = ">=3.10, <3.15"
17
17
 
18
18
  classifiers = [
19
19
  "Development Status :: 5 - Production/Stable",
20
20
  "Intended Audience :: Developers",
21
- "License :: OSI Approved :: MIT License",
22
21
  "Programming Language :: C#",
23
22
  "Programming Language :: Python :: 3",
24
- "Programming Language :: Python :: 3.7",
25
- "Programming Language :: Python :: 3.8",
26
- "Programming Language :: Python :: 3.9",
27
23
  "Programming Language :: Python :: 3.10",
28
24
  "Programming Language :: Python :: 3.11",
29
25
  "Programming Language :: Python :: 3.12",
26
+ "Programming Language :: Python :: 3.13",
27
+ "Programming Language :: Python :: 3.14",
30
28
  "Operating System :: Microsoft :: Windows",
31
29
  "Operating System :: POSIX :: Linux",
32
30
  "Operating System :: MacOS :: MacOS X",
@@ -34,6 +32,21 @@ classifiers = [
34
32
 
35
33
  dynamic = ["version"]
36
34
 
35
+ [dependency-groups]
36
+ dev = [
37
+ "pytest >= 6",
38
+ "find_libpython >= 0.3",
39
+ "numpy >=2 ; python_version >= '3.10'",
40
+ "numpy <2 ; python_version < '3.10'",
41
+ ]
42
+ doc = [
43
+ "sphinx",
44
+ "furo>=2025.12.19",
45
+ "pygments>=2.20",
46
+ "breathe",
47
+ "sphinx-csharp @ git+https://github.com/rogerbarton/sphinx-csharp.git",
48
+ ]
49
+
37
50
  [[project.authors]]
38
51
  name = "The Contributors of the Python.NET Project"
39
52
  email = "pythonnet@python.org"
@@ -42,6 +55,9 @@ email = "pythonnet@python.org"
42
55
  Homepage = "https://pythonnet.github.io/"
43
56
  Sources = "https://github.com/pythonnet/pythonnet"
44
57
 
58
+ [project.entry-points.pyinstaller40]
59
+ hook-dirs = "pythonnet._pyinstaller:get_hook_dirs"
60
+
45
61
  [tool.setuptools]
46
62
  zip-safe = false
47
63
  py-modules = ["clr"]
@@ -0,0 +1,4 @@
1
+ import os
2
+
3
+ def get_hook_dirs():
4
+ return [os.path.dirname(__file__)]
@@ -0,0 +1,9 @@
1
+ from PyInstaller.utils.hooks import collect_data_files, collect_dynamic_libs
2
+
3
+ try:
4
+ binaries = collect_dynamic_libs("pythonnet")
5
+ datas = collect_data_files("pythonnet")
6
+ except Exception:
7
+ # name conflict with https://pypi.org/project/clr/, do not crash if just clr is present
8
+ binaries = []
9
+ datas = []
@@ -1,30 +1,29 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: pythonnet
3
- Version: 3.0.4
3
+ Version: 3.1.0
4
4
  Summary: .NET and Mono integration for Python
5
5
  Author-email: "The Contributors of the Python.NET Project" <pythonnet@python.org>
6
- License: MIT
6
+ License-Expression: MIT
7
7
  Project-URL: Homepage, https://pythonnet.github.io/
8
8
  Project-URL: Sources, https://github.com/pythonnet/pythonnet
9
9
  Classifier: Development Status :: 5 - Production/Stable
10
10
  Classifier: Intended Audience :: Developers
11
- Classifier: License :: OSI Approved :: MIT License
12
11
  Classifier: Programming Language :: C#
13
12
  Classifier: Programming Language :: Python :: 3
14
- Classifier: Programming Language :: Python :: 3.7
15
- Classifier: Programming Language :: Python :: 3.8
16
- Classifier: Programming Language :: Python :: 3.9
17
13
  Classifier: Programming Language :: Python :: 3.10
18
14
  Classifier: Programming Language :: Python :: 3.11
19
15
  Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Programming Language :: Python :: 3.13
17
+ Classifier: Programming Language :: Python :: 3.14
20
18
  Classifier: Operating System :: Microsoft :: Windows
21
19
  Classifier: Operating System :: POSIX :: Linux
22
20
  Classifier: Operating System :: MacOS :: MacOS X
23
- Requires-Python: <3.13,>=3.7
21
+ Requires-Python: <3.15,>=3.10
24
22
  Description-Content-Type: text/x-rst
25
23
  License-File: LICENSE
26
24
  License-File: AUTHORS.md
27
- Requires-Dist: clr_loader<0.3.0,>=0.2.6
25
+ Requires-Dist: clr_loader<0.4.0,>=0.3.1
26
+ Dynamic: license-file
28
27
 
29
28
  pythonnet - Python.NET
30
29
  ===========================
@@ -12,10 +12,14 @@ pythonnet/__init__.py
12
12
  pythonnet.egg-info/PKG-INFO
13
13
  pythonnet.egg-info/SOURCES.txt
14
14
  pythonnet.egg-info/dependency_links.txt
15
+ pythonnet.egg-info/entry_points.txt
15
16
  pythonnet.egg-info/not-zip-safe
16
17
  pythonnet.egg-info/requires.txt
17
18
  pythonnet.egg-info/top_level.txt
19
+ pythonnet/_pyinstaller/__init__.py
20
+ pythonnet/_pyinstaller/hook-clr.py
18
21
  src/pythonnet.snk
22
+ src/compat/Python.Runtime.Compat.csproj
19
23
  src/runtime/AssemblyManager.cs
20
24
  src/runtime/ClassManager.cs
21
25
  src/runtime/Converter.cs
@@ -58,7 +62,9 @@ src/runtime/CollectionWrappers/IterableWrapper.cs
58
62
  src/runtime/CollectionWrappers/ListWrapper.cs
59
63
  src/runtime/CollectionWrappers/SequenceWrapper.cs
60
64
  src/runtime/Mixins/CollectionMixinsProvider.cs
65
+ src/runtime/Mixins/DynamicObjectMixinsProvider.cs
61
66
  src/runtime/Mixins/collections.py
67
+ src/runtime/Mixins/dlr.py
62
68
  src/runtime/Native/ABI.cs
63
69
  src/runtime/Native/BorrowedReference.cs
64
70
  src/runtime/Native/CustomMarshaler.cs
@@ -87,9 +93,8 @@ src/runtime/Native/TypeOffset.cs
87
93
  src/runtime/Native/TypeOffset310.cs
88
94
  src/runtime/Native/TypeOffset311.cs
89
95
  src/runtime/Native/TypeOffset312.cs
90
- src/runtime/Native/TypeOffset37.cs
91
- src/runtime/Native/TypeOffset38.cs
92
- src/runtime/Native/TypeOffset39.cs
96
+ src/runtime/Native/TypeOffset313.cs
97
+ src/runtime/Native/TypeOffset314.cs
93
98
  src/runtime/Properties/AssemblyInfo.cs
94
99
  src/runtime/PythonTypes/PyBuffer.cs
95
100
  src/runtime/PythonTypes/PyDict.cs
@@ -133,6 +138,7 @@ src/runtime/Types/ClassObject.cs
133
138
  src/runtime/Types/ClrModule.cs
134
139
  src/runtime/Types/ClrObject.cs
135
140
  src/runtime/Types/DelegateObject.cs
141
+ src/runtime/Types/DynamicObjectMemberAccessor.cs
136
142
  src/runtime/Types/EventBinding.cs
137
143
  src/runtime/Types/EventObject.cs
138
144
  src/runtime/Types/ExceptionClassObject.cs
@@ -157,6 +163,7 @@ src/runtime/Types/PropertyObject.cs
157
163
  src/runtime/Types/ReflectedClrType.cs
158
164
  src/runtime/Types/UnsafeReferenceWithRun.cs
159
165
  src/runtime/Util/CodeGenerator.cs
166
+ src/runtime/Util/ConcurrentLruCache.cs
160
167
  src/runtime/Util/DebugUtil.cs
161
168
  src/runtime/Util/Encodings.cs
162
169
  src/runtime/Util/EventHandlerCollection.cs
@@ -166,6 +173,7 @@ src/runtime/Util/NonCopyableAttribute.cs
166
173
  src/runtime/Util/NullOnly.cs
167
174
  src/runtime/Util/OpsHelper.cs
168
175
  src/runtime/Util/ParameterHelper.cs
176
+ src/runtime/Util/PythonEnvironment.cs
169
177
  src/runtime/Util/PythonReferenceComparer.cs
170
178
  src/runtime/Util/ReflectionPolyfills.cs
171
179
  src/runtime/Util/ReflectionUtil.cs
@@ -179,7 +187,9 @@ tests/test_collection_mixins.py
179
187
  tests/test_constructors.py
180
188
  tests/test_conversion.py
181
189
  tests/test_delegate.py
190
+ tests/test_disposable.py
182
191
  tests/test_docstring.py
192
+ tests/test_dynamic.py
183
193
  tests/test_engine.py
184
194
  tests/test_enum.py
185
195
  tests/test_event.py
@@ -0,0 +1,2 @@
1
+ [pyinstaller40]
2
+ hook-dirs = pythonnet._pyinstaller:get_hook_dirs
@@ -0,0 +1 @@
1
+ clr_loader<0.4.0,>=0.3.1
@@ -4,14 +4,10 @@ VisualStudioVersion = 17.0.31912.275
4
4
  MinimumVisualStudioVersion = 15.0.26124.0
5
5
  Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Python.Runtime", "src\runtime\Python.Runtime.csproj", "{4E8C8FE2-0FB8-4517-B2D9-5FB2D5FC849B}"
6
6
  EndProject
7
- Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Console", "src\console\Console.csproj", "{E6B01706-00BA-4144-9029-186AC42FBE9A}"
8
- EndProject
9
7
  Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Python.EmbeddingTest", "src\embed_tests\Python.EmbeddingTest.csproj", "{819E089B-4770-400E-93C6-4F7A35F0EA12}"
10
8
  EndProject
11
9
  Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Python.Test", "src\testing\Python.Test.csproj", "{14EF9518-5BB7-4F83-8686-015BD2CC788E}"
12
10
  EndProject
13
- Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Python.PerformanceTests", "src\perf_tests\Python.PerformanceTests.csproj", "{4F2EA4A1-7ECA-48B5-8077-7A3C366F9931}"
14
- EndProject
15
11
  Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Python.DomainReloadTests", "tests\domain_tests\Python.DomainReloadTests.csproj", "{F2FB6DA3-318E-4F30-9A1F-932C667E38C5}"
16
12
  EndProject
17
13
  Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Repo", "Repo", "{441A0123-F4C6-4EE4-9AEE-315FD79BE2D5}"
@@ -22,6 +18,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Repo", "Repo", "{441A0123-F
22
18
  LICENSE = LICENSE
23
19
  README.rst = README.rst
24
20
  version.txt = version.txt
21
+ shell.nix = shell.nix
25
22
  EndProjectSection
26
23
  EndProject
27
24
  Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CI", "CI", "{D301657F-5EAF-4534-B280-B858D651B2E5}"
@@ -3,15 +3,25 @@
3
3
  import distutils
4
4
  from distutils.command.build import build as _build
5
5
  from setuptools.command.develop import develop as _develop
6
- from wheel.bdist_wheel import bdist_wheel as _bdist_wheel
6
+ from setuptools.command.bdist_wheel import bdist_wheel as _bdist_wheel
7
+ from packaging.specifiers import SpecifierSet
8
+ from packaging.version import Version
9
+ from pyproject_parser import PyProject
7
10
  from setuptools import Distribution
8
11
  from setuptools import setup, Command
9
12
 
10
13
  import os
14
+ import sys
11
15
 
12
16
  # Disable SourceLink during the build until it can read repo-format v1, #1613
13
17
  os.environ["EnableSourceControlManagerQueries"] = "false"
14
18
 
19
+ NET46_SUPPORT_OPTION = "--net46-support"
20
+ NET46_SUPPORT = NET46_SUPPORT_OPTION in sys.argv
21
+ if NET46_SUPPORT:
22
+ sys.argv.remove(NET46_SUPPORT_OPTION)
23
+ WINDOWS_PLATFORM_TAG = "win32.win_amd64"
24
+
15
25
 
16
26
  class DotnetLib:
17
27
  def __init__(self, name, path, **kwargs):
@@ -107,11 +117,29 @@ class develop(_develop):
107
117
 
108
118
 
109
119
  class bdist_wheel(_bdist_wheel):
110
- def finalize_options(self):
111
- # Monkey patch bdist_wheel to think the package is pure even though we
112
- # include DLLs
113
- super().finalize_options()
114
- self.root_is_pure = True
120
+ def get_tag(self):
121
+ if NET46_SUPPORT:
122
+ platform_tag = WINDOWS_PLATFORM_TAG
123
+ else:
124
+ platform_tag = "any"
125
+ abi_tag = "none"
126
+ python_tag = self._get_python_tag()
127
+ return python_tag, abi_tag, platform_tag
128
+
129
+ def _get_python_tag(self) -> str:
130
+ pyproject = PyProject.load("pyproject.toml")
131
+ project = pyproject.project or {}
132
+
133
+ requires_python = project.get("requires-python")
134
+ if not requires_python:
135
+ raise RuntimeError("project.requires-python is required")
136
+
137
+ specifiers = SpecifierSet(str(requires_python))
138
+ return ".".join(
139
+ f"cp3{minor}"
140
+ for minor in range(0, 100)
141
+ if specifiers.contains(Version(f"3.{minor}"), prereleases=True)
142
+ )
115
143
 
116
144
 
117
145
  # Monkey-patch Distribution s.t. it supports the dotnet_libs attribute
@@ -124,13 +152,13 @@ cmdclass = {
124
152
  "bdist_wheel": bdist_wheel,
125
153
  }
126
154
 
127
- dotnet_libs = [
128
- DotnetLib(
129
- "python-runtime",
130
- "src/runtime/Python.Runtime.csproj",
131
- output="pythonnet/runtime",
132
- )
133
- ]
155
+
156
+ if NET46_SUPPORT:
157
+ csproj = "src/compat/Python.Runtime.Compat.csproj"
158
+ else:
159
+ csproj = "src/runtime/Python.Runtime.csproj"
160
+
161
+ dotnet_libs = [DotnetLib("python-runtime", csproj, output="pythonnet/runtime")]
134
162
 
135
163
  setup(
136
164
  cmdclass=cmdclass,
@@ -0,0 +1,13 @@
1
+ <!-- A dummy project to force MSBuild to package .NET 4.6.1 requirements -->
2
+ <Project Sdk="Microsoft.NET.Sdk">
3
+ <PropertyGroup>
4
+ <TargetFramework>net461</TargetFramework>
5
+ <OutputType>Library</OutputType>
6
+ <!-- Don't copy the dummy assembly/pdb to output; we only need the resolved references -->
7
+ <CopyBuildOutputToOutputDirectory>false</CopyBuildOutputToOutputDirectory>
8
+ <CopyOutputSymbolsToOutputDirectory>false</CopyOutputSymbolsToOutputDirectory>
9
+ </PropertyGroup>
10
+ <ItemGroup>
11
+ <ProjectReference Include="..\runtime\Python.Runtime.csproj" />
12
+ </ItemGroup>
13
+ </Project>
@@ -123,6 +123,11 @@ namespace Python.Runtime
123
123
 
124
124
  internal static AssemblyName? TryParseAssemblyName(string name)
125
125
  {
126
+ // workaround for https://github.com/dotnet/runtime/issues/123951
127
+ if (name.IndexOfAny(new[] { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar }) >= 0)
128
+ {
129
+ return null;
130
+ }
126
131
  try
127
132
  {
128
133
  return new AssemblyName(name);
@@ -213,6 +213,7 @@ namespace Python.Runtime
213
213
  ClassInfo info = GetClassInfo(type, impl);
214
214
 
215
215
  impl.indexer = info.indexer;
216
+ impl.del = info.del;
216
217
  impl.richcompare.Clear();
217
218
 
218
219
 
@@ -538,6 +539,21 @@ namespace Python.Runtime
538
539
 
539
540
  ob = new MethodObject(type, name, mlist);
540
541
  ci.members[name] = ob.AllocObject();
542
+ if (name == nameof(IDictionary<int, int>.Remove)
543
+ && mlist.Any(m => m.DeclaringType?.GetInterfaces()
544
+ .Any(i => i.TryGetGenericDefinition() == typeof(IDictionary<,>)) is true))
545
+ {
546
+ ci.del = new();
547
+ ci.del.AddRange(mlist.Where(m => !m.IsStatic));
548
+ }
549
+ else if (name == nameof(IList<int>.RemoveAt)
550
+ && mlist.Any(m => m.DeclaringType?.GetInterfaces()
551
+ .Any(i => i.TryGetGenericDefinition() == typeof(IList<>)) is true))
552
+ {
553
+ ci.del = new();
554
+ ci.del.AddRange(mlist.Where(m => !m.IsStatic));
555
+ }
556
+
541
557
  if (mlist.Any(OperatorMethod.IsOperatorMethod))
542
558
  {
543
559
  string pyName = OperatorMethod.GetPyMethodName(name);
@@ -581,6 +597,7 @@ namespace Python.Runtime
581
597
  private class ClassInfo
582
598
  {
583
599
  public Indexer? indexer;
600
+ public MethodBinder? del;
584
601
  public readonly Dictionary<string, PyObject> members = new();
585
602
 
586
603
  internal ClassInfo()
@@ -1,55 +1,55 @@
1
- using System;
2
- using System.Collections.Generic;
3
-
4
- namespace Python.Runtime.Codecs
5
- {
6
- public class IterableDecoder : IPyObjectDecoder
7
- {
8
- internal static bool IsIterable(Type targetType)
9
- {
10
- //if it is a plain IEnumerable, we can decode it using sequence protocol.
11
- if (targetType == typeof(System.Collections.IEnumerable))
12
- return true;
13
-
14
- if (!targetType.IsGenericType)
15
- return false;
16
-
17
- return targetType.GetGenericTypeDefinition() == typeof(IEnumerable<>);
18
- }
19
-
20
- internal static bool IsIterable(PyType objectType)
21
- {
22
- return objectType.HasAttr("__iter__");
23
- }
24
-
25
- public bool CanDecode(PyType objectType, Type targetType)
26
- {
27
- return IsIterable(objectType) && IsIterable(targetType);
28
- }
29
-
30
- public bool TryDecode<T>(PyObject pyObj, out T value)
31
- {
32
- //first see if T is a plan IEnumerable
33
- if (typeof(T) == typeof(System.Collections.IEnumerable))
34
- {
35
- object enumerable = new CollectionWrappers.IterableWrapper<object>(pyObj);
36
- value = (T)enumerable;
37
- return true;
38
- }
39
-
40
- var elementType = typeof(T).GetGenericArguments()[0];
41
- var collectionType = typeof(CollectionWrappers.IterableWrapper<>).MakeGenericType(elementType);
42
-
43
- var instance = Activator.CreateInstance(collectionType, new[] { pyObj });
44
- value = (T)instance;
45
- return true;
46
- }
47
-
48
- public static IterableDecoder Instance { get; } = new IterableDecoder();
49
-
50
- public static void Register()
51
- {
52
- PyObjectConversions.RegisterDecoder(Instance);
53
- }
54
- }
55
- }
1
+ using System;
2
+ using System.Collections.Generic;
3
+
4
+ namespace Python.Runtime.Codecs
5
+ {
6
+ public class IterableDecoder : IPyObjectDecoder
7
+ {
8
+ internal static bool IsIterable(Type targetType)
9
+ {
10
+ //if it is a plain IEnumerable, we can decode it using sequence protocol.
11
+ if (targetType == typeof(System.Collections.IEnumerable))
12
+ return true;
13
+
14
+ if (!targetType.IsGenericType)
15
+ return false;
16
+
17
+ return targetType.GetGenericTypeDefinition() == typeof(IEnumerable<>);
18
+ }
19
+
20
+ internal static bool IsIterable(PyType objectType)
21
+ {
22
+ return objectType.HasAttr("__iter__");
23
+ }
24
+
25
+ public bool CanDecode(PyType objectType, Type targetType)
26
+ {
27
+ return IsIterable(objectType) && IsIterable(targetType);
28
+ }
29
+
30
+ public bool TryDecode<T>(PyObject pyObj, out T value)
31
+ {
32
+ //first see if T is a plan IEnumerable
33
+ if (typeof(T) == typeof(System.Collections.IEnumerable))
34
+ {
35
+ object enumerable = new CollectionWrappers.IterableWrapper<object>(pyObj);
36
+ value = (T)enumerable;
37
+ return true;
38
+ }
39
+
40
+ var elementType = typeof(T).GetGenericArguments()[0];
41
+ var collectionType = typeof(CollectionWrappers.IterableWrapper<>).MakeGenericType(elementType);
42
+
43
+ var instance = Activator.CreateInstance(collectionType, new[] { pyObj });
44
+ value = (T)instance;
45
+ return true;
46
+ }
47
+
48
+ public static IterableDecoder Instance { get; } = new IterableDecoder();
49
+
50
+ public static void Register()
51
+ {
52
+ PyObjectConversions.RegisterDecoder(Instance);
53
+ }
54
+ }
55
+ }