Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Phillyclause89 opened this issue Apr 26, 2025 · 0 comments

Comments

@Phillyclause89
Copy link

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant