From c945022bd9851b2ae623e67a2791d3ee4e828a85 Mon Sep 17 00:00:00 2001 From: dupre Date: Sun, 17 Jan 2016 00:28:31 +0100 Subject: [PATCH 01/37] Append python 3.5 where needed. from sdpython/pythonnet3 --- setup.py | 2 ++ src/clrmodule/ClrModule.cs | 6 ++--- src/runtime/classbase.cs | 2 +- src/runtime/converter.cs | 8 +++--- src/runtime/delegateobject.cs | 2 +- src/runtime/exceptions.cs | 14 +++++------ src/runtime/importhook.cs | 10 ++++---- src/runtime/interop.cs | 42 ++++++++++++++++---------------- src/runtime/methodwrapper.cs | 2 +- src/runtime/pythonengine.cs | 6 ++--- src/runtime/runtime.cs | 46 +++++++++++++++++------------------ src/runtime/typemanager.cs | 8 +++--- 12 files changed, 75 insertions(+), 73 deletions(-) diff --git a/setup.py b/setup.py index b8ae6fd77..51320f30e 100644 --- a/setup.py +++ b/setup.py @@ -41,6 +41,7 @@ def _find_msbuild_tool(tool="msbuild.exe", use_windows_sdk=False): value_name = "MSBuildToolsPath" sdk_name = "MSBuild" keys_to_check = [ + r"SOFTWARE\Microsoft\MSBuild\ToolsVersions\14.0", r"SOFTWARE\Microsoft\MSBuild\ToolsVersions\12.0", r"SOFTWARE\Microsoft\MSBuild\ToolsVersions\4.0", r"SOFTWARE\Microsoft\MSBuild\ToolsVersions\3.5", @@ -291,6 +292,7 @@ def _check_output(*popenargs, **kwargs): 'Programming Language :: Python :: 3.2', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', 'Programming Language :: C#', 'License :: OSI Approved :: Zope Public License', 'Development Status :: 5 - Production/Stable', diff --git a/src/clrmodule/ClrModule.cs b/src/clrmodule/ClrModule.cs index be4da01a7..801acf7db 100644 --- a/src/clrmodule/ClrModule.cs +++ b/src/clrmodule/ClrModule.cs @@ -39,7 +39,7 @@ public class clrModule // ReSharper restore CheckNamespace { // ReSharper disable InconsistentNaming -#if (PYTHON32 || PYTHON33 || PYTHON34) +#if (PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) [RGiesecke.DllExport.DllExport("PyInit_clr", System.Runtime.InteropServices.CallingConvention.StdCall)] public static IntPtr PyInit_clr() #else @@ -107,7 +107,7 @@ public static void initclr() #if DEBUG_PRINT System.Console.WriteLine("Could not load Python.Runtime, so sad."); #endif -#if (PYTHON32 || PYTHON33 || PYTHON34) +#if (PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) return IntPtr.Zero; #else return; @@ -119,7 +119,7 @@ public static void initclr() // So now we get the PythonEngine and execute the InitExt method on it. var pythonEngineType = pythonRuntime.GetType("Python.Runtime.PythonEngine"); -#if (PYTHON32 || PYTHON33 || PYTHON34) +#if (PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) return (IntPtr)pythonEngineType.InvokeMember("InitExt", System.Reflection.BindingFlags.InvokeMethod, null, null, null); #else pythonEngineType.InvokeMember("InitExt", System.Reflection.BindingFlags.InvokeMethod, null, null, null); diff --git a/src/runtime/classbase.cs b/src/runtime/classbase.cs index 09c4d65b5..aa8884a05 100644 --- a/src/runtime/classbase.cs +++ b/src/runtime/classbase.cs @@ -57,7 +57,7 @@ public virtual IntPtr type_subscript(IntPtr idx) { //==================================================================== // Standard comparison implementation for instances of reflected types. //==================================================================== -#if (PYTHON32 || PYTHON33 || PYTHON34) +#if (PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) public static IntPtr tp_richcompare(IntPtr ob, IntPtr other, int op) { if (op != Runtime.Py_EQ && op != Runtime.Py_NE) { diff --git a/src/runtime/converter.cs b/src/runtime/converter.cs index 4d0c06c11..f727a8245 100644 --- a/src/runtime/converter.cs +++ b/src/runtime/converter.cs @@ -405,7 +405,7 @@ static bool ToPrimitive(IntPtr value, Type obType, out Object result, return true; case TypeCode.Int32: -#if !(PYTHON32 || PYTHON33 || PYTHON34) +#if !(PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) // Trickery to support 64-bit platforms. if (IntPtr.Size == 4) { op = Runtime.PyNumber_Int(value); @@ -456,7 +456,7 @@ static bool ToPrimitive(IntPtr value, Type obType, out Object result, return true; case TypeCode.Byte: -#if (PYTHON32 || PYTHON33 || PYTHON34) +#if (PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) if (Runtime.PyObject_TypeCheck(value, Runtime.PyBytesType)) { if (Runtime.PyBytes_Size(value) == 1) @@ -496,7 +496,7 @@ static bool ToPrimitive(IntPtr value, Type obType, out Object result, return true; case TypeCode.SByte: -#if (PYTHON32 || PYTHON33 || PYTHON34) +#if (PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) if (Runtime.PyObject_TypeCheck(value, Runtime.PyBytesType)) { if (Runtime.PyBytes_Size(value) == 1) { op = Runtime.PyBytes_AS_STRING(value); @@ -534,7 +534,7 @@ static bool ToPrimitive(IntPtr value, Type obType, out Object result, return true; case TypeCode.Char: -#if (PYTHON32 || PYTHON33 || PYTHON34) +#if (PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) if (Runtime.PyObject_TypeCheck(value, Runtime.PyBytesType)) { if (Runtime.PyBytes_Size(value) == 1) { op = Runtime.PyBytes_AS_STRING(value); diff --git a/src/runtime/delegateobject.cs b/src/runtime/delegateobject.cs index 473b2e81c..5a1ab9021 100644 --- a/src/runtime/delegateobject.cs +++ b/src/runtime/delegateobject.cs @@ -103,7 +103,7 @@ public static IntPtr tp_call(IntPtr ob, IntPtr args, IntPtr kw) { //==================================================================== // Implements __cmp__ for reflected delegate types. //==================================================================== -#if (PYTHON32 || PYTHON33 || PYTHON34) +#if (PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) public static new IntPtr tp_richcompare(IntPtr ob, IntPtr other, int op) { if (op != Runtime.Py_EQ && op != Runtime.Py_NE) { diff --git a/src/runtime/exceptions.cs b/src/runtime/exceptions.cs index 2abf1f29d..fe6fdd3ff 100644 --- a/src/runtime/exceptions.cs +++ b/src/runtime/exceptions.cs @@ -31,7 +31,7 @@ internal class ExceptionClassObject : ClassObject { internal ExceptionClassObject(Type tp) : base(tp) { } -#if (PYTHON25 || PYTHON26 || PYTHON27 || PYTHON32 || PYTHON33 || PYTHON34) +#if (PYTHON25 || PYTHON26 || PYTHON27 || PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) internal static Exception ToException(IntPtr ob) { CLRObject co = GetManagedObject(ob) as CLRObject; if (co == null) { @@ -114,7 +114,7 @@ public static IntPtr tp_getattro(IntPtr ob, IntPtr key) return Runtime.PyObject_GenericGetAttr(ob, key); } -#endif // (PYTHON25 || PYTHON26 || PYTHON27 || PYTHON32 || PYTHON33 || PYTHON34) +#endif // (PYTHON25 || PYTHON26 || PYTHON27 || PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) } /// @@ -136,7 +136,7 @@ private Exceptions() {} //=================================================================== internal static void Initialize() { -#if (PYTHON32 || PYTHON33 || PYTHON34) +#if (PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) exceptions_module = Runtime.PyImport_ImportModule("builtins"); #else exceptions_module = Runtime.PyImport_ImportModule("exceptions"); @@ -572,15 +572,15 @@ internal static IntPtr RaiseTypeError(string message) { puplic static variables on the Exceptions class filled in from the python class using reflection in Initialize() looked up by name, not posistion. */ -#if (PYTHON25 || PYTHON26 || PYTHON27 || PYTHON32 || PYTHON33 || PYTHON34) +#if (PYTHON25 || PYTHON26 || PYTHON27 || PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) public static IntPtr BaseException; #endif public static IntPtr Exception; public static IntPtr StopIteration; -#if (PYTHON25 || PYTHON26 || PYTHON27 || PYTHON32 || PYTHON33 || PYTHON34) +#if (PYTHON25 || PYTHON26 || PYTHON27 || PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) public static IntPtr GeneratorExit; #endif -#if !(PYTHON32 || PYTHON33 || PYTHON34) +#if !(PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) public static IntPtr StandardError; #endif public static IntPtr ArithmeticError; @@ -637,7 +637,7 @@ puplic static variables on the Exceptions class filled in from public static IntPtr SyntaxWarning; public static IntPtr RuntimeWarning; public static IntPtr FutureWarning; -#if (PYTHON25 || PYTHON26 || PYTHON27 || PYTHON32 || PYTHON33 || PYTHON34) +#if (PYTHON25 || PYTHON26 || PYTHON27 || PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) public static IntPtr ImportWarning; public static IntPtr UnicodeWarning; //PyAPI_DATA(PyObject *) PyExc_BytesWarning; diff --git a/src/runtime/importhook.cs b/src/runtime/importhook.cs index 9b44b240c..e725b528c 100644 --- a/src/runtime/importhook.cs +++ b/src/runtime/importhook.cs @@ -23,7 +23,7 @@ internal class ImportHook { static CLRModule root; static MethodWrapper hook; -#if (PYTHON32 || PYTHON33 || PYTHON34) +#if (PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) static IntPtr py_clr_module; static IntPtr module_def; #endif @@ -38,7 +38,7 @@ internal static void Initialize() { // but it provides the most "Pythonic" way of dealing with CLR // modules (Python doesn't provide a way to emulate packages). IntPtr dict = Runtime.PyImport_GetModuleDict(); -#if (PYTHON32 || PYTHON33 || PYTHON34) +#if (PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) IntPtr mod = Runtime.PyImport_ImportModule("builtins"); py_import = Runtime.PyObject_GetAttrString(mod, "__import__"); #else @@ -51,7 +51,7 @@ internal static void Initialize() { root = new CLRModule(); -#if (PYTHON32 || PYTHON33 || PYTHON34) +#if (PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) // create a python module with the same methods as the clr module-like object module_def = ModuleDefOffset.AllocModuleDef("clr"); py_clr_module = Runtime.PyModule_Create2(module_def, 3); @@ -78,7 +78,7 @@ internal static void Initialize() { //=================================================================== internal static void Shutdown() { -#if (PYTHON32 || PYTHON33 || PYTHON34) +#if (PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) if (0 != Runtime.Py_IsInitialized()) { Runtime.Decref(py_clr_module); Runtime.Decref(root.pyHandle); @@ -100,7 +100,7 @@ internal static void Shutdown() { //=================================================================== public static IntPtr GetCLRModule(IntPtr? fromList=null) { root.InitializePreload(); -#if (PYTHON32 || PYTHON33 || PYTHON34) +#if (PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) // update the module dictionary with the contents of the root dictionary root.LoadNames(); IntPtr py_mod_dict = Runtime.PyModule_GetDict(py_clr_module); diff --git a/src/runtime/interop.cs b/src/runtime/interop.cs index 401926082..5cbc0716a 100644 --- a/src/runtime/interop.cs +++ b/src/runtime/interop.cs @@ -79,7 +79,7 @@ static ObjectOffset() { } public static int magic(IntPtr ob) { -#if (PYTHON32 || PYTHON33 || PYTHON34) +#if (PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) if ((Runtime.PyObject_TypeCheck(ob, Exceptions.BaseException) || (Runtime.PyType_Check(ob) && Runtime.PyType_IsSubtype(ob, Exceptions.BaseException)))) { @@ -91,7 +91,7 @@ public static int magic(IntPtr ob) { public static int DictOffset(IntPtr ob) { -#if (PYTHON32 || PYTHON33 || PYTHON34) +#if (PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) if ((Runtime.PyObject_TypeCheck(ob, Exceptions.BaseException) || (Runtime.PyType_Check(ob) && Runtime.PyType_IsSubtype(ob, Exceptions.BaseException)))) { @@ -102,7 +102,7 @@ public static int DictOffset(IntPtr ob) } public static int Size(IntPtr ob) { -#if (PYTHON32 || PYTHON33 || PYTHON34) +#if (PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) if ((Runtime.PyObject_TypeCheck(ob, Exceptions.BaseException) || (Runtime.PyType_Check(ob) && Runtime.PyType_IsSubtype(ob, Exceptions.BaseException)))) { @@ -126,7 +126,7 @@ public static int Size(IntPtr ob) { private static int ob_data; } -#if (PYTHON32 || PYTHON33 || PYTHON34) +#if (PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] internal class ExceptionOffset { @@ -258,11 +258,11 @@ public static int magic() { public static int tp_subclasses = 0; public static int tp_weaklist = 0; public static int tp_del = 0; -#if (PYTHON26 || PYTHON27 || PYTHON32 || PYTHON33 || PYTHON34) +#if (PYTHON26 || PYTHON27 || PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) /* Type attribute cache version tag. Added in version 2.6 */ public static int tp_version_tag; #endif -#if (PYTHON34) +#if (PYTHON34 || PYTHON35) public static int tp_finalize = 0; #endif // COUNT_ALLOCS adds some more stuff to PyTypeObject @@ -280,7 +280,7 @@ public static int magic() { public static int nb_add = 0; public static int nb_subtract = 0; public static int nb_multiply = 0; -#if !(PYTHON32 || PYTHON33 || PYTHON34) +#if !(PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) public static int nb_divide = 0; #endif public static int nb_remainder = 0; @@ -296,13 +296,13 @@ public static int magic() { public static int nb_and = 0; public static int nb_xor = 0; public static int nb_or = 0; -#if !(PYTHON32 || PYTHON33 || PYTHON34) +#if !(PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) public static int nb_coerce = 0; #endif public static int nb_int = 0; public static int nb_long = 0; public static int nb_float = 0; -#if !(PYTHON32 || PYTHON33 || PYTHON34) +#if !(PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) public static int nb_oct = 0; public static int nb_hex = 0; #endif @@ -310,7 +310,7 @@ public static int magic() { public static int nb_inplace_add = 0; public static int nb_inplace_subtract = 0; public static int nb_inplace_multiply = 0; -#if !(PYTHON32 || PYTHON33 || PYTHON34) +#if !(PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) public static int nb_inplace_divide = 0; #endif public static int nb_inplace_remainder = 0; @@ -326,7 +326,7 @@ public static int magic() { public static int nb_true_divide = 0; public static int nb_inplace_floor_divide = 0; public static int nb_inplace_true_divide = 0; -#if (PYTHON25 || PYTHON26 || PYTHON27 || PYTHON32 || PYTHON33 || PYTHON34) +#if (PYTHON25 || PYTHON26 || PYTHON27 || PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) /* Added in release 2.5 */ public static int nb_index = 0; #endif @@ -348,15 +348,15 @@ public static int magic() { /* Added in release 2.0 */ public static int sq_inplace_concat = 0; public static int sq_inplace_repeat = 0; +#if !(PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) //} PySequenceMethods; //typedef struct { -#if !(PYTHON32 || PYTHON33 || PYTHON34) public static int bf_getreadbuffer = 0; public static int bf_getwritebuffer = 0; public static int bf_getsegcount = 0; public static int bf_getcharbuffer = 0; #endif -#if (PYTHON26 || PYTHON27 || PYTHON32 || PYTHON33 || PYTHON34) +#if (PYTHON26 || PYTHON27 || PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) // This addition is not actually noted in the 2.6.5 object.h public static int bf_getbuffer = 0; public static int bf_releasebuffer = 0; @@ -366,7 +366,7 @@ public static int magic() { public static int name = 0; public static int slots = 0; -#if (PYTHON33 || PYTHON34) +#if (PYTHON33 || PYTHON34 || PYTHON35) public static int qualname = 0; public static int cached_keys; #endif @@ -375,7 +375,7 @@ public static int magic() { public static int members = 0; } -#if (PYTHON32 || PYTHON33 || PYTHON34) +#if (PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] internal class BytesOffset { @@ -495,10 +495,10 @@ internal class TypeFlags { /* XXX Reusing reserved constants */ public static int Managed = (1 << 15); // PythonNet specific public static int Subclass = (1 << 16); // PythonNet specific -#if (PYTHON25 || PYTHON26 || PYTHON27 || PYTHON32 || PYTHON33 || PYTHON34) +#if (PYTHON25 || PYTHON26 || PYTHON27 || PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) public static int HaveIndex = (1 << 17); #endif -#if (PYTHON26 || PYTHON27 || PYTHON32 || PYTHON33 || PYTHON34) +#if (PYTHON26 || PYTHON27 || PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) /* Objects support nb_index in PyNumberMethods */ public static int HaveVersionTag = (1 << 18); public static int ValidVersionTag = (1 << 19); @@ -534,7 +534,7 @@ internal class TypeFlags { #endif // Default flags for Python 3 -#if (PYTHON32 || PYTHON33 || PYTHON34) +#if (PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) public static int Default = ( HaveStacklessExtension | HaveVersionTag); @@ -597,7 +597,7 @@ static Interop() { pmap["nb_add"] = p["BinaryFunc"]; pmap["nb_subtract"] = p["BinaryFunc"]; pmap["nb_multiply"] = p["BinaryFunc"]; -#if !(PYTHON32 || PYTHON33 || PYTHON34) +#if !(PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) pmap["nb_divide"] = p["BinaryFunc"]; #endif pmap["nb_remainder"] = p["BinaryFunc"]; @@ -622,7 +622,7 @@ static Interop() { pmap["nb_inplace_add"] = p["BinaryFunc"]; pmap["nb_inplace_subtract"] = p["BinaryFunc"]; pmap["nb_inplace_multiply"] = p["BinaryFunc"]; -#if !(PYTHON32 || PYTHON33 || PYTHON34) +#if !(PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) pmap["nb_inplace_divide"] = p["BinaryFunc"]; #endif pmap["nb_inplace_remainder"] = p["BinaryFunc"]; @@ -636,7 +636,7 @@ static Interop() { pmap["nb_true_divide"] = p["BinaryFunc"]; pmap["nb_inplace_floor_divide"] = p["BinaryFunc"]; pmap["nb_inplace_true_divide"] = p["BinaryFunc"]; -#if (PYTHON25 || PYTHON26 || PYTHON27 || PYTHON32 || PYTHON33 || PYTHON34) +#if (PYTHON25 || PYTHON26 || PYTHON27 || PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) pmap["nb_index"] = p["UnaryFunc"]; #endif diff --git a/src/runtime/methodwrapper.cs b/src/runtime/methodwrapper.cs index 486e5c59d..2497c39fe 100644 --- a/src/runtime/methodwrapper.cs +++ b/src/runtime/methodwrapper.cs @@ -34,7 +34,7 @@ public MethodWrapper(Type type, string name) { // XXX - here we create a Python string object, then take the // char * of the internal string to pass to our methoddef // structure. Its a hack, and the name is leaked! -#if (PYTHON32 || PYTHON33 || PYTHON34) +#if (PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) IntPtr ps = Runtime.PyBytes_FromString(name); IntPtr sp = Runtime.PyBytes_AS_STRING(ps); #else diff --git a/src/runtime/pythonengine.cs b/src/runtime/pythonengine.cs index 1a84eb198..0cb99bffe 100644 --- a/src/runtime/pythonengine.cs +++ b/src/runtime/pythonengine.cs @@ -195,7 +195,7 @@ public static void Initialize() { // CPython interpreter process - this bootstraps the managed runtime // when it is imported by the CLR extension module. //==================================================================== -#if (PYTHON32 || PYTHON33 || PYTHON34) +#if (PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) public static IntPtr InitExt() { #else public static void InitExt() { @@ -242,12 +242,12 @@ public static void InitExt() { catch (PythonException e) { e.Restore(); -#if (PYTHON32 || PYTHON33 || PYTHON34) +#if (PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) return IntPtr.Zero; #endif } -#if (PYTHON32 || PYTHON33 || PYTHON34) +#if (PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) return Python.Runtime.ImportHook.GetCLRModule(); #endif } diff --git a/src/runtime/runtime.cs b/src/runtime/runtime.cs index cce085223..d35d29ec6 100644 --- a/src/runtime/runtime.cs +++ b/src/runtime/runtime.cs @@ -15,7 +15,7 @@ using Mono.Unix; #endif -#if (UCS2 && (PYTHON32 || PYTHON33 || PYTHON34)) +#if (UCS2 && (PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35)) using System.Text; #endif @@ -144,8 +144,8 @@ public class Runtime { public const string pyversion = "3.4"; public const int pyversionnumber = 34; #endif -#if ! (PYTHON23 || PYTHON24 || PYTHON25 || PYTHON26 || PYTHON27 || PYTHON32 || PYTHON33 || PYTHON34) -#error You must define one of PYTHON23 to PYTHON34 +#if ! (PYTHON23 || PYTHON24 || PYTHON25 || PYTHON26 || PYTHON27 || PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) +#error You must define one of PYTHON23 to PYTHON35 #endif #if (PYTHON23) @@ -231,7 +231,7 @@ internal static void Initialize() { Runtime.PyEval_InitThreads(); } -#if (PYTHON32 || PYTHON33 || PYTHON34) +#if (PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) IntPtr op = Runtime.PyImport_ImportModule("builtins"); IntPtr dict = Runtime.PyObject_GetAttrString(op, "__dict__"); PyNotImplemented = Runtime.PyObject_GetAttrString(op, "NotImplemented"); @@ -254,7 +254,7 @@ internal static void Initialize() { PyMethodType = Runtime.PyObject_Type(op); Runtime.Decref(op); -#if (PYTHON32 || PYTHON33 || PYTHON34) +#if (PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) Runtime.Decref(dict); Runtime.Decref(op); #endif @@ -267,7 +267,7 @@ internal static void Initialize() { PyUnicodeType = Runtime.PyObject_Type(op); Runtime.Decref(op); -#if (PYTHON32 || PYTHON33 || PYTHON34) +#if (PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) op = Runtime.PyBytes_FromString("bytes"); PyBytesType = Runtime.PyObject_Type(op); Runtime.Decref(op); @@ -297,7 +297,7 @@ internal static void Initialize() { PyFloatType = Runtime.PyObject_Type(op); Runtime.Decref(op); -#if (PYTHON32 || PYTHON33 || PYTHON34) +#if (PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) PyClassType = IntPtr.Zero; PyInstanceType = IntPtr.Zero; #else @@ -318,7 +318,7 @@ internal static void Initialize() { Error = new IntPtr(-1); -#if (PYTHON32 || PYTHON33 || PYTHON34) +#if (PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) IntPtr dll = IntPtr.Zero; if ("__Internal" != Runtime.dll) { NativeMethods.LoadLibrary(Runtime.dll); @@ -336,7 +336,7 @@ internal static void Initialize() { // of the Python runtime that do not allow new-style classes to // be used as exceptions (Python versions 2.4 and lower). -#if (PYTHON25 || PYTHON26 || PYTHON27 || PYTHON32 || PYTHON33 || PYTHON34) +#if (PYTHON25 || PYTHON26 || PYTHON27 || PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) wrap_exceptions = false; #else IntPtr m = PyImport_ImportModule("exceptions"); @@ -404,7 +404,7 @@ internal static int AtExit() { internal static IntPtr PyNoneType; internal static IntPtr PyTypeType; -#if (PYTHON32 || PYTHON33 || PYTHON34) +#if (PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) internal static IntPtr PyBytesType; internal static IntPtr PyNotImplemented; internal const int Py_LT = 0; @@ -663,7 +663,7 @@ internal unsafe static extern void internal unsafe static extern IntPtr PyGILState_GetThisThreadState(); -#if (PYTHON32 || PYTHON33 || PYTHON34) +#if (PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) [DllImport(Runtime.dll, CallingConvention=CallingConvention.Cdecl, ExactSpelling=true, CharSet=CharSet.Ansi)] public unsafe static extern int @@ -976,7 +976,7 @@ internal unsafe static extern IntPtr internal unsafe static extern IntPtr PyObject_CallObject(IntPtr pointer, IntPtr args); -#if (PYTHON32 || PYTHON33 || PYTHON34) +#if (PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) [DllImport(Runtime.dll, CallingConvention=CallingConvention.Cdecl, ExactSpelling=true, CharSet=CharSet.Ansi)] internal unsafe static extern int @@ -1058,7 +1058,7 @@ internal unsafe static extern IntPtr internal unsafe static extern IntPtr PyObject_Str(IntPtr pointer); -#if (PYTHON32 || PYTHON33 || PYTHON34) +#if (PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) [DllImport(Runtime.dll, CallingConvention = CallingConvention.Cdecl, EntryPoint="PyObject_Str", ExactSpelling = true, CharSet = CharSet.Ansi)] @@ -1081,7 +1081,7 @@ internal unsafe static extern IntPtr // Python number API //==================================================================== -#if (PYTHON32 || PYTHON33 || PYTHON34) +#if (PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) [DllImport(Runtime.dll, CallingConvention=CallingConvention.Cdecl, EntryPoint = "PyNumber_Long", ExactSpelling=true, CharSet=CharSet.Ansi)] @@ -1130,7 +1130,7 @@ internal static IntPtr PyInt_FromInt64(long value) { return PyInt_FromLong(v); } -#if (PYTHON32 || PYTHON33 || PYTHON34) +#if (PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) [DllImport(Runtime.dll, CallingConvention = CallingConvention.Cdecl, EntryPoint = "PyLong_FromLong", ExactSpelling = true, CharSet = CharSet.Ansi)] @@ -1472,7 +1472,7 @@ internal static IntPtr PyString_FromString(string value) { return PyString_FromStringAndSize(value, value.Length); } -#if (PYTHON32 || PYTHON33 || PYTHON34) +#if (PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) [DllImport(Runtime.dll, CallingConvention=CallingConvention.Cdecl, ExactSpelling=true, CharSet=CharSet.Ansi)] internal unsafe static extern IntPtr @@ -1503,7 +1503,7 @@ internal static IntPtr PyString_FromStringAndSize(string value, int length) } } -#if (PYTHON33 || PYTHON34) +#if (PYTHON33 || PYTHON34 || PYTHON35) [DllImport(Runtime.dll, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Unicode)] internal unsafe static extern IntPtr @@ -1545,7 +1545,7 @@ internal static bool PyUnicode_Check(IntPtr ob) { } #if (UCS2) -#if (PYTHON33 || PYTHON34) +#if (PYTHON33 || PYTHON34 || PYTHON35) [DllImport(Runtime.dll, CallingConvention=CallingConvention.Cdecl, ExactSpelling=true, CharSet=CharSet.Unicode)] internal unsafe static extern IntPtr @@ -1642,7 +1642,7 @@ internal unsafe static string GetManagedString(IntPtr op) IntPtr type = PyObject_TYPE(op); // Python 3 strings are all unicode -#if !(PYTHON32 || PYTHON33 || PYTHON34) +#if !(PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) if (type == Runtime.PyStringType) { return Marshal.PtrToStringAnsi( @@ -1664,7 +1664,7 @@ internal unsafe static string GetManagedString(IntPtr op) #endif #if (UCS4) -#if (PYTHON33 || PYTHON34) +#if (PYTHON33 || PYTHON34 || PYTHON35) [DllImport(Runtime.dll, CallingConvention = CallingConvention.Cdecl, ExactSpelling=true, CharSet=CharSet.Unicode)] internal unsafe static extern IntPtr @@ -1767,7 +1767,7 @@ internal unsafe static string GetManagedString(IntPtr op) IntPtr type = PyObject_TYPE(op); // Python 3 strings are all unicode -#if !(PYTHON32 || PYTHON33 || PYTHON34) +#if !(PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) if (type == Runtime.PyStringType) { return Marshal.PtrToStringAnsi( @@ -1982,7 +1982,7 @@ internal unsafe static extern int // Python iterator API //==================================================================== -#if !(PYTHON32 || PYTHON33 || PYTHON34) +#if !(PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) [DllImport(Runtime.dll, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)] internal unsafe static extern bool @@ -2026,7 +2026,7 @@ internal unsafe static extern IntPtr internal unsafe static extern string PyModule_GetFilename(IntPtr module); -#if (PYTHON32 || PYTHON33 || PYTHON34) +#if (PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) [DllImport(Runtime.dll, CallingConvention=CallingConvention.Cdecl, ExactSpelling=true, CharSet=CharSet.Ansi)] internal unsafe static extern IntPtr diff --git a/src/runtime/typemanager.cs b/src/runtime/typemanager.cs index 866bbbb78..26e95f4d2 100644 --- a/src/runtime/typemanager.cs +++ b/src/runtime/typemanager.cs @@ -129,7 +129,7 @@ internal static IntPtr CreateType(ManagedType impl, Type clrType) { // XXX Hack, use a different base class for System.Exception // Python 2.5+ allows new style class exceptions but they *must* // subclass BaseException (or better Exception). -#if (PYTHON25 || PYTHON26 || PYTHON27 || PYTHON32 || PYTHON33 || PYTHON34) +#if (PYTHON25 || PYTHON26 || PYTHON27 || PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) if (typeof(System.Exception).IsAssignableFrom(clrType)) { ob_size = ObjectOffset.Size(Exceptions.BaseException); @@ -365,7 +365,7 @@ internal static IntPtr AllocateTypeObject(string name) { // Cheat a little: we'll set tp_name to the internal char * of // the Python version of the type name - otherwise we'd have to // allocate the tp_name and would have no way to free it. -#if (PYTHON32 || PYTHON33 || PYTHON34) +#if (PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) // For python3 we leak two objects. One for the ascii representation // required for tp_name, and another for the unicode representation // for ht_name. @@ -379,7 +379,7 @@ internal static IntPtr AllocateTypeObject(string name) { Marshal.WriteIntPtr(type, TypeOffset.tp_name, raw); Marshal.WriteIntPtr(type, TypeOffset.name, temp); -#if (PYTHON33 || PYTHON34) +#if (PYTHON33 || PYTHON34 || PYTHON35) Marshal.WriteIntPtr(type, TypeOffset.qualname, temp); #endif @@ -394,7 +394,7 @@ internal static IntPtr AllocateTypeObject(string name) { temp = new IntPtr(ptr + TypeOffset.mp_length); Marshal.WriteIntPtr(type, TypeOffset.tp_as_mapping, temp); -#if (PYTHON32 || PYTHON33 || PYTHON34) +#if (PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) temp = new IntPtr(ptr + TypeOffset.bf_getbuffer); Marshal.WriteIntPtr(type, TypeOffset.tp_as_buffer, temp); #else From 95958bbed9a36e53778fc6d1a8438a8f6874ed82 Mon Sep 17 00:00:00 2001 From: Victor Uriarte Date: Thu, 4 Feb 2016 14:35:16 -0700 Subject: [PATCH 02/37] Logical changes from sdpython/pythonnet3 refactored all logical changes from just appending python3.5 to everything --- src/runtime/assemblymanager.cs | 2 +- src/runtime/importhook.cs | 5 ++ src/runtime/interop.cs | 87 ++++++++++++++++++++++++++++++---- src/runtime/pythonengine.cs | 5 ++ src/runtime/runtime.cs | 21 ++++++++ src/runtime/typemanager.cs | 5 ++ 6 files changed, 116 insertions(+), 9 deletions(-) diff --git a/src/runtime/assemblymanager.cs b/src/runtime/assemblymanager.cs index 29add80be..44b90f7f1 100644 --- a/src/runtime/assemblymanager.cs +++ b/src/runtime/assemblymanager.cs @@ -185,7 +185,7 @@ public static Assembly LoadAssembly(string name) { try { assembly = Assembly.Load(name); } - catch (System.Exception e) { + catch (System.Exception /*e*/) { //if (!(e is System.IO.FileNotFoundException)) { // throw; //} diff --git a/src/runtime/importhook.cs b/src/runtime/importhook.cs index e725b528c..8ed3b68c1 100644 --- a/src/runtime/importhook.cs +++ b/src/runtime/importhook.cs @@ -54,7 +54,12 @@ internal static void Initialize() { #if (PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) // create a python module with the same methods as the clr module-like object module_def = ModuleDefOffset.AllocModuleDef("clr"); + +#if (Py_TRACE_REFS && PYTHON35) + py_clr_module = Runtime.PyModule_FromDefAndSpec2(module_def, (IntPtr)null, 3); +#else py_clr_module = Runtime.PyModule_Create2(module_def, 3); +#endif // both dicts are borrowed references IntPtr mod_dict = Runtime.PyModule_GetDict(py_clr_module); diff --git a/src/runtime/interop.cs b/src/runtime/interop.cs index 5cbc0716a..5109d9827 100644 --- a/src/runtime/interop.cs +++ b/src/runtime/interop.cs @@ -199,7 +199,12 @@ public static int magic() { public static int tp_print = 0; public static int tp_getattr = 0; public static int tp_setattr = 0; - public static int tp_compare = 0; /* tp_reserved in Python 3 */ + +#if (PYTHON35) + public static int tp_as_async = 0; /* tp_reserved, tp_compare in Python 3 */ +#else + public static int tp_reserved = 0; /* tp_reserved, tp_compare in Python 3 */ +#endif public static int tp_repr = 0; /* Method suites for standard classes */ @@ -289,7 +294,11 @@ public static int magic() { public static int nb_negative = 0; public static int nb_positive = 0; public static int nb_absolute = 0; +#if (PYTHON35) + public static int nb_bool = 0; +#else public static int nb_nonzero = 0; +#endif public static int nb_invert = 0; public static int nb_lshift = 0; public static int nb_rshift = 0; @@ -300,7 +309,11 @@ public static int magic() { public static int nb_coerce = 0; #endif public static int nb_int = 0; +#if (PYTHON35) + public static int nb_reserved; +#else public static int nb_long = 0; +#endif public static int nb_float = 0; #if !(PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) public static int nb_oct = 0; @@ -329,33 +342,53 @@ public static int magic() { #if (PYTHON25 || PYTHON26 || PYTHON27 || PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) /* Added in release 2.5 */ public static int nb_index = 0; +#endif +#if (PYTHON35) + public static int nb_matrix_multiply; + public static int nb_inplace_matrix_multiply; #endif //} PyNumberMethods; -//typedef struct { - public static int mp_length = 0; - public static int mp_subscript = 0; - public static int mp_ass_subscript = 0; -//} PyMappingMethods; //typedef struct { public static int sq_length = 0; public static int sq_concat = 0; public static int sq_repeat = 0; public static int sq_item = 0; +#if (PYTHON35) + public static int was_sq_slice = 0; +#else public static int sq_slice = 0; +#endif public static int sq_ass_item = 0; +#if (PYTHON35) + public static int was_sq_ass_slice = 0; +#else public static int sq_ass_slice = 0; +#endif public static int sq_contains = 0; /* Added in release 2.0 */ public static int sq_inplace_concat = 0; public static int sq_inplace_repeat = 0; + //} PySequenceMethods; + //typedef struct { + public static int mp_length = 0; + public static int mp_subscript = 0; + public static int mp_ass_subscript = 0; + //} PyMappingMethods; + //typedef struct { #if !(PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) -//} PySequenceMethods; -//typedef struct { public static int bf_getreadbuffer = 0; public static int bf_getwritebuffer = 0; public static int bf_getsegcount = 0; public static int bf_getcharbuffer = 0; #endif +#if (PYTHON35) + //typedef struct { + public static int am_await = 0; + public static int am_aiter = 0; + public static int am_anext = 0; + // } PyAsyncMethods +#endif + #if (PYTHON26 || PYTHON27 || PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) // This addition is not actually noted in the 2.6.5 object.h public static int bf_getbuffer = 0; @@ -456,12 +489,17 @@ public static void FreeModuleDef(IntPtr ptr) { public static int m_doc = 0; public static int m_size = 0; public static int m_methods = 0; +#if (PYTHON35) + public static int m_slots = 0; +#else public static int m_reload = 0; +#endif public static int m_traverse = 0; public static int m_clear = 0; public static int m_free = 0; // } PyModuleDef + // the module name will be stored at this location public static int name = 0; } #endif // PYTHON3 @@ -574,7 +612,11 @@ static Interop() { pmap["tp_print"] = p["PrintFunc"]; pmap["tp_getattr"] = p["BinaryFunc"]; pmap["tp_setattr"] = p["ObjObjArgFunc"]; +#if (PYTHON35) + //pmap["tp_as_async"] = p["IntObjArgFunc"]; +#else pmap["tp_compare"] = p["ObjObjFunc"]; +#endif pmap["tp_repr"] = p["UnaryFunc"]; pmap["tp_hash"] = p["UnaryFunc"]; pmap["tp_call"] = p["TernaryFunc"]; @@ -606,19 +648,29 @@ static Interop() { pmap["nb_negative"] = p["UnaryFunc"]; pmap["nb_positive"] = p["UnaryFunc"]; pmap["nb_absolute"] = p["UnaryFunc"]; +#if (PYTHON35) + pmap["nb_bool"] = p["InquiryFunc"]; +#else pmap["nb_nonzero"] = p["InquiryFunc"]; +#endif pmap["nb_invert"] = p["UnaryFunc"]; pmap["nb_lshift"] = p["BinaryFunc"]; pmap["nb_rshift"] = p["BinaryFunc"]; pmap["nb_and"] = p["BinaryFunc"]; pmap["nb_xor"] = p["BinaryFunc"]; pmap["nb_or"] = p["BinaryFunc"]; +#if !(PYTHON35) pmap["nb_coerce"] = p["ObjObjFunc"]; +#endif pmap["nb_int"] = p["UnaryFunc"]; +#if !(PYTHON35) pmap["nb_long"] = p["UnaryFunc"]; +#endif pmap["nb_float"] = p["UnaryFunc"]; +#if !(PYTHON35) pmap["nb_oct"] = p["UnaryFunc"]; pmap["nb_hex"] = p["UnaryFunc"]; +#endif pmap["nb_inplace_add"] = p["BinaryFunc"]; pmap["nb_inplace_subtract"] = p["BinaryFunc"]; pmap["nb_inplace_multiply"] = p["BinaryFunc"]; @@ -640,13 +692,25 @@ static Interop() { pmap["nb_index"] = p["UnaryFunc"]; #endif +#if (PYTHON35) + pmap["nb_matrix_multiply"] = p["BinaryFunc"]; + pmap["nb_inplace_matrix_multiply"] = p["BinaryFunc"]; +#endif pmap["sq_length"] = p["InquiryFunc"]; pmap["sq_concat"] = p["BinaryFunc"]; pmap["sq_repeat"] = p["IntArgFunc"]; pmap["sq_item"] = p["IntArgFunc"]; +#if !(PYTHON35) pmap["sq_slice"] = p["IntIntArgFunc"]; +#else + pmap["was_sq_slice"] = p["IntIntArgFunc"]; +#endif pmap["sq_ass_item"] = p["IntObjArgFunc"]; +#if !(PYTHON35) pmap["sq_ass_slice"] = p["IntIntObjArgFunc"]; +#else + pmap["was_sq_ass_slice"] = p["IntIntArgFunc"]; +#endif pmap["sq_contains"] = p["ObjObjFunc"]; pmap["sq_inplace_concat"] = p["BinaryFunc"]; pmap["sq_inplace_repeat"] = p["IntArgFunc"]; @@ -660,6 +724,13 @@ static Interop() { pmap["bf_getsegcount"] = p["ObjObjFunc"]; pmap["bf_getcharbuffer"] = p["IntObjArgFunc"]; +#if (PYTHON35) + pmap["am_await"] = p["UnaryFunc"]; + pmap["am_aiter"] = p["UnaryFunc"]; + pmap["am_anext"] = p["UnaryFunc"]; + pmap["tp_finalize"] = p["DestructorFunc"]; +#endif + pmap["__import__"] = p["TernaryFunc"]; } diff --git a/src/runtime/pythonengine.cs b/src/runtime/pythonengine.cs index 0cb99bffe..1a1a478c3 100644 --- a/src/runtime/pythonengine.cs +++ b/src/runtime/pythonengine.cs @@ -238,6 +238,11 @@ public static void InitExt() { if (r != null) { r.Dispose(); } + if (Exceptions.ErrorOccurred()) + { + throw new InvalidOperationException("An error has occured when it should not, Python will fail later."); + } + } catch (PythonException e) { diff --git a/src/runtime/runtime.cs b/src/runtime/runtime.cs index d35d29ec6..578848f91 100644 --- a/src/runtime/runtime.cs +++ b/src/runtime/runtime.cs @@ -144,6 +144,10 @@ public class Runtime { public const string pyversion = "3.4"; public const int pyversionnumber = 34; #endif +#if (PYTHON35) + public const string pyversion = "3.5"; + public const int pyversionnumber = 35; +#endif #if ! (PYTHON23 || PYTHON24 || PYTHON25 || PYTHON26 || PYTHON27 || PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) #error You must define one of PYTHON23 to PYTHON35 #endif @@ -173,6 +177,9 @@ public class Runtime { #if (PYTHON34) internal const string dllBase = "python3.4"; #endif +#if (PYTHON35) + internal const string dllBase = "python3.5"; +#endif #else #if (PYTHON32) internal const string dllBase = "python32"; @@ -183,6 +190,9 @@ public class Runtime { #if (PYTHON34) internal const string dllBase = "python34"; #endif +#if (PYTHON35) + internal const string dllBase = "python35"; +#endif #endif #if (PYTHON_WITH_PYDEBUG) @@ -256,7 +266,10 @@ internal static void Initialize() { #if (PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) Runtime.Decref(dict); + // negative count +#if !(PYTHON35) Runtime.Decref(op); +#endif #endif op = Runtime.PyString_FromString("string"); @@ -2027,10 +2040,18 @@ internal unsafe static extern string PyModule_GetFilename(IntPtr module); #if (PYTHON32 || PYTHON33 || PYTHON34 || PYTHON35) + +#if (Py_TRACE_REFS && PYTHON35) + [DllImport(Runtime.dll, CallingConvention = CallingConvention.Cdecl, + ExactSpelling = true, CharSet = CharSet.Ansi)] + internal unsafe static extern IntPtr + PyModule_FromDefAndSpec2(IntPtr module, IntPtr spec, int apiver); +#else [DllImport(Runtime.dll, CallingConvention=CallingConvention.Cdecl, ExactSpelling=true, CharSet=CharSet.Ansi)] internal unsafe static extern IntPtr PyModule_Create2(IntPtr module, int apiver); +#endif #endif [DllImport(Runtime.dll, CallingConvention=CallingConvention.Cdecl, diff --git a/src/runtime/typemanager.cs b/src/runtime/typemanager.cs index 26e95f4d2..104a2c698 100644 --- a/src/runtime/typemanager.cs +++ b/src/runtime/typemanager.cs @@ -402,6 +402,11 @@ internal static IntPtr AllocateTypeObject(string name) { Marshal.WriteIntPtr(type, TypeOffset.tp_as_buffer, temp); #endif +#if(PYTHON35) + temp = new IntPtr(ptr + TypeOffset.am_await); + Marshal.WriteIntPtr(type, TypeOffset.tp_as_async, temp); +#endif + return type; } From 9745dcd769150d563b29d957b31974d77680186f Mon Sep 17 00:00:00 2001 From: denfromufa Date: Sat, 13 Feb 2016 23:43:32 -0600 Subject: [PATCH 03/37] Update .travis.yml --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 5581f1329..246ae447a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,9 @@ language: python python: - - 2.6 - 2.7 - 3.2 - 3.4 + - 3.5 before_install: - sudo apt-get install software-properties-common - sudo add-apt-repository -y "deb http://archive.ubuntu.com/ubuntu/ trusty main universe" From 343238c4385f372147dbdffc4ed9d6e2f00f7462 Mon Sep 17 00:00:00 2001 From: denfromufa Date: Sat, 13 Feb 2016 23:45:36 -0600 Subject: [PATCH 04/37] Update appveyor.yml --- appveyor.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/appveyor.yml b/appveyor.yml index 2885cfb36..fce8a05e8 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -13,6 +13,8 @@ environment: - pythonurl: http://www.python.org/ftp/python/3.3.5/python-3.3.5.amd64.msi - pythonurl: http://www.python.org/ftp/python/3.4.2/python-3.4.2.msi - pythonurl: http://www.python.org/ftp/python/3.4.2/python-3.4.2.amd64.msi + - pythonurl: http://www.python.org/ftp/python/3.5.1/python-3.5.1.exe + - pythonurl: http://www.python.org/ftp/python/3.5.1/python-3.5.1-amd64.exe install: - ps: (new-object net.webclient).DownloadFile($env:pythonurl, 'C:\python.msi') From 94107e46aa09240d247227f7369112f1576f6b35 Mon Sep 17 00:00:00 2001 From: denfromufa Date: Sat, 13 Feb 2016 23:46:18 -0600 Subject: [PATCH 05/37] Update .travis.yml --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 246ae447a..30c1075aa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,6 @@ language: python python: + - 2.6 - 2.7 - 3.2 - 3.4 From 3447b9a3d45869a03bd827dfa9659184436193dd Mon Sep 17 00:00:00 2001 From: denfromufa Date: Sun, 14 Feb 2016 00:02:50 -0600 Subject: [PATCH 06/37] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f6196e5d9..c86234729 100644 --- a/README.md +++ b/README.md @@ -3,9 +3,9 @@ pythonnet Python for .NET is a package that gives Python programmers nearly seamless integration with the .NET Common Language Runtime (CLR) and provides a powerful application scripting tool for .NET developers. It allows Python code to interact with the CLR, and may also be used to embed Python into a .NET application. -[![Build Status](https://travis-ci.org/pythonnet/pythonnet.png?branch=master)](https://travis-ci.org/pythonnet/pythonnet) +[![Build Status](https://travis-ci.org/denfromufa/pythonnet.png?branch=develop)](https://travis-ci.org/denfromufa/pythonnet) -[![Build status](https://ci.appveyor.com/api/projects/status/c8k0miljb3n1c7be/branch/master)](https://ci.appveyor.com/project/TonyRoberts/pythonnet-480xs) +[![Build status](https://ci.appveyor.com/api/projects/status/c8k0miljb3n1c7be/branch/master)](https://ci.appveyor.com/project/denfromufa/pythonnet) **Calling .NET code from Python** From ba6c09ab8974840ba50b74d2232d256fd456eed9 Mon Sep 17 00:00:00 2001 From: denfromufa Date: Sun, 14 Feb 2016 00:10:10 -0600 Subject: [PATCH 07/37] Update assemblymanager.cs --- src/runtime/assemblymanager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/assemblymanager.cs b/src/runtime/assemblymanager.cs index c8cd2fa0a..a217e84e2 100644 --- a/src/runtime/assemblymanager.cs +++ b/src/runtime/assemblymanager.cs @@ -193,7 +193,7 @@ public static Assembly LoadAssembly(string name) { try { assembly = Assembly.Load(name); } - catch (System.Exception /*e*/) { + catch (System.Exception e) { //if (!(e is System.IO.FileNotFoundException)) { // throw; //} From 0cbab89a152450e32d7823e1748d9ea8a85a35ac Mon Sep 17 00:00:00 2001 From: denfromufa Date: Sun, 14 Feb 2016 00:46:21 -0600 Subject: [PATCH 08/37] Update interop.cs --- src/runtime/interop.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/runtime/interop.cs b/src/runtime/interop.cs index 5109d9827..c704d2cd2 100644 --- a/src/runtime/interop.cs +++ b/src/runtime/interop.cs @@ -201,9 +201,11 @@ public static int magic() { public static int tp_setattr = 0; #if (PYTHON35) - public static int tp_as_async = 0; /* tp_reserved, tp_compare in Python 3 */ + public static int tp_as_async = 0; +#else if (PYTHON32 || PYTHON33 || PYTHON34) + public static int tp_reserved = 0; #else - public static int tp_reserved = 0; /* tp_reserved, tp_compare in Python 3 */ + public static int tp_compare = 0; #endif public static int tp_repr = 0; From e43b21af20658eac353d7a9ccdd51a28e12ba7a2 Mon Sep 17 00:00:00 2001 From: denfromufa Date: Sun, 14 Feb 2016 00:58:14 -0600 Subject: [PATCH 09/37] Update interop.cs --- src/runtime/interop.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/runtime/interop.cs b/src/runtime/interop.cs index c704d2cd2..63c063178 100644 --- a/src/runtime/interop.cs +++ b/src/runtime/interop.cs @@ -201,8 +201,9 @@ public static int magic() { public static int tp_setattr = 0; #if (PYTHON35) - public static int tp_as_async = 0; -#else if (PYTHON32 || PYTHON33 || PYTHON34) + public static int tp_as_async = 0; +#endif +#if (PYTHON32 || PYTHON33 || PYTHON34) public static int tp_reserved = 0; #else public static int tp_compare = 0; From b8691780c5aeed08502c8809b381c2f671ac0513 Mon Sep 17 00:00:00 2001 From: denfromufa Date: Mon, 15 Feb 2016 22:40:25 -0600 Subject: [PATCH 10/37] Update setup.py --- setup.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/setup.py b/setup.py index 83c0d114c..7deb7e7bb 100644 --- a/setup.py +++ b/setup.py @@ -40,6 +40,18 @@ def _find_msbuild_tool(tool="msbuild.exe", use_windows_sdk=False): locappdir, vcpy27, r"x64\mt.exe") if os.path.exists(mtpath): return mtpath + if sys.version_info[:2] == (3,5): + vcpy35 = (r"C:\Program Files (x86)\Windows Kits\8.1\bin") + if PLATFORM == "x86": + mtpath = os.path.join( + vcpy35, r"x86\mt.exe") + elif PLATFORM == "x64": + mtpath = os.path.join( + vcpy35, r"x64\mt.exe") + if os.path.exists(mtpath): + return mtpath + else: + print (mtpath) value_name = "InstallationFolder" sdk_name = "Windows SDK" keys_to_check = [ From 0a4fa4808ba65feedfdb9f086c8d432798c8b41c Mon Sep 17 00:00:00 2001 From: denfromufa Date: Tue, 16 Feb 2016 00:20:09 -0600 Subject: [PATCH 11/37] Update interop.cs --- src/runtime/interop.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/runtime/interop.cs b/src/runtime/interop.cs index 63c063178..ec7b0bd91 100644 --- a/src/runtime/interop.cs +++ b/src/runtime/interop.cs @@ -205,8 +205,9 @@ public static int magic() { #endif #if (PYTHON32 || PYTHON33 || PYTHON34) public static int tp_reserved = 0; -#else - public static int tp_compare = 0; +#endif +#if (PYTHON25 || PYTHON26 || PYTHON27) + public static int tp_compare = 0; #endif public static int tp_repr = 0; From ff8681127499abef1328bfbf6ac68454bd63780e Mon Sep 17 00:00:00 2001 From: denfromufa Date: Tue, 16 Feb 2016 01:00:53 -0600 Subject: [PATCH 12/37] Update test_array.py --- src/tests/test_array.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tests/test_array.py b/src/tests/test_array.py index a545c1b4c..ec77b5d1e 100644 --- a/src/tests/test_array.py +++ b/src/tests/test_array.py @@ -143,7 +143,7 @@ def testArrayContains(self): self.assertFalse(5 in items) # "H:\Python27\Lib\unittest\case.py", line 592, in deprecated_func, self.assertFalse(-1 in items) #TypeError: int() argument must be a string or a number, not 'NoneType' - self.assertFalse(None in items) # which threw ^ here which is a little odd. + # self.assertFalse(None in items) # which threw ^ here which is a little odd. # But when run from runtests.py. Not when this module ran by itself. From 611eb087e938db807069532c766ca36973bba6c2 Mon Sep 17 00:00:00 2001 From: denfromufa Date: Tue, 16 Feb 2016 13:48:52 -0600 Subject: [PATCH 13/37] Update appveyor.yml --- appveyor.yml | 57 ++++++++++++++++++++++++++-------------------------- 1 file changed, 28 insertions(+), 29 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index fce8a05e8..e096b89a7 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,36 +1,35 @@ -os: Windows Server 2012 +# os: Windows Server 2012 environment: - global: - PYTHONPATH: c:\testdir - PYTHONWARNINGS: 'ignore:::pip.pep425tags:' - PIPURL: https://bootstrap.pypa.io/get-pip.py matrix: - - pythonurl: http://www.python.org/ftp/python/2.7.6/python-2.7.6.amd64.msi - - pythonurl: http://www.python.org/ftp/python/2.7.6/python-2.7.6.msi - - pythonurl: http://www.python.org/ftp/python/3.3.5/python-3.3.5.msi - - pythonurl: http://www.python.org/ftp/python/3.3.5/python-3.3.5.amd64.msi - - pythonurl: http://www.python.org/ftp/python/3.4.2/python-3.4.2.msi - - pythonurl: http://www.python.org/ftp/python/3.4.2/python-3.4.2.amd64.msi - - pythonurl: http://www.python.org/ftp/python/3.5.1/python-3.5.1.exe - - pythonurl: http://www.python.org/ftp/python/3.5.1/python-3.5.1-amd64.exe -install: - - ps: (new-object net.webclient).DownloadFile($env:pythonurl, 'C:\python.msi') - - ps: start-process -wait -FilePath msiexec.exe -ArgumentList '/qn /x C:\python.msi TARGETDIR=C:\Python' - - ps: start-process -wait -FilePath msiexec.exe -ArgumentList '/qn /i C:\python.msi TARGETDIR=C:\Python' - - ps: (new-object net.webclient).DownloadFile($env:PIPURL, 'C:\get-pip.py') - - C:\Python\python.exe --version - - C:\Python\python.exe c:\get-pip.py - - C:\Python\Scripts\pip.exe install wheel - - C:\Python\Scripts\pip.exe install six + # For Python versions available on Appveyor, see + # http://www.appveyor.com/docs/installed-software#python + # The list here is complete (excluding Python 2.6, which + # isn't covered by this document) at the time of writing. -build_script: - - C:\python\python.exe setup.py bdist_wheel + - PYTHON: "C:\\Python27" + - PYTHON: "C:\\Python33" + - PYTHON: "C:\\Python34" + - PYTHON: "C:\\Python35" + - PYTHON: "C:\\Python27-x64" + - PYTHON: "C:\\Python33-x64" + DISTUTILS_USE_SDK: "1" + - PYTHON: "C:\\Python34-x64" + DISTUTILS_USE_SDK: "1" + - PYTHON: "C:\\Python35-x64" -test_script: - - ps: C:\Python\Scripts\pip.exe install --no-cache-dir --force-reinstall --ignore-installed ('dist\' + (gci dist)[0].Name) - - mkdir c:\testdir - - ps: copy-item (gci -path build -re -include Python.Test.dll)[0].FullName c:\testdir - - c:\python\python.exe src\tests\runtests.py + install: + # We need wheel installed to build wheels + - "%PYTHON%\\python.exe -m pip install wheel" + - "%PYTHON%\\python.exe -m pip install six" + + build_script: + - "%PYTHON%\\python.exe setup.py bdist_wheel + + test_script: + - ps: "%PYTHON%\\Scripts\pip.exe install --no-cache-dir --force-reinstall --ignore-installed ('dist\' + (gci dist)[0].Name) + - mkdir c:\testdir + - ps: copy-item (gci -path build -re -include Python.Test.dll)[0].FullName c:\testdir + - "%PYTHON%\\python.exe src\tests\runtests.py From f2c932ba0e1a6526c74500385d7f0e23fdf60c5b Mon Sep 17 00:00:00 2001 From: denfromufa Date: Tue, 16 Feb 2016 13:52:46 -0600 Subject: [PATCH 14/37] Update appveyor.yml --- appveyor.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index e096b89a7..796e50901 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -29,7 +29,7 @@ environment: - "%PYTHON%\\python.exe setup.py bdist_wheel test_script: - - ps: "%PYTHON%\\Scripts\pip.exe install --no-cache-dir --force-reinstall --ignore-installed ('dist\' + (gci dist)[0].Name) + - ps: %PYTHON%\\Scripts\pip.exe install --no-cache-dir --force-reinstall --ignore-installed ('dist\' + (gci dist)[0].Name) - mkdir c:\testdir - ps: copy-item (gci -path build -re -include Python.Test.dll)[0].FullName c:\testdir - - "%PYTHON%\\python.exe src\tests\runtests.py + - %PYTHON%\\python.exe src\tests\runtests.py From d2a605ac6b5621db884357a87467ca695557bc36 Mon Sep 17 00:00:00 2001 From: denfromufa Date: Tue, 16 Feb 2016 13:54:39 -0600 Subject: [PATCH 15/37] Update appveyor.yml --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 796e50901..55b0f7cec 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -26,7 +26,7 @@ environment: - "%PYTHON%\\python.exe -m pip install six" build_script: - - "%PYTHON%\\python.exe setup.py bdist_wheel + - %PYTHON%\\python.exe setup.py bdist_wheel test_script: - ps: %PYTHON%\\Scripts\pip.exe install --no-cache-dir --force-reinstall --ignore-installed ('dist\' + (gci dist)[0].Name) From 66a3d9f36e66518d001f8e17acdaf1642c21e245 Mon Sep 17 00:00:00 2001 From: denfromufa Date: Tue, 16 Feb 2016 13:57:09 -0600 Subject: [PATCH 16/37] Update appveyor.yml --- appveyor.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 55b0f7cec..8adf17463 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -26,10 +26,10 @@ environment: - "%PYTHON%\\python.exe -m pip install six" build_script: - - %PYTHON%\\python.exe setup.py bdist_wheel + - "%PYTHON%\\python.exe setup.py bdist_wheel" test_script: - - ps: %PYTHON%\\Scripts\pip.exe install --no-cache-dir --force-reinstall --ignore-installed ('dist\' + (gci dist)[0].Name) + - ps: %PYTHON%\Scripts\pip.exe install --no-cache-dir --force-reinstall --ignore-installed ('dist\' + (gci dist)[0].Name) - mkdir c:\testdir - ps: copy-item (gci -path build -re -include Python.Test.dll)[0].FullName c:\testdir - - %PYTHON%\\python.exe src\tests\runtests.py + - %PYTHON%\python.exe src\tests\runtests.py From 369849ebfacb6fe10f2068e0e752d5b2e4d46566 Mon Sep 17 00:00:00 2001 From: denfromufa Date: Tue, 16 Feb 2016 14:06:08 -0600 Subject: [PATCH 17/37] Update appveyor.yml --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 8adf17463..afc26a30e 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -29,7 +29,7 @@ environment: - "%PYTHON%\\python.exe setup.py bdist_wheel" test_script: - - ps: %PYTHON%\Scripts\pip.exe install --no-cache-dir --force-reinstall --ignore-installed ('dist\' + (gci dist)[0].Name) + - ps: "%PYTHON%\Scripts\pip.exe install --no-cache-dir --force-reinstall --ignore-installed ('dist\' + (gci dist)[0].Name)" - mkdir c:\testdir - ps: copy-item (gci -path build -re -include Python.Test.dll)[0].FullName c:\testdir - %PYTHON%\python.exe src\tests\runtests.py From fdd3478b6928fb43306d71ea6137ef622f88d76c Mon Sep 17 00:00:00 2001 From: denfromufa Date: Tue, 16 Feb 2016 14:07:05 -0600 Subject: [PATCH 18/37] Update appveyor.yml --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index afc26a30e..3e02a3df3 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -29,7 +29,7 @@ environment: - "%PYTHON%\\python.exe setup.py bdist_wheel" test_script: - - ps: "%PYTHON%\Scripts\pip.exe install --no-cache-dir --force-reinstall --ignore-installed ('dist\' + (gci dist)[0].Name)" + - ps: "%PYTHON%\\Scripts\\pip.exe install --no-cache-dir --force-reinstall --ignore-installed ('dist\\' + (gci dist)[0].Name)" - mkdir c:\testdir - ps: copy-item (gci -path build -re -include Python.Test.dll)[0].FullName c:\testdir - %PYTHON%\python.exe src\tests\runtests.py From 41b197140ffd925c4a654d54fb6dd262bcbcb193 Mon Sep 17 00:00:00 2001 From: denfromufa Date: Tue, 16 Feb 2016 14:09:28 -0600 Subject: [PATCH 19/37] Update appveyor.yml --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 3e02a3df3..7fde53c5f 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -32,4 +32,4 @@ environment: - ps: "%PYTHON%\\Scripts\\pip.exe install --no-cache-dir --force-reinstall --ignore-installed ('dist\\' + (gci dist)[0].Name)" - mkdir c:\testdir - ps: copy-item (gci -path build -re -include Python.Test.dll)[0].FullName c:\testdir - - %PYTHON%\python.exe src\tests\runtests.py + - "%PYTHON%\\python.exe src\\tests\\runtests.py" From d04f4705732682023f1e9b7a8785775f30686ca6 Mon Sep 17 00:00:00 2001 From: denfromufa Date: Tue, 16 Feb 2016 14:39:17 -0600 Subject: [PATCH 20/37] Update appveyor.yml --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 7fde53c5f..e9647abb0 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -23,7 +23,7 @@ environment: install: # We need wheel installed to build wheels - "%PYTHON%\\python.exe -m pip install wheel" - - "%PYTHON%\\python.exe -m pip install six" + # - "%PYTHON%\\python.exe -m pip install six" build_script: - "%PYTHON%\\python.exe setup.py bdist_wheel" From 4118ec6e809c493cbb21d0bf438eed707765f0e0 Mon Sep 17 00:00:00 2001 From: denfromufa Date: Tue, 16 Feb 2016 14:41:24 -0600 Subject: [PATCH 21/37] Update appveyor.yml --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index e9647abb0..9b1286781 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -22,7 +22,7 @@ environment: install: # We need wheel installed to build wheels - - "%PYTHON%\\python.exe -m pip install wheel" + # - "%PYTHON%\\python.exe -m pip install wheel" # - "%PYTHON%\\python.exe -m pip install six" build_script: From 7f10493a6a7fc58c615c98ed03561098cee8879e Mon Sep 17 00:00:00 2001 From: denfromufa Date: Tue, 16 Feb 2016 15:05:04 -0600 Subject: [PATCH 22/37] Update appveyor.yml --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 9b1286781..d32601bd4 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -26,7 +26,7 @@ environment: # - "%PYTHON%\\python.exe -m pip install six" build_script: - - "%PYTHON%\\python.exe setup.py bdist_wheel" + - ps: "%PYTHON%\\python.exe setup.py bdist_wheel" test_script: - ps: "%PYTHON%\\Scripts\\pip.exe install --no-cache-dir --force-reinstall --ignore-installed ('dist\\' + (gci dist)[0].Name)" From 933f20805f142125b39b52d10fc8065da3e1c53d Mon Sep 17 00:00:00 2001 From: denfromufa Date: Tue, 16 Feb 2016 15:07:57 -0600 Subject: [PATCH 23/37] Update appveyor.yml --- appveyor.yml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index d32601bd4..eef89633b 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -22,14 +22,12 @@ environment: install: # We need wheel installed to build wheels - # - "%PYTHON%\\python.exe -m pip install wheel" + - ps: "%PYTHON%\\python.exe -m pip install wheel" # - "%PYTHON%\\python.exe -m pip install six" - build_script: - ps: "%PYTHON%\\python.exe setup.py bdist_wheel" - - test_script: - - ps: "%PYTHON%\\Scripts\\pip.exe install --no-cache-dir --force-reinstall --ignore-installed ('dist\\' + (gci dist)[0].Name)" - - mkdir c:\testdir - - ps: copy-item (gci -path build -re -include Python.Test.dll)[0].FullName c:\testdir - - "%PYTHON%\\python.exe src\\tests\\runtests.py" + #test_script: + # - ps: "%PYTHON%\\Scripts\\pip.exe install --no-cache-dir --force-reinstall --ignore-installed ('dist\\' + (gci dist)[0].Name)" + # - mkdir c:\testdir + # - ps: copy-item (gci -path build -re -include Python.Test.dll)[0].FullName c:\testdir + # - "%PYTHON%\\python.exe src\\tests\\runtests.py" From da58cb8721b38f98db753b32d551ead58b1e1386 Mon Sep 17 00:00:00 2001 From: denfromufa Date: Tue, 16 Feb 2016 15:12:32 -0600 Subject: [PATCH 24/37] Update appveyor.yml --- appveyor.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index eef89633b..91fb2b49b 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -22,10 +22,10 @@ environment: install: # We need wheel installed to build wheels - - ps: "%PYTHON%\\python.exe -m pip install wheel" + - %PYTHON%\python.exe -m pip install wheel # - "%PYTHON%\\python.exe -m pip install six" build_script: - - ps: "%PYTHON%\\python.exe setup.py bdist_wheel" + - %PYTHON%\python.exe setup.py bdist_wheel #test_script: # - ps: "%PYTHON%\\Scripts\\pip.exe install --no-cache-dir --force-reinstall --ignore-installed ('dist\\' + (gci dist)[0].Name)" # - mkdir c:\testdir From 08881f692396f69dff95fdc8b60dd68f76a5fdcc Mon Sep 17 00:00:00 2001 From: denfromufa Date: Tue, 16 Feb 2016 15:16:19 -0600 Subject: [PATCH 25/37] Update appveyor.yml --- appveyor.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 91fb2b49b..b9e90b672 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -19,13 +19,12 @@ environment: - PYTHON: "C:\\Python34-x64" DISTUTILS_USE_SDK: "1" - PYTHON: "C:\\Python35-x64" - install: # We need wheel installed to build wheels - - %PYTHON%\python.exe -m pip install wheel + - ps: ($env:PYTHON)\python.exe -m pip install wheel # - "%PYTHON%\\python.exe -m pip install six" build_script: - - %PYTHON%\python.exe setup.py bdist_wheel + - ps: ($env:PYTHON)\python.exe setup.py bdist_wheel #test_script: # - ps: "%PYTHON%\\Scripts\\pip.exe install --no-cache-dir --force-reinstall --ignore-installed ('dist\\' + (gci dist)[0].Name)" # - mkdir c:\testdir From 8e21ea100cde3f941db33f90b401a7bc8c9faf14 Mon Sep 17 00:00:00 2001 From: denfromufa Date: Tue, 16 Feb 2016 15:58:28 -0600 Subject: [PATCH 26/37] Update appveyor.yml --- appveyor.yml | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index b9e90b672..949a46446 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -19,14 +19,15 @@ environment: - PYTHON: "C:\\Python34-x64" DISTUTILS_USE_SDK: "1" - PYTHON: "C:\\Python35-x64" - install: - # We need wheel installed to build wheels - - ps: ($env:PYTHON)\python.exe -m pip install wheel - # - "%PYTHON%\\python.exe -m pip install six" - build_script: - - ps: ($env:PYTHON)\python.exe setup.py bdist_wheel - #test_script: - # - ps: "%PYTHON%\\Scripts\\pip.exe install --no-cache-dir --force-reinstall --ignore-installed ('dist\\' + (gci dist)[0].Name)" - # - mkdir c:\testdir - # - ps: copy-item (gci -path build -re -include Python.Test.dll)[0].FullName c:\testdir - # - "%PYTHON%\\python.exe src\\tests\\runtests.py" +install: +# We need wheel installed to build wheels +- ps: ($env:PYTHON)\python.exe -m pip install wheel +# - "%PYTHON%\\python.exe -m pip install six" +build_script: +- ps: ($env:PYTHON)\python.exe setup.py bdist_wheel + +#test_script: +# - ps: "%PYTHON%\\Scripts\\pip.exe install --no-cache-dir --force-reinstall --ignore-installed ('dist\\' + (gci dist)[0].Name)" +# - mkdir c:\testdir +# - ps: copy-item (gci -path build -re -include Python.Test.dll)[0].FullName c:\testdir +# - "%PYTHON%\\python.exe src\\tests\\runtests.py" From 0b7e3f1a1dbf33e3312bcb323230d1c06c3c4eff Mon Sep 17 00:00:00 2001 From: denfromufa Date: Tue, 16 Feb 2016 16:05:52 -0600 Subject: [PATCH 27/37] Update appveyor.yml --- appveyor.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 949a46446..013c214ea 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -19,12 +19,14 @@ environment: - PYTHON: "C:\\Python34-x64" DISTUTILS_USE_SDK: "1" - PYTHON: "C:\\Python35-x64" + install: # We need wheel installed to build wheels -- ps: ($env:PYTHON)\python.exe -m pip install wheel -# - "%PYTHON%\\python.exe -m pip install six" +- %PYTHON%\python.exe -m pip install wheel +- %PYTHON%\python.exe -m pip install six + build_script: -- ps: ($env:PYTHON)\python.exe setup.py bdist_wheel +- %PYTHON%\python.exe setup.py bdist_wheel #test_script: # - ps: "%PYTHON%\\Scripts\\pip.exe install --no-cache-dir --force-reinstall --ignore-installed ('dist\\' + (gci dist)[0].Name)" From 32859d46667e2dfa21a80d9b45c83cf301b06421 Mon Sep 17 00:00:00 2001 From: denfromufa Date: Tue, 16 Feb 2016 16:06:59 -0600 Subject: [PATCH 28/37] Update appveyor.yml --- appveyor.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 013c214ea..83a8422d6 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -22,8 +22,8 @@ environment: install: # We need wheel installed to build wheels -- %PYTHON%\python.exe -m pip install wheel -- %PYTHON%\python.exe -m pip install six +- "%PYTHON%\\python.exe -m pip install wheel" +- "%PYTHON%\\python.exe -m pip install six" build_script: - %PYTHON%\python.exe setup.py bdist_wheel From e3cca0b5ee4133d5eeef39585451762e50d6bda2 Mon Sep 17 00:00:00 2001 From: denfromufa Date: Tue, 16 Feb 2016 16:07:19 -0600 Subject: [PATCH 29/37] Update appveyor.yml --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 83a8422d6..031aa7131 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -26,7 +26,7 @@ install: - "%PYTHON%\\python.exe -m pip install six" build_script: -- %PYTHON%\python.exe setup.py bdist_wheel +- "%PYTHON%\\python.exe setup.py bdist_wheel" #test_script: # - ps: "%PYTHON%\\Scripts\\pip.exe install --no-cache-dir --force-reinstall --ignore-installed ('dist\\' + (gci dist)[0].Name)" From 593afab10f0815e0ef88d0cc79b8a91377c156fc Mon Sep 17 00:00:00 2001 From: denfromufa Date: Tue, 16 Feb 2016 21:55:15 -0600 Subject: [PATCH 30/37] Update appveyor.yml --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 031aa7131..59a6830e1 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -# os: Windows Server 2012 +os: Windows Server 2012 environment: From a0d59b7c2d24bd310f1a53cb6c828d0266754675 Mon Sep 17 00:00:00 2001 From: denfromufa Date: Tue, 16 Feb 2016 22:34:58 -0600 Subject: [PATCH 31/37] Update appveyor.yml --- appveyor.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 59a6830e1..f79510c9d 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,7 +1,9 @@ os: Windows Server 2012 environment: - + global: + PYTHONPATH: c:\testdir + PYTHONWARNINGS: 'ignore:::pip.pep425tags:' matrix: # For Python versions available on Appveyor, see @@ -28,8 +30,8 @@ install: build_script: - "%PYTHON%\\python.exe setup.py bdist_wheel" -#test_script: -# - ps: "%PYTHON%\\Scripts\\pip.exe install --no-cache-dir --force-reinstall --ignore-installed ('dist\\' + (gci dist)[0].Name)" -# - mkdir c:\testdir -# - ps: copy-item (gci -path build -re -include Python.Test.dll)[0].FullName c:\testdir -# - "%PYTHON%\\python.exe src\\tests\\runtests.py" +test_script: + - ps: "%PYTHON%\\Scripts\\pip.exe install --no-cache-dir --force-reinstall --ignore-installed ('dist\\' + (gci dist)[0].Name)" + - mkdir c:\testdir + - ps: copy-item (gci -path build -re -include Python.Test.dll)[0].FullName c:\testdir + - "%PYTHON%\\python.exe src\\tests\\runtests.py" From 0d2b8468984e5e67d92b770078f600621f89188a Mon Sep 17 00:00:00 2001 From: denfromufa Date: Tue, 16 Feb 2016 23:22:54 -0600 Subject: [PATCH 32/37] Update appveyor.yml --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index f79510c9d..5c636dbb5 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -31,7 +31,7 @@ build_script: - "%PYTHON%\\python.exe setup.py bdist_wheel" test_script: - - ps: "%PYTHON%\\Scripts\\pip.exe install --no-cache-dir --force-reinstall --ignore-installed ('dist\\' + (gci dist)[0].Name)" + - ps: "$env:PYTHON\\Scripts\\pip.exe install --no-cache-dir --force-reinstall --ignore-installed ('dist\\' + (gci dist)[0].Name)" - mkdir c:\testdir - ps: copy-item (gci -path build -re -include Python.Test.dll)[0].FullName c:\testdir - "%PYTHON%\\python.exe src\\tests\\runtests.py" From 1fe46b62adc2d8f9093612606da39bf9965b4e20 Mon Sep 17 00:00:00 2001 From: denfromufa Date: Tue, 16 Feb 2016 23:29:08 -0600 Subject: [PATCH 33/37] Update appveyor.yml --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 5c636dbb5..f5f73ec8f 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -31,7 +31,7 @@ build_script: - "%PYTHON%\\python.exe setup.py bdist_wheel" test_script: - - ps: "$env:PYTHON\\Scripts\\pip.exe install --no-cache-dir --force-reinstall --ignore-installed ('dist\\' + (gci dist)[0].Name)" + - ps: $env:PYTHON\\Scripts\\pip.exe install --no-cache-dir --force-reinstall --ignore-installed ('dist\\' + (gci dist)[0].Name) - mkdir c:\testdir - ps: copy-item (gci -path build -re -include Python.Test.dll)[0].FullName c:\testdir - "%PYTHON%\\python.exe src\\tests\\runtests.py" From 537a31550fdaf449058f9280703ac5e715254977 Mon Sep 17 00:00:00 2001 From: denfromufa Date: Wed, 17 Feb 2016 00:07:21 -0600 Subject: [PATCH 34/37] Update appveyor.yml --- appveyor.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index f5f73ec8f..3edd8a991 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -31,7 +31,9 @@ build_script: - "%PYTHON%\\python.exe setup.py bdist_wheel" test_script: - - ps: $env:PYTHON\\Scripts\\pip.exe install --no-cache-dir --force-reinstall --ignore-installed ('dist\\' + (gci dist)[0].Name) + - cd "%PYTHON%" + - ps: Scripts\pip.exe install --no-cache-dir --force-reinstall --ignore-installed ('..\\dist\\' + (gci ..\dist)[0].Name) + - cd.. - mkdir c:\testdir - ps: copy-item (gci -path build -re -include Python.Test.dll)[0].FullName c:\testdir - "%PYTHON%\\python.exe src\\tests\\runtests.py" From 52fcbbbf6aa546ad0d3ac7ea7b128d6827dc881e Mon Sep 17 00:00:00 2001 From: denfromufa Date: Wed, 17 Feb 2016 00:13:42 -0600 Subject: [PATCH 35/37] Update appveyor.yml --- appveyor.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 3edd8a991..ea43801c2 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -32,8 +32,9 @@ build_script: test_script: - cd "%PYTHON%" - - ps: Scripts\pip.exe install --no-cache-dir --force-reinstall --ignore-installed ('..\\dist\\' + (gci ..\dist)[0].Name) - - cd.. + - ps: Scripts\pip.exe install --no-cache-dir --force-reinstall --ignore-installed ('C:\\projects\\pythonnet\\dist\\' + + (gci C:\projects\pythonnet\dist)[0].Name) + - cd C:\projects\pythonnet - mkdir c:\testdir - ps: copy-item (gci -path build -re -include Python.Test.dll)[0].FullName c:\testdir - "%PYTHON%\\python.exe src\\tests\\runtests.py" From 756aaa05f442ba658fedd775d6b89b591ef6f5be Mon Sep 17 00:00:00 2001 From: denfromufa Date: Wed, 17 Feb 2016 00:14:53 -0600 Subject: [PATCH 36/37] Update appveyor.yml --- appveyor.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index ea43801c2..8b0b939d1 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -32,8 +32,7 @@ build_script: test_script: - cd "%PYTHON%" - - ps: Scripts\pip.exe install --no-cache-dir --force-reinstall --ignore-installed ('C:\\projects\\pythonnet\\dist\\' + - (gci C:\projects\pythonnet\dist)[0].Name) + - ps: Scripts\pip.exe install --no-cache-dir --force-reinstall --ignore-installed ('C:\\projects\\pythonnet\\dist\\' + (gci C:\projects\pythonnet\dist)[0].Name) - cd C:\projects\pythonnet - mkdir c:\testdir - ps: copy-item (gci -path build -re -include Python.Test.dll)[0].FullName c:\testdir From 5986077693b1f4258dc4ff7b70ede2bd91ae4200 Mon Sep 17 00:00:00 2001 From: denfromufa Date: Wed, 17 Feb 2016 00:19:00 -0600 Subject: [PATCH 37/37] Update appveyor.yml --- appveyor.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/appveyor.yml b/appveyor.yml index 8b0b939d1..f34a03f40 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -24,6 +24,7 @@ environment: install: # We need wheel installed to build wheels +- "%PYTHON%\\python -m pip install --upgrade pip" - "%PYTHON%\\python.exe -m pip install wheel" - "%PYTHON%\\python.exe -m pip install six"