Closed penguinpee closed 4 months ago
This project is using a lazily-evaluated proxy for the numpy
include path:
https://github.com/mariomulansky/PySpike/blob/master/setup.py#L24-L28
The class is instantiated in the include_dirs
list, and then the numpy
import and the call to numpy.get_include()
are supposed to happen when the instance gets “stringified” as in str(foo)
or '{}'.format(foo)
.
https://github.com/mariomulansky/PySpike/blob/master/setup.py#L90
Unfortunately, current versions of Cython don’t just blindly convert anything in the sequence of include directories to a string, but validate it against a list of supported types, thus:
TypeError: expected str, bytes or os.PathLike object, not numpy_include
A simple downstream patch would be to just replace numpy_include()
with str(numpy_include())
to force immediate evaluation, since we can guarantee that numpy
is already available in the environment.
To maintain the original behavior, though, we can adjust numpy_include
to be an instance of os.PathLike
. That should fix Cython 3 compatibility in a backwards-compatible way. I’ll open a PR.
Hmm: https://github.com/mariomulansky/PySpike/pull/68 is exactly what I was going to do, except that I was going to replace __str__()
with __fspath__()
. I opened my own version of the PR anyway; either is fine.
Fedora has updated to Cython 3.x in rawhide (development branch) and f39. It seems
PySpike
is not ready yet for Cython 3.x: