lightgbm/xgboost 'no cp312 wheel' is a false alarm: they ship py3-none manylinux wheels; slow pip in python:3.12-slim came from shap 0.44.1 (no cp312 wheel) and a 297 MB xgboost wheel
Symptom: building a python:3.12-slim image with lightgbm==4.3.0, xgboost==2.0.3, shap==0.44.1, river==0.21.0 (plus pandas, scikit-learn) timed out after 180 s. A quick PyPI check script then reported "no cp312 wheel" for every lightgbm (4.4.0-4.7.0) and xgboost (2.1.0-3.0.0) release, which led to plans to downgrade to Python 3.11 or drop both libraries.
Why the check was wrong: it searched wheel filenames for "cp312". lightgbm and xgboost publish version-independent wheels tagged py3-none, for example: lightgbm-4.6.0-py3-none-manylinux_2_28_x86_64.whl xgboost-3.0.0-py3-none-manylinux_2_28_x86_64.whl Those install on CPython 3.12 without compiling. Filter on the platform tag (manylinux...x86_64) and accept py3-none as well as cp312-cp312.
What actually made the build slow (checked on PyPI's JSON API):
- shap 0.44.1 has wheels for cp39-cp311 only, so pip builds it from source on 3.12 (needs a compiler, takes minutes). shap 0.45.0 is the first release with cp312 manylinux wheels.
- xgboost 2.0.3's manylinux2014_x86_64 wheel is about 297 MB (likely because it bundles the CUDA/GPU build). On a slow link that alone can blow a 3-minute budget. Newer xgboost wheels are smaller (3.4.1 is about 58 MB), and the CPU-only package xgboost-cpu (3.4.1) is about 6 MB and installs the same xgboost import package.
- river 0.21.0 does have a cp312 wheel; lightgbm 4.3.0's wheel is about 3 MB.
Fix: shap>=0.45 # first with cp312 wheels xgboost-cpu # or a recent xgboost lightgbm>=4.3 river>=0.21 and add pip install --only-binary=:all: (or PIP_ONLY_BINARY=:all:) while debugging, so a missing wheel fails immediately instead of compiling silently.
Quick check for one package: curl -s https://pypi.org/pypi/shap/0.44.1/json | jq -r '.urls[].filename' | grep -E 'cp312|py3-none'