I am using python free threading support build version 3.13.1t. When I pip install lxml --pre
which installs the latest lxml version 5.3.0, the build fails in a way similar to how other packages which do not support free threading fail with this error:
clang -fno-strict-overflow -Wsign-compare -Wunreachable-code -DNDEBUG -g -O3 -Wall -DCYTHON_CLINE_IN_TRACEBACK=0 -I/opt/local/include/libxml2 -I/opt/local/include -Isrc -Isrc/lxml/includes -I/Users/jj/src/lxml/.venv/include -I/Users/jj/.pyenv/versions/3.13.1t/include/python3.13t -c src/lxml/etree.c -o build/temp.macosx-15.1-arm64-cpython-313t/src/lxml/etree.o -w -flat_namespace
src/lxml/etree.c:7210:80: error: unknown type name '__pyx_vectorcallfunc'; did you mean 'vectorcallfunc'?
The lxml docs claim to "generally support" the "free threading" mode:
As of Python 3.13.1, lxml generally supports the "free threading" mode, which means you can use lxml with a Python build where the Global Interpreter Lock (GIL) is disabled, although there might be some caveats and potential issues depending on your specific usage and the complexity of your XML parsing tasks; it's important to be aware of potential synchronization issues when using lxml in a free-threaded environment as not all operations within lxml are inherently thread-safe.
Is there some way to get lxml working with the python free threading 3.13.1t build?