From e51ee696f7c79a366bc6f89fb2397d15e0bfd74b Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Jun 26 2007 13:19:50 +0000 Subject: - Update to 0.9.5.1a - Remove Pyrex-0.9.4-fix-indent.patch (fixed upstream). - Remove pyrex-python-2.5.patch (fixed upstream). --- diff --git a/.cvsignore b/.cvsignore index bcc571e..eda704f 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1,3 +1 @@ -Pyrex-0.9.3.tar.gz -Pyrex-0.9.3.1.tar.gz -Pyrex-0.9.4.tar.gz +Pyrex-0.9.5.1a.tar.gz diff --git a/Pyrex-0.9.4-fix-indent.patch b/Pyrex-0.9.4-fix-indent.patch deleted file mode 100644 index 62bc844..0000000 --- a/Pyrex-0.9.4-fix-indent.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- Pyrex-0.9.4/Pyrex/Distutils/build_ext.py.fix-indent 2006-04-19 16:52:58.000000000 -0400 -+++ Pyrex-0.9.4/Pyrex/Distutils/build_ext.py 2006-04-19 16:53:44.000000000 -0400 -@@ -65,7 +65,7 @@ - return [replace_suffix(src, suffix) for src in pyx_sources] + other_sources - - def pyrex_compile(self, source): -- options = CompilationOptions(default_options, -+ options = CompilationOptions(default_options, - include_path = self.include_dirs) - result = compile(source, options) - if result.num_errors <> 0: diff --git a/Pyrex.spec b/Pyrex.spec index a8c5a27..869e7e2 100644 --- a/Pyrex.spec +++ b/Pyrex.spec @@ -1,8 +1,8 @@ %{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} Name: Pyrex -Version: 0.9.4 -Release: 4%{?dist} +Version: 0.9.5.1a +Release: 1%{?dist} Epoch: 0 BuildArch: noarch Summary: A compiler/language for writing Python extension modules. @@ -11,8 +11,6 @@ License: Public Domain URL: http://www.cosc.canterbury.ac.nz/~greg/python/Pyrex/ Source0: http://www.cosc.canterbury.ac.nz/~greg/python/Pyrex/Pyrex-%{version}.tar.gz -Patch0: Pyrex-0.9.4-fix-indent.patch -Patch1: pyrex-python-2.5.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: python-devel @@ -33,8 +31,6 @@ code. %prep %setup -q -%patch0 -p1 -b .fix-indent -%patch1 -p0 -b .python25 %build python setup.py build @@ -59,13 +55,19 @@ rm -rf $RPM_BUILD_ROOT %doc USAGE.txt README.txt CHANGES.txt ToDo.txt Demos Doc %defattr(-,root,root,-) -%{python_sitelib}/Pyrex/Plex/*.pyo %{python_sitelib}/Pyrex/*.pyo %{python_sitelib}/Pyrex/Compiler/*.pyo %{python_sitelib}/Pyrex/Distutils/*.pyo +%{python_sitelib}/Pyrex/Plex/*.pyo +%{python_sitelib}/Pyrex/Unix/*.pyo %exclude %{python_sitelib}/Pyrex/Mac %changelog +* Tue Jun 26 2007 Matthew Barnes - 0:0.9.5.1a-1.fc8 +- Update to 0.9.5.1a +- Remove Pyrex-0.9.4-fix-indent.patch (fixed upstream). +- Remove pyrex-python-2.5.patch (fixed upstream). + * Wed Jan 3 2007 David Zeuthen - 0:0.9.4-4%{?dist} - include a patch so Pyrex works with python 2.5 diff --git a/pyrex-python-2.5.patch b/pyrex-python-2.5.patch deleted file mode 100644 index dc68744..0000000 --- a/pyrex-python-2.5.patch +++ /dev/null @@ -1,355 +0,0 @@ -Index: Pyrex/Compiler/PyrexTypes.py -=================================================================== ---- Pyrex/Compiler/PyrexTypes.py (Revision 133) -+++ Pyrex/Compiler/PyrexTypes.py (Arbeitskopie) -@@ -293,8 +293,8 @@ - default_value = "0" - - parsetuple_formats = ( # rank -> format -- "?HIkK???", # unsigned -- "chilLfd?", # signed -+ "?HIkK????", # unsigned -+ "chilL?fd?", # signed - ) - - def __init__(self, rank, signed = 1, pymemberdef_typecode = None): -@@ -340,6 +340,12 @@ - self.is_returncode = is_returncode - - -+class CPySSizeTType(CIntType): -+ -+ to_py_function = "PyInt_FromSsize_t" -+ from_py_function = "PyInt_AsSsize_t" -+ -+ - class CUIntType(CIntType): - - to_py_function = "PyLong_FromUnsignedLong" -@@ -699,6 +705,7 @@ - c_int_type = CIntType(2, 1, "T_INT") - c_long_type = CIntType(3, 1, "T_LONG") - c_longlong_type = CLongLongType(4, 1, "T_LONGLONG") -+c_py_ssize_t_type = CPySSizeTType(5, 1) - - c_uchar_type = CIntType(0, 0, "T_UBYTE") - c_ushort_type = CIntType(1, 0, "T_USHORT") -@@ -706,9 +713,9 @@ - c_ulong_type = CULongType(3, 0, "T_ULONG") - c_ulonglong_type = CULongLongType(4, 0, "T_ULONGLONG") - --c_float_type = CFloatType(5, "T_FLOAT") --c_double_type = CFloatType(6, "T_DOUBLE") --c_longdouble_type = CFloatType(7) -+c_float_type = CFloatType(6, "T_FLOAT") -+c_double_type = CFloatType(7, "T_DOUBLE") -+c_longdouble_type = CFloatType(8) - - c_null_ptr_type = CNullPtrType(c_void_type) - c_char_array_type = CCharArrayType(None) -@@ -720,7 +727,7 @@ - - error_type = ErrorType() - --lowest_float_rank = 5 -+lowest_float_rank = 6 - - rank_to_type_name = ( - "char", # 0 -@@ -728,9 +735,10 @@ - "int", # 2 - "long", # 3 - "PY_LONG_LONG", # 4 -- "float", # 5 -- "double", # 6 -- "long double", # 7 -+ "Py_ssize_t", # 5 -+ "float", # 6 -+ "double", # 7 -+ "long double", # 8 - ) - - sign_and_rank_to_type = { -@@ -745,9 +753,10 @@ - (1, 2): c_int_type, - (1, 3): c_long_type, - (1, 4): c_longlong_type, -- (1, 5): c_float_type, -- (1, 6): c_double_type, -- (1, 7): c_longdouble_type, -+ (1, 5): c_py_ssize_t_type, -+ (1, 6): c_float_type, -+ (1, 7): c_double_type, -+ (1, 8): c_longdouble_type, - } - - modifiers_and_name_to_type = { -@@ -763,6 +772,7 @@ - (1, 0, "int"): c_int_type, - (1, 1, "int"): c_long_type, - (1, 2, "int"): c_longlong_type, -+ (1, 0, "Py_ssize_t"): c_py_ssize_t_type, - (1, 0, "float"): c_float_type, - (1, 0, "double"): c_double_type, - (1, 1, "double"): c_longdouble_type, -Index: Pyrex/Compiler/Parsing.py -=================================================================== ---- Pyrex/Compiler/Parsing.py (Revision 133) -+++ Pyrex/Compiler/Parsing.py (Arbeitskopie) -@@ -1257,7 +1257,7 @@ - # "void", "signed", "unsigned" - #) - --basic_c_type_names = ("void", "char", "int", "float", "double") -+basic_c_type_names = ("void", "char", "int", "float", "double", "Py_ssize_t") - - sign_and_longness_words = ("short", "long", "signed", "unsigned") - -Index: Pyrex/Compiler/TypeSlots.py -=================================================================== ---- Pyrex/Compiler/TypeSlots.py (Revision 133) -+++ Pyrex/Compiler/TypeSlots.py (Arbeitskopie) -@@ -26,6 +26,7 @@ - # 'i' int - # 'I' int * - # 'l' long -+ # 'Z' Py_ssize_t - # 's' char * - # 'S' char ** - # 'r' int used only to signal exception -@@ -42,6 +43,7 @@ - 'i': PyrexTypes.c_int_type, - 'I': PyrexTypes.c_int_ptr_type, - 'l': PyrexTypes.c_long_type, -+ 'Z': PyrexTypes.c_py_ssize_t_type, - 's': PyrexTypes.c_char_ptr_type, - 'S': PyrexTypes.c_char_ptr_ptr_type, - 'r': PyrexTypes.c_returncode_type, -@@ -354,18 +356,30 @@ - iternaryfunc = Signature("TOO", "O") # typedef PyObject * (*ternaryfunc)(PyObject *, PyObject *, PyObject *); - callfunc = Signature("T*", "O") # typedef PyObject * (*ternaryfunc)(PyObject *, PyObject *, PyObject *); - inquiry = Signature("T", "i") # typedef int (*inquiry)(PyObject *); -+lenfunc = Signature("T", "Z") # typedef Py_ssize_t (*lenfunc)(PyObject *); -+ - # typedef int (*coercion)(PyObject **, PyObject **); - intargfunc = Signature("Ti", "O") # typedef PyObject *(*intargfunc)(PyObject *, int); -+ssizeargfunc = Signature("TZ", "O") # typedef PyObject *(*ssizeargfunc)(PyObject *, Py_ssize_t); - intintargfunc = Signature("Tii", "O") # typedef PyObject *(*intintargfunc)(PyObject *, int, int); -+ssizessizeargfunc = Signature("TZZ", "O") # typedef PyObject *(*ssizessizeargfunc)(PyObject *, Py_ssize_t, Py_ssize_t); - intobjargproc = Signature("TiO", 'r') # typedef int(*intobjargproc)(PyObject *, int, PyObject *); -+ssizeobjargproc = Signature("TZO", 'r') # typedef int(*ssizeobjargproc)(PyObject *, Py_ssize_t, PyObject *); - intintobjargproc = Signature("TiiO", 'r') # typedef int(*intintobjargproc)(PyObject *, int, int, PyObject *); -+ssizessizeobjargproc = Signature("TZZO", 'r') # typedef int(*ssizessizeobjargproc)(PyObject *, Py_ssize_t, Py_ssize_t, PyObject *); -+ - intintargproc = Signature("Tii", 'r') -+ssizessizeargproc = Signature("TZZ", 'r') - objargfunc = Signature("TO", "O") - objobjargproc = Signature("TOO", 'r') # typedef int (*objobjargproc)(PyObject *, PyObject *, PyObject *); - getreadbufferproc = Signature("TiP", 'i') # typedef int (*getreadbufferproc)(PyObject *, int, void **); - getwritebufferproc = Signature("TiP", 'i') # typedef int (*getwritebufferproc)(PyObject *, int, void **); - getsegcountproc = Signature("TI", 'i') # typedef int (*getsegcountproc)(PyObject *, int *); - getcharbufferproc = Signature("TiS", 'i') # typedef int (*getcharbufferproc)(PyObject *, int, const char **); -+readbufferproc = Signature("TZP", "Z") # typedef Py_ssize_t (*readbufferproc)(PyObject *, Py_ssize_t, void **); -+writebufferproc = Signature("TZP", "Z") # typedef Py_ssize_t (*writebufferproc)(PyObject *, Py_ssize_t, void **); -+segcountproc = Signature("TZ", "Z") # typedef Py_ssize_t (*segcountproc)(PyObject *, Py_ssize_t *); -+writebufferproc = Signature("TZS", "Z") # typedef Py_ssize_t (*charbufferproc)(PyObject *, Py_ssize_t, char **); - objargproc = Signature("TO", 'r') # typedef int (*objobjproc)(PyObject *, PyObject *); - # typedef int (*visitproc)(PyObject *, void *); - # typedef int (*traverseproc)(PyObject *, visitproc, void *); -@@ -454,14 +468,17 @@ - MethodSlot(binaryfunc, "nb_true_divide", "__truediv__"), - MethodSlot(ibinaryfunc, "nb_inplace_floor_divide", "__ifloordiv__"), - MethodSlot(ibinaryfunc, "nb_inplace_true_divide", "__itruediv__"), -+ -+ # Added in release 2.5 -+# MethodSlot(lenfunc, "nb_index", "??"), - ) - - PySequenceMethods = ( -- MethodSlot(inquiry, "sq_length", "__len__"), # EmptySlot("sq_length"), # mp_length used instead -+ MethodSlot(lenfunc, "sq_length", "__len__"), # EmptySlot("sq_length"), # mp_length used instead - EmptySlot("sq_concat"), # nb_add used instead - EmptySlot("sq_repeat"), # nb_multiply used instead - SyntheticSlot("sq_item", ["__getitem__"], "0"), #EmptySlot("sq_item"), # mp_subscript used instead -- MethodSlot(intintargfunc, "sq_slice", "__getslice__"), -+ MethodSlot(ssizessizeargfunc, "sq_slice", "__getslice__"), - EmptySlot("sq_ass_item"), # mp_ass_subscript used instead - SyntheticSlot("sq_ass_slice", ["__setslice__", "__delslice__"], "0"), - MethodSlot(cmpfunc, "sq_contains", "__contains__"), -@@ -470,7 +487,7 @@ - ) - - PyMappingMethods = ( -- MethodSlot(inquiry, "mp_length", "__len__"), -+ MethodSlot(lenfunc, "mp_length", "__len__"), - MethodSlot(objargfunc, "mp_subscript", "__getitem__"), - SyntheticSlot("mp_ass_subscript", ["__setitem__", "__delitem__"], "0"), - ) -@@ -565,8 +582,8 @@ - MethodSlot(destructor, "", "__dealloc__") - MethodSlot(objobjargproc, "", "__setitem__") - MethodSlot(objargproc, "", "__delitem__") --MethodSlot(intintobjargproc, "", "__setslice__") --MethodSlot(intintargproc, "", "__delslice__") -+MethodSlot(ssizessizeobjargproc, "", "__setslice__") -+MethodSlot(ssizessizeargproc, "", "__delslice__") - MethodSlot(getattrofunc, "", "__getattr__") - MethodSlot(setattrofunc, "", "__setattr__") - MethodSlot(delattrofunc, "", "__delattr__") -Index: Pyrex/Compiler/ExprNodes.py -=================================================================== ---- Pyrex/Compiler/ExprNodes.py (Revision 133) -+++ Pyrex/Compiler/ExprNodes.py (Arbeitskopie) -@@ -1035,7 +1035,7 @@ - self.type = PyrexTypes.error_type - if self.index.type.is_pyobject: - self.index = self.index.coerce_to( -- PyrexTypes.c_int_type, env) -+ PyrexTypes.c_py_ssize_t_type, env) - if not self.index.type.is_int: - error(self.pos, - "Invalid index type '%s'" % -@@ -1107,7 +1107,7 @@ - if self.stop: - self.stop.analyse_types(env) - self.base = self.base.coerce_to_pyobject(env) -- c_int = PyrexTypes.c_int_type -+ c_int = PyrexTypes.c_py_ssize_t_type - if self.start: - self.start = self.start.coerce_to(c_int, env) - if self.stop: -@@ -1157,7 +1157,7 @@ - if self.stop: - return self.stop.result_code - else: -- return "0x7fffffff" -+ return "PY_SSIZE_T_MAX" - - def calculate_result_code(self): - # self.result_code is not used, but this method must exist -@@ -3101,7 +3101,7 @@ - PyErr_SetString(PyExc_ValueError, "unpack sequence of wrong size"); - } - --static PyObject *__Pyx_UnpackItem(PyObject *seq, int i) { -+static PyObject *__Pyx_UnpackItem(PyObject *seq, Py_ssize_t i) { - PyObject *item; - if (!(item = PySequence_GetItem(seq, i))) { - if (PyErr_ExceptionMatches(PyExc_IndexError)) -@@ -3110,7 +3110,7 @@ - return item; - } - --static int __Pyx_EndUnpack(PyObject *seq, int i) { -+static int __Pyx_EndUnpack(PyObject *seq, Py_ssize_t i) { - PyObject *item; - if (item = PySequence_GetItem(seq, i)) { - Py_DECREF(item); -Index: Pyrex/Compiler/Nodes.py -=================================================================== ---- Pyrex/Compiler/Nodes.py (Revision 133) -+++ Pyrex/Compiler/Nodes.py (Arbeitskopie) -@@ -199,11 +199,19 @@ - code.putln('/* Generated by Pyrex %s on %s */' % ( - Version.version, time.asctime())) - code.putln('') -+ code.putln('#define PY_SSIZE_T_CLEAN') - for filename in env.python_include_files: - code.putln('#include "%s"' % filename) - code.putln("#ifndef PY_LONG_LONG") - code.putln(" #define PY_LONG_LONG LONG_LONG") - code.putln("#endif") -+ code.putln("#if PY_VERSION_HEX < 0x02050000") -+ code.putln(" typedef int Py_ssize_t;") -+ code.putln(" #define PY_SSIZE_T_MAX INT_MAX") -+ code.putln(" #define PY_SSIZE_T_MIN INT_MIN") -+ code.putln(" #define PyInt_FromSsize_t(z) PyInt_FromLong(z)") -+ code.putln(" #define PyInt_AsSsize_t(o) PyInt_AsLong(o)") -+ code.putln("#endif") - self.generate_extern_c_macro_definition(code) - code.putln("%s double pow(double, double);" % Naming.extern_c_macro) - self.generate_includes(env, cimported_modules, code) -@@ -624,12 +632,12 @@ - # a __getitem__ method is present. It converts its - # argument to a Python integer and calls mp_subscript. - code.putln( -- "static PyObject *%s(PyObject *o, int i) {" % -+ "static PyObject *%s(PyObject *o, Py_ssize_t i) {" % - scope.mangle_internal("sq_item")) - code.putln( - "PyObject *r;") - code.putln( -- "PyObject *x = PyInt_FromLong(i); if(!x) return 0;") -+ "PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;") - code.putln( - "r = o->ob_type->tp_as_mapping->mp_subscript(o, x);") - code.putln( -@@ -715,7 +723,7 @@ - del_entry = scope.lookup_here("__delslice__") - code.putln("") - code.putln( -- "static int %s(PyObject *o, int i, int j, PyObject *v) {" % -+ "static int %s(PyObject *o, Py_ssize_t i, Py_ssize_t j, PyObject *v) {" % - scope.mangle_internal("sq_ass_slice")) - code.putln( - "if (v) {") -@@ -3542,8 +3550,8 @@ - """ - typedef struct {PyObject **p; char *s;} __Pyx_InternTabEntry; /*proto*/ - typedef struct {PyObject **p; char *s; long n;} __Pyx_StringTabEntry; /*proto*/ --static PyObject *__Pyx_UnpackItem(PyObject *, int); /*proto*/ --static int __Pyx_EndUnpack(PyObject *, int); /*proto*/ -+static PyObject *__Pyx_UnpackItem(PyObject *, Py_ssize_t); /*proto*/ -+static int __Pyx_EndUnpack(PyObject *, Py_ssize_t); /*proto*/ - static int __Pyx_PrintItem(PyObject *); /*proto*/ - static int __Pyx_PrintNewline(void); /*proto*/ - static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ -@@ -3553,7 +3561,7 @@ - static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, char *name); /*proto*/ - static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/ - static int __Pyx_GetStarArgs(PyObject **args, PyObject **kwds,\ -- char *kwd_list[], int nargs, PyObject **args2, PyObject **kwds2); /*proto*/ -+ char *kwd_list[], Py_ssize_t nargs, PyObject **args2, PyObject **kwds2); /*proto*/ - static void __Pyx_WriteUnraisable(char *name); /*proto*/ - static void __Pyx_AddTraceback(char *funcname); /*proto*/ - static PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name, long size); /*proto*/ -@@ -3595,7 +3603,7 @@ - return -1; - if (PyString_Check(v)) { - char *s = PyString_AsString(v); -- int len = PyString_Size(v); -+ Py_ssize_t len = PyString_Size(v); - if (len > 0 && - isspace(Py_CHARMASK(s[len-1])) && - s[len-1] != ' ') -@@ -3650,7 +3658,7 @@ - } - if (PyString_Check(type)) - ; -- else if (PyClass_Check(type)) -+ else if (PyType_Check(type) || PyClass_Check(type)) - ; /*PyErr_NormalizeException(&type, &value, &tb);*/ - else if (PyInstance_Check(type)) { - /* Raising an instance. The value should be a dummy. */ -@@ -3739,7 +3747,7 @@ - PyObject **args, - PyObject **kwds, - char *kwd_list[], -- int nargs, -+ Py_ssize_t nargs, - PyObject **args2, - PyObject **kwds2) - { -@@ -3799,10 +3807,8 @@ - bad: - Py_XDECREF(args1); - Py_XDECREF(kwds1); -- if (*args2) -- Py_XDECREF(*args2); -- if (*kwds2) -- Py_XDECREF(*kwds2); -+ Py_XDECREF(*args2); -+ Py_XDECREF(*kwds2); - return -1; - } - """ diff --git a/sources b/sources index 6683d81..68598b1 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -9afab3de2dd16da97f482b2dc16fdd46 Pyrex-0.9.4.tar.gz +0132c5cd2f8685e4948fb14dcb65f637 Pyrex-0.9.5.1a.tar.gz