Build failure under Termux: can not execute sklearn/_build_utils/version.py

### Describe the bug

When attempting to install the newest (and older) versions of scikit-learn-1.6.dev0 using regular pip install, the installation fails due to a missing version.py file. This issue occurs on an Android system using Termux.
Environment details:
OS: Linux localhost 4.14.186+ (Android)
Architecture: aarch64
Python: 3.11
The error occurs during the Meson build process, which tries to execute a non-existent file:
/data/data/com.termux/files/home/downloads/scikit-learn/sklearn/_build_utils/version.py
A workaround patch has been developed to address this issue:
```
#!/bin/bash

# Navigate to the scikit-learn directory, e.g.:
cd ~/downloads/scikit-learn

# Extract version from pyproject.toml and remove "dev" suffix
VERSION=$(grep 'version =' pyproject.toml | sed 's/version = "\(.*\)"/\1/' | sed 's/\.dev0//')

# Create the directory if it doesn't exist
mkdir -p sklearn/_build_utils

# Create the version.py file with the correct content
cat << EOF > sklearn/_build_utils/version.py
#!/usr/bin/env python
print('${VERSION}')
EOF

# Make the file executable
chmod +x sklearn/_build_utils/version.py

echo "Created sklearn/_build_utils/version.py with version ${VERSION}"
```
This patch:
- Extracts the version number from pyproject.toml
- Removes the "dev" suffix
- Creates the missing version.py file with a generic Python shebang
- Makes the file executable

After applying this patch, the Meson build process completes successfully, and the installation can proceed: 
```
cpu family: aarch64
Host machine cpu: aarch64
Compiler for C supports arguments -Wno-unused-but-set-variable: YE
Compiler for C supports arguments -Wno-unused-function: YES
Compiler for C supports arguments -Wno-conversion: YES
Compiler for C supports arguments -Wno-misleading-indentation: YES
Library m found: YES
Program python3 found: YES (/data/data/com.termux/files/usr/bin/python3.11)
Run-time dependency OpenMP for c found: YES 5.1
Found pkg-config: YES (/data/data/com.termux/files/usr/bin/pkg-config) 0.29.2
Run-time dependency python found: YES 3.11    Build targets in project: 111
Found ninja-1.11.1.git.kitware.jobserver-1 ...
```
and:
```
Successfully installed scikit-learn-1.6.dev0  ~/downloads/scikit-learn $
```

### Steps/Code to Reproduce

pip install -U -v scikit-learn

### Expected Results

.

### Actual Results

.

### Versions

```shell
scikit-learn-1.6.dev0, and older
```

COMMENT:
Update - in parallel I have done "can you do pip cache remove numpy and pip cache remove scipy and rerun pip install scikit-learn -v" .   I paste only the key segments : 

```
  Successfully installed Cython-3.0.10 meson-1.4.1 meson-python-0.16.0 packaging-24.1 pyproject-metadata-0.8.0
    Installing build dependencies: finished with status 'done'
    Getting requirements to build wheel: started
    Running command Getting requirements to build wheel
    Getting requirements to build wheel: finished with status 'done'
    Preparing metadata (pyproject.toml): started
    Running command Preparing metadata (pyproject.toml)
    + /data/data/com.termux/files/usr/bin/python3.11 /data/data/com.termux/files/usr/tmp/pip-install-x6j6ke_t/numpy_f1dc556d0a81475c9d80c98772e5e9cd/vendored-meson/meson/meson.py setup /data/data/com.termux/files/usr/tmp/pip-install-x6j6ke_t/numpy_f1dc556d0a81475c9d80c98772e5e9cd /data/data/com.termux/files/usr/tmp/pip-install-x6j6ke_t/numpy_f1dc556d0a81475c9d80c98772e5e9cd/.mesonpy-fg9o8o91 -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md --native-file=/data/data/com.termux/files/usr/tmp/pip-install-x6j6ke_t/numpy_f1dc556d0a81475c9d80c98772e5e9cd/.mesonpy-fg9o8o91/meson-python-native-file.ini
    The Meson build system
    Version: 1.2.99
    Source dir: /data/data/com.termux/files/usr/tmp/pip-install-x6j6ke_t/numpy_f1dc556d0a81475c9d80c98772e5e9cd
    Build dir: /data/data/com.termux/files/usr/tmp/pip-install-x6j6ke_t/numpy_f1dc556d0a81475c9d80c98772e5e9cd/.mesonpy-fg9o8o91
    Build type: native build
    Project name: NumPy
    Project version: 2.0.0
    C compiler for the host machine: clang (clang 18.1.8 "clang version 18.1.8")
    C linker for the host machine: clang ld.lld 18.1.8
    C++ compiler for the host machine: clang++ (clang 18.1.8 "clang version 18.1.8")
    C++ linker for the host machine: clang++ ld.lld 18.1.8
    Cython compiler for the host machine: cython (cython 3.0.10)
    Host machine cpu family: aarch64
    Host machine cpu: aarch64
    Program python found: YES (/data/data/com.termux/files/usr/bin/python3.11)
    Found pkg-config: /data/data/com.termux/files/usr/bin/pkg-config (0.29.2)
    Run-time dependency python found: YES 3.11
    Has header "Python.h" with dependency python-3.11: YES
    Compiler for C supports arguments -fno-strict-aliasing: YES
    Compiler for C supports arguments -ftrapping-math: YES
    Message: During parsing cpu-dispatch: The following CPU features were ignored due to platform incompatibility or lack of support:
    "XOP FMA4"
    Test features "NEON NEON_FP16 NEON_VFPV4 ASIMD" : Supported
    Test features "ASIMDHP" : Supported
    Test features "ASIMDFHM" : Supported
    Test features "SVE" : Supported
    Configuring npy_cpu_dispatch_config.h using configuration
    Message:
    CPU Optimization Options
      baseline:
        Requested : min
        Enabled   : NEON NEON_FP16 NEON_VFPV4 ASIMD
      dispatch:
        Requested : max -xop -fma4
        Enabled   : ASIMDHP ASIMDFHM SVE

    Library m found: YES
    Run-time dependency scipy-openblas found: NO (tried pkgconfig)
    Run-time dependency openblas found: YES 0.3.27
    Message: BLAS symbol suffix:
    Run-time dependency openblas found: YES 0.3.27
    Program _build_utils/process_src_template.py found: YES (/data/data/com.termux/files/usr/bin/python3.11 /data/data/com.termux/files/usr/tmp/pip-install-x6j6ke_t/numpy_f1dc556d0a81475c9d80c98772e5e9cd/numpy/_build_utils/process_src_template.py)
    Program _build_utils/tempita.py found: YES (/data/data/com.termux/files/usr/bin/python3.11 /data/data/com.termux/files/usr/tmp/pip-install-x6j6ke_t/numpy_f1dc556d0a81475c9d80c98772e5e9cd/numpy/_build_utils/tempita.py)
    Configuring __config__.py using configuration
    Checking for size of "short" : 2
....
   Generating multi-targets for "_simd.dispatch.h"
      Enabled targets: baseline
    Build targets in project: 64

    NumPy 2.0.0

      User defined options
        Native files: /data/data/com.termux/files/usr/tmp/pip-install-x6j6ke_t/numpy_f1dc556d0a81475c9d80c98772e5e9cd/.mesonpy-fg9o8o91/meson-python-native-file.ini
        buildtype   : release
        b_ndebug    : if-release
        b_vscrt     : md

    Found samurai-1.9 at /data/data/com.termux/files/usr/bin/samu
    + /data/data/com.termux/files/usr/bin/samu
    [1/322] Generating numpy/random/_bounded_integer_pyx with a custom command
    [2/322] Generating numpy/random/mtrand.pyx with a custom command
    [3/322] Generating numpy/random/_generator.pyx with a custom command
    [4/322] Generating numpy/random/_bounded_integer_pxd with a custom command
    [5/322] Generating numpy/random/c_distributions.pxd with a custom command
 ... 
```
but then it errors at : 
```
    Host machine cpu: aarch64
    Program python found: YES (/data/data/com.termux/files/usr/bin/python3.11)
    Found pkg-config: YES (/data/data/com.termux/files/usr/bin/pkg-config) 0.29.2
    Run-time dependency python found: YES 3.11
    Program cython found: YES (/data/data/com.termux/files/usr/tmp/pip-build-env-ye9yeqhf/overlay/bin/cython)
    Compiler for C supports arguments -Wno-unused-but-set-variable: YES
    Compiler for C supports arguments -Wno-unused-function: YES
    Compiler for C supports arguments -Wno-conversion: YES
    Compiler for C supports arguments -Wno-misleading-indentation: YES
    Library m found: YES

    ../meson.build:84:0: ERROR: Value "legacy" (of type "string") for combo option "Fortran language standard to use" is not one of the choices. Possible choices are (as string): "none".

    A full log can be found at /data/data/com.termux/files/usr/tmp/pip-install-x6j6ke_t/scipy_857840d73d0b4c6aaa63f62397d5a8ff/.mesonpy-aza_ki0y/meson-logs/meson-log.txt
    error: subprocess-exited-with-error

    × Preparing metadata (pyproject.toml) did not run successfully.
    │ exit code: 1
    ╰─> See above for output.

    note: This error originates from a subprocess, and is likely not a problem with pip.
    full command: /data/data/com.termux/files/usr/bin/python3.11 /data/data/com.termux/files/usr/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py prepare_metadata_for_build_wheel /data/data/com.termux/files/usr/tmp/tmpymknghke
    cwd: /data/data/com.termux/files/usr/tmp/pip-install-x6j6ke_t/scipy_857840d73d0b4c6aaa63f62397d5a8ff
    Preparing metadata (pyproject.toml): finished with status 'error'
  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.
  error: subprocess-exited-with-error
```

I know how to fix it (just changing this  legacy bit there, or sometimes `export FC=gfortran` works), but it explains whence this cached scipy etc that I had before - I had also git cloned, fixed etc. beforehand. 

Now, after some such "behind the scenes" fixes: 
```
  Compiler for Fortran supports arguments -w: YES (cached)
    Build targets in project: 197

    scipy 1.14.0

      User defined options
        Native files: /data/data/com.termux/files/usr/tmp/pip-install-45za4tde/scipy_7dcf051b7dc34d2680adfd8d658b091e/.mesonpy-rurfipq8/meson-python-native-file.ini
        buildtype   : release
        b_ndebug    : if-release
        b_vscrt     : md

    Found samurai-1.9 at /data/data/com.termux/files/usr/bin/samu
    + /data/data/com.termux/files/usr/bin/samu
    [1/1353] Compiling C++ object scipy/optimize/_highs/libhighs.a.p/.._..__lib_highs_src_interfaces_highs_c_api.cpp.o
    [2/1353] Compiling C++ object scipy/optimize/_highs/libhighs.a.p/.._..__lib_highs_src_util_stringutil.cpp.o
    [3/1353] Compiling C++ object scipy/optimize/_highs/libhighs.a.p/.._..__lib_highs_src_util_HVectorBase.cpp.o
    [4/1353] Compiling C++ object scipy/optimize/_highs/libhighs.a.p/.._..__lib_highs_src_util_HSet.cpp.o
    [5/1353] Compiling C++ object scipy/optimize/_highs/libhighs.a.p/.._..__lib_highs_src_util_HighsUtils.cpp.o
    [6/1353] Compiling C++ object scipy/optimize/_highs/libhighs.a.p/.._..__lib_highs_src_util_HighsSparseMatrix.cpp.o
    [7/1353] Compiling C++ object scipy/optimize/_highs/libhighs.a.p/.._..__lib_highs_src_util_HighsSort.cpp.o
    [8/1353] Compiling C++ object scipy/optimize/_highs/libhighs.a.p/.._..__lib_highs_src_util_HighsMatrixUtils.cpp.o
    [9/1353] Compiling C++ object scipy/optimize/_highs/libhighs.a.p/.._..__lib_highs_src_util_HighsMatrixPic.cpp.o
...
  ```
and it fails with the same error, so fully reproducible at my box: 
```
 Running command Preparing metadata (pyproject.toml)
  + meson setup /data/data/com.termux/files/usr/tmp/pip-install-kdwdqedn/scikit-learn_3a9fffcdd0d74a13bd5c34be996319c2 /data/data/com.termux/files/usr/tmp/pip-install-kdwdqedn/scikit-learn_3a9fffcdd0d74a13bd5c34be996319c2/.mesonpy-gqwq8axg -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md --native-file=/data/data/com.termux/files/usr/tmp/pip-install-kdwdqedn/scikit-learn_3a9fffcdd0d74a13bd5c34be996319c2/.mesonpy-gqwq8axg/meson-python-native-file.ini
  The Meson build system
  Version: 1.4.1
  Source dir: /data/data/com.termux/files/usr/tmp/pip-install-kdwdqedn/scikit-learn_3a9fffcdd0d74a13bd5c34be996319c2
  Build dir: /data/data/com.termux/files/usr/tmp/pip-install-kdwdqedn/scikit-learn_3a9fffcdd0d74a13bd5c34be996319c2/.mesonpy-gqwq8axg
  Build type: native build

  ../meson.build:4:11: ERROR: Could not execute command `/usr/bin/env python /data/data/com.termux/files/usr/tmp/pip-install-kdwdqedn/scikit-learn_3a9fffcdd0d74a13bd5c34be996319c2/sklearn/_build_utils/version.py`.
```

Labels: Build / CI, Low Priority