Hatch test matrix of python versions on Alpine not working
I'm using hatch (1.14.0) in a Gitlab CI pipeline which needs a Docker-in-Docker (dind) image based on Alpine. I'm installing hatch as follows:
apk update && apk add python3-dev pipx musl-dev linux-headers gcc bash
pipx install hatch
python3-dev is Python 3.12 and if I run my tests (hatch test) for that Python version, everything is fine.
If I run the full test matrix (to include Python 3.10 & 3.11), I get the following errors:
Failed to inspect Python interpreter from provided path at `/root/.local/share/hatch/env/virtual/.pythons/3.10/python/bin/python3`
├─▶ Can't use Python at `/root/.local/share/hatch/env/virtual/.pythons/3.10/python/bin/python3`
╰─▶ Could not detect a glibc or a musl libc (while running on Linux)
Then a long stack trace with this at the bottom:
OSError: Unable to locate executables directory within: /root/.local/share/hatch/env/virtual/<project name>/xS3fZVNL/hatch-test.py3.10
One odd thing is that the Python distribution that apparently can't be used ( /root/.local/share/hatch/env/virtual/.pythons/3.10/python/bin/python3) seems fine. My guess is that it is a uv issue since that apparently doesn't support musl. I've tried using pip instead, but that seems to want to build all my dependencies (e.g. pillow) from source.