NumPy now supports Python 3.12 by radarhere · Pull Request #7403 · python-pillow/Pillow
I've added commits to fix building on PyPy 3.10 in the meanwhile.
As for Python 3.9 on Cygwin, the initial error is "Failed to build ninja".
Installing that, I get "No BLAS library detected! Install one, or use the allow-noblas build option".
https://stackoverflow.com/questions/73659464/does-openblas-devel-exist-for-cygwin tells me that there is no devel openblas package for Cygwin, so I attempted to use 'allow-noblas'.
To do this, numpy/numpy#24703 suggests
pip install numpy -C-Dallow-noblas=true, but that gives 'meson-python: error: Unknown option "-Dallow-noblas"'
orpip install numpy --config-settings=setup-args="-Dallow-noblas=true", but that gives '../../meson.build:1:0: ERROR: Value true
is not boolean (true or false).'. That appears to be a problem with the line ending, which makes me think it is specific to Cygwin.
Instead, I have pushed a commit here to simply not use NumPy 1.26 on Cygwin.