vallis / libstempo

libstempo — a Python wrapper for tempo2
MIT License
29 stars 33 forks source link

Cython errors when installing #53

Closed rossjjennings closed 1 month ago

rossjjennings commented 1 year ago

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.

mattpitkin commented 11 months ago

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

rossjjennings commented 11 months ago

@mattpitkin Sounds good to me.