scs-python
scs-python copied to clipboard
ENH: Free threading support
Closes #130.
Local tests via:
uv venv --python 3.13t .ftci
source .ftci/bin/activate
uv pip install numpy scipy pytest-timeout pytest-durations pytest-run-parallel
uv pip install -v .
uv run --no-project python -m pytest --parallel-threads=2 --iterations=2 -v -s --timeout=600 --durations=10 -m "not thread_unsafe" test
Basically follows the porting extensions advice:
- Vendored
pythoncapi-compat - Didn't rework
Get*calls to useGet*Refhere since they're uses of argument parsing (xref C-API documentation) - Locks access to the C library, using an instance lock and a global lock (for memory allocations)
EDIT: After the split into #132 and #133 to test this for now one needs to manually setup the pythoncapi-compat bit.
Unlike #130, tests pass here https://github.com/bodono/scs-python/actions/runs/15374887139/job/43258511781?pr=1312
Thanks for taking this on! Let me know when you think it is ready to merge!