wwaites / py4s

Python bindings via C for 4store
http://pypi.python.org/pypi/py4s
GNU General Public License v3.0
16 stars 8 forks source link

Cannot build py4s on Ubuntu Lucid #3

Open stawo opened 13 years ago

stawo commented 13 years ago

Hi, I have some problems in building py4s on Ubuntu Lucid Lynx LTS. This is what I've done: 1) installed Cython with the command >>>sudo easy_install cython 2) copied the source code of 4store in the same folder where the folder py4s is 3) build py4s with the command >>>python install.py build

The building process fails and return this error:

cythoning _py4s.pyx to _py4s.c

Error converting Pyrex file to C:
------------------------------------------------------------
...
cdef class _Cursor:
    cdef py4s.fsp_link *_link
    cdef py4s.fs_query_state *_qs
    cdef py4s.fs_query *_qr
    cdef char *_query
    cdef bool _transaction
        ^
------------------------------------------------------------

'bool' is not a type identifier

Could you help me out?

stawo commented 13 years ago

Ok, it seems I found the problem. The latest version of Cython is Cython 0.13 and straight from the release notes comes this: "bool is no longer a valid type name by default. The problem is that it's not clear whether bool should refer to the Python type or the C++ type, and expecting one and finding the other has already led to several hard-to-find bugs. Both types are available for importing: you can use from cpython cimport bool for the Python bool type, and from libcpp cimport bool for the C++ type. bool is still a valid object by default, so one can still write bool(x)." (http://wiki.cython.org/ReleaseNotes-0.13)

So all I had to do was to add

from cpython cimport bool

to _py4s.pyx and Bob's your uncle! :)