Yeah, ansible should *NOT* install docker dependencies as part of the pip package, as we don't require docker unless someone wants to use docker, so module dependencies in docker are soft, and these things quickly snowball (and we'd be run out of town if we did that).
These are things we typically report at runtime and are noted as dependencies on the individual module pages.
What you have with a pip task is a good way to go.
Somewhat, though in ansible it's unclear when a task is executed because it may depend on variables that occur at runtime, and sometimes folks won't want to get docker-py from pip. We try to avoid implicit auto-installs except in a few cases, like the apt module needing python-apt, which is fairly chicken-egg, so it will take care of it.