#!/usr/bin/env bash
require_cmd python3

# Create a system pipx that always fail and push it to the front of PATH
cat >"$HOME/bin/pipx" <<'EOF'
#!/usr/bin/env bash
echo "CALL TO SYSTEM pipx! args: $*" >&2
exit 1
EOF
chmod +x "$HOME"/bin/pipx
export PATH="$HOME/bin:$PATH"

# Just to be sure...
assert_fail "pipx"

# HTTPX's CLI requires its cli extra and supports the CI image's Python 3.14.
cat >.mise.toml <<EOF
[tools]
pipx = "1.5.0"
"pipx:httpx" = {version = "0.28.1", extras = "cli"}
EOF

# Install the tools
mise install

assert_contains "mise x -- httpx --help" "Usage: httpx"
