packaging: stop exact-pinning build backends

Exact setuptools/wheel pins block platform-specific backend patches and
make isolated pip installs fail on Android/Termux Python. Keep a setuptools
lower bound only, drop the unused wheel backend pin, keep requirements.txt
aligned with core package deps, and install the Spaces extra in Docker
instead of pulling bitsandbytes by default.

Android/Termux is still not a supported runtime; the new platform note
documents host wheels, ANDROID_API_LEVEL, and --no-build-isolation so
pip does not isolate a second setuptools or compile manylinux-only
extensions.
This commit is contained in:
Brian
2026-09-20 06:25:34 -07:00
parent 205d28a113
commit 73601bb13d
8 changed files with 114 additions and 7 deletions
+56
View File
@@ -0,0 +1,56 @@
# Android / Termux install notes
Android is not a supported OBLITERATUS runtime. These notes exist so a
Termux (or other Android Python) install does not fight host wheels or
download a second setuptools behind PEP 517 isolation.
`sys.platform` on current Android CPython is `android`, not `linux`. The
locked CPU PyTorch index in `pyproject.toml` is intentionally limited to
`linux` and `win32` manylinux/Windows wheels. Do not point Android at that
index.
## Layout
1. Install the platform's own `python`, `setuptools`, and scientific
wheels first (`torch`, `numpy`, and whatever Termux already packages).
Those builds carry the Android patches that PyPI wheels do not.
`safetensors` and `tokenizers` are Rust extensions; rustup does not
host `aarch64-linux-android`, so install Termux `rust` before pip
and export the API level Python was built against (24 on current
Termux):
```bash
pkg install rust
export ANDROID_API_LEVEL=24
```
2. Isolated pip builds of meson packages (pandas, matplotlib) will try
to compile `cmake`/`ninja` from source and can hang under proot.
Install those binaries from Termux first (`pkg install ninja cmake
python-matplotlib python-scipy python-pillow python-psutil
python-pyarrow python-greenlet python-brotli python-cryptography
python-rpds-py python-msgpack libraqm harfbuzz`). PyPI `psutil`
sdists reject `sys.platform == "android"`; the Termux package is
patched. Termux matplotlib needs `libraqm`. PyPI `tokenizers` abi3
wheels fail on CPython 3.14 (`PyBaseObject_Type`); rebuild without
the `abi3` cargo feature so the extension is `cp314` instead of
`abi3`. Then install OBLITERATUS without build isolation:
```bash
python -m pip install --no-build-isolation -e ".[spaces]"
```
3. If pip still tries to compile `torch` or `numpy` from source, install
the project over the host packages instead:
```bash
python -m pip install --no-build-isolation --no-deps -e .
python -m pip install --no-build-isolation "gradio>=6.7,<7.0"
```
Do not use `uv sync --locked` on Android. The lock resolves Linux/Windows
CPU PyTorch and does not contain `android_*` wheels for torch, numpy,
pyarrow, tokenizers, or bitsandbytes.
The `quantization` and `qwen-hybrid` extras are CUDA-oriented and are not
an Android install path.