Issue 1:
Describe your issue.

Compile SciPy on Docker image i386/python:3.10.11-slim-bullseye not Success.

Reproducing Code Example

Test1
RUN pip3 install scipy==1.10.1 <-- Not work
Test2
RUN pip3 install --no-cache-dir git+https://github.com/andyfaff/scipy <-- Not work

Error message

Collecting git+https://github.com/andyfaff/scipy
Cloning https://github.com/andyfaff/scipy to /tmp/pip-req-build-8vsmg7hl
Running command git clone --filter=blob:none --quiet https://github.com/andyfaff/scipy /tmp/pip-req-build-8vsmg7hl
Resolved https://github.com/andyfaff/scipy to commit 52a5ecb875588fcef5bc18dcd84b302a9ba9bd39
Running command git submodule update --init --recursive -q
From https://github.com/boostorg/math
* branch 109a814e89f77ff8a3fc8f0391f6b35a12640669 -> FETCH_HEAD
From https://github.com/scipy/highs
* branch 4a122958a82e67e725d08153e099efe4dad099a2 -> FETCH_HEAD
From https://github.com/scipy/unuran
* branch a63d39160e5ecc4402e7ed0e8417f4c3ff9634cb -> FETCH_HEAD
Installing build dependencies: started
Installing build dependencies: still running...
Installing build dependencies: still running...
Installing build dependencies: still running...
Installing build dependencies: still running...
Installing build dependencies: still running...
Installing build dependencies: still running...
Installing build dependencies: still running...
Installing build dependencies: still running...
Installing build dependencies: still running...
Installing build dependencies: still running...
Installing build dependencies: still running...
Installing build dependencies: still running...
Installing build dependencies: still running...
Installing build dependencies: still running...
Installing build dependencies: still running...
Installing build dependencies: still running...
Installing build dependencies: still running...
Installing build dependencies: still running...
Installing build dependencies: still running...
Installing build dependencies: still running...
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Installing backend dependencies: started
Installing backend dependencies: finished with status 'done'
Preparing metadata (pyproject.toml): started
Preparing metadata (pyproject.toml): finished with status 'error'
error: subprocess-exited-with-error

× Preparing metadata (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [16 lines of output]
+ meson setup /tmp/pip-req-build-8vsmg7hl /tmp/pip-req-build-8vsmg7hl/.mesonpy-c5n8yvav/build -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md --native-file=/tmp/pip-req-build-8vsmg7hl/.mesonpy-c5n8yvav/build/meson-python-native-file.ini
The Meson build system
Version: 1.1.0
Source dir: /tmp/pip-req-build-8vsmg7hl
Build dir: /tmp/pip-req-build-8vsmg7hl/.mesonpy-c5n8yvav/build
Build type: native build
Project name: SciPy
Project version: 1.11.0.dev0
C compiler for the host machine: cc (gcc 10.2.1 "cc (Debian 10.2.1-6) 10.2.1 20210110")
C linker for the host machine: cc ld.bfd 2.35.2
C++ compiler for the host machine: c++ (gcc 10.2.1 "c++ (Debian 10.2.1-6) 10.2.1 20210110")
C++ linker for the host machine: c++ ld.bfd 2.35.2

../../meson.build:1:0: ERROR: Cython compiler 'cython' cannot compile programs

A full log can be found at /tmp/pip-req-build-8vsmg7hl/.mesonpy-c5n8yvav/build/meson-logs/meson-log.txt
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

SciPy/NumPy/Python version and system information

SciPy=1.10.1
Python=3.10
Cython=3.0.0b2

Issue 2:
Want to build from source to work on adding a missing distribution (Landau distribution). Following the steps from here. Using the pip+venv workflow. Already cloned the repo and created the virtual environment, run python -m pip install numpy pytest cython pythran pybind11 meson ninja pydevtool rich-click successfully. I am getting an error when running python3 dev.py build, specifically meson.build:1:0: ERROR: Cython compiler 'cython' cannot compile programs. If I look into the log I find:

Compiler stderr:
...
File "/home/me/.venvs/scipy-dev/lib/python3.10/site-packages/pythran/optimizations/pattern_transform.py", line 346, in <module>
getattr(PatternTransform, attr_name) + (known_pattern,))
AttributeError: type object 'PatternTransform' has no attribute 'typePatterns'. Did you mean: 'CallPatterns'?

How can I fix this to build the development version of scipy?

OS: Ubuntu 22.04.

Python: 3.10.6