jswhit / pygrib

Python interface for reading and writing GRIB data
https://jswhit.github.io/pygrib
MIT License
319 stars 93 forks source link

Build failure with Cython > 0.29 #238

Open waarmond opened 2 months ago

waarmond commented 2 months ago

I'm on Python 3.10, gcc 13.2.1 and Linux of course. Cython 0.29 works, more modern version fail:

[1/1] Cythonizing src/pygrib/_pygrib.pyx
/usr/lib/python3.10/site-packages/Cython/Compiler/Main.py:373: FutureWarning: Cython directive 'language_level' not set, using '3' (Py3). File: ./pygrib/src/pygrib/_pygrib.pyx
  tree = Parsing.p_module(s, pxd, full_module_name)
warning: src/pygrib/_pygrib.pyx:353:12: Unreachable code

Error compiling Cython file:
------------------------------------------------------------
...
            beg, end, inc = key.indices(self.messages)
            msg = self.tell()
            grbs = [self.message(n) for n in xrange(beg,end,inc)]
            self.seek(msg) # put iterator back in original position
            return grbs
        elif type(key) == int or type(key) == long:
                                              ^
------------------------------------------------------------

src/pygrib/_pygrib.pyx:413:46: undeclared name not builtin: long
[..]
jswhit commented 2 months ago

I don't see this on macos x or linux.