libstempo icon indicating copy to clipboard operation
libstempo copied to clipboard

Cython errors when installing

Open rossjjennings opened this issue 1 year ago • 2 comments

Cloning the git repository and installing libstempo with pip install . is giving me a bunch of Cython errors like

Error compiling Cython file:
------------------------------------------------------------
...
cdef class tempopulsar:
    """tempopulsar(parfile, timfile=None, warnings=False, fixprefiterrors=True,
                   dofit=False, maxobs=None, units=False, ephem=None, t2cmethod=None,
                   toas=None, toaerrs=None, observatory=None, obsfreq=1400)"""

    cpdef public object parfile
          ^
------------------------------------------------------------

libstempo/libstempo.pyx:627:10: Variables cannot be declared with 'cpdef'. Use 'cdef' instead.

This appears to be due to a change in Cython 3.0, released today(!). See here.

For now, changing "Cython>=0.22" to "Cython>=0.22,<3.0" in pyproject.toml seems to work. But a better long-term solution might be to change some cpdef statements to cdef.

rossjjennings avatar Jul 17 '23 16:07 rossjjennings

@rossjjennings I guess thus can be closed now that #54 has been merged.

mattpitkin avatar Oct 09 '23 15:10 mattpitkin

@mattpitkin Sounds good to me.

rossjjennings avatar Oct 09 '23 17:10 rossjjennings