Both is not needed anymore, since ansible docker modules use the api directly.
Since docker_compose_v2 module is now finally available using the newer plugin, we can retire the hacky install of the docker compose python library.