python-chess icon indicating copy to clipboard operation
python-chess copied to clipboard

Reconsider Cython support as an Optional feature accessible from setup.py

Open Phillyclause89 opened this issue 8 months ago • 0 comments

This issue relates to #722: Rust or Cython to speed up core components. I have been doing my own testing of compiling the python-chess lib with Cython as documented here:

https://github.com/Phillyclause89/ChessMoveHeatmap/tree/main/tests/CythonBenchmarkingResults

I don't think python-chess should go out of it's way to support Cython, but I think it is at least worth a callout in the setup documentation that users are free to self-compile the lib (or parts of it) with Cython thus risking unintended, untested and undocumented consequences for the reward of possibly faster runtimes.

python-chess could even update the setup.py to have an optional flag to do this compiling on the user's behalf if they so chose. That is kind of what I went with in my own setup.py: https://github.com/Phillyclause89/ChessMoveHeatmap/blob/main/setup.py

From the python-chess lib version 1.10.0 that I've locked myself into for the time being, only the _interactive.py had failures compiling and I'm not even seeing that file in your latest release versions... Could be you moved the failing code to some other file that now needs to be excluded in such a setup ¯\_(ツ)_/¯

TLDR: Don't support Cython officially, but update docs to suggest it as a possible option to users who like debugging stuff...

Phillyclause89 avatar Apr 26 '25 19:04 Phillyclause89