Description
Hi there π
First off, thank you for maintaining python-tcod
β it's a really valuable library for roguelike development!
I've been experimenting with Python 3.13's new --disable-gil
feature (based on the free-threaded no-GIL branch), and I wanted to see how well python-tcod
builds and works in that environment.
π What I tried:
-
Cloned the repository and initialized submodules.
-
Patched
build_libtcod.py
to conditionally skipPy_LIMITED_API
whenPy_GIL_DISABLED
is detected viasysconfig.get_config_var("Py_GIL_DISABLED")
. -
Removed
py-limited-api
entries frompyproject.toml
. -
Attempted to install in editable mode with:
pip install -e .
β οΈ What fails:
The build still fails due to low-level C header issues during the CFFI extension build:
error: "The limited API is not currently supported in the free-threaded build"
error: unknown type name 'PyMutex'
error: call to undeclared function '_Py_atomic_*'
π§ My understanding:
It seems that, despite disabling Py_LIMITED_API
, some core Python headers or assumptions in libtcod
or tcod._libtcod
still expect GIL-based behavior and are not currently compatible with the free-threaded interpreter.
π€ Feature Request:
Would it be possible to support building python-tcod
on GIL-disabled Python versions in the future?
Even limited or experimental support (e.g. via conditional compilation) would be amazing for those of us exploring Python's no-GIL future.
But I cannot judge the effort.