avast / pytest-docker

Docker-based integration tests
MIT License
423 stars 71 forks source link

Add support for Docker Compose v2 and relax dependency over `docker-compose` PIP package #72

Closed otetard closed 2 years ago

otetard commented 2 years ago

This is a first attempt to provide Docker Compose v2 support to pytest-docker. Default is to keep using Docker Compose v1, but users can change to Docker Compose v2 by overriding the docker_compose_command fixture to return "docker compose" string.

This also remove the strict dependency over docker-compose PIP package. The default will be to not install docker-compose at all to rely on the version installed on the system. If you want to install docker-compose package along with docker-pytest, the docker-pytest[docker-compose-v1] extra is available.

n1ngu commented 2 years ago

This PR would benefit from #75 being integrated first, IMHO

euri10 commented 2 years ago

just wanted to throw in and say this PR working great with the new compose, I'm also hit by #70 and can't unfortunately solve it by pinning pyyaml since I'm using hypothesis ! Hoping this get merged, in the meantime if you want any help on it I'd be happy to if possible !

otetard commented 2 years ago

PR was updated. Now that Docker Compose v2 is installed in GitHub Actions VMs, there is no need to add a specific step in the test.yaml workfow. Also fixed conflicts.

otetard commented 2 years ago

@Luminaar Could you have a look at this PR please? It adds support for Docker Compose v2 and most importantly suppress the direct dependency to the legacy version of Docker Compose. This way, pytest-docker won’t be tight to Docker Compose’s direct dependencies (such as PyYAML < 6).

Thanks!