Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Support for Docker Compose V2 - docker compose #97

Open
danielgafni opened this issue Aug 29, 2022 · 7 comments · May be fixed by #98
Open

Add Support for Docker Compose V2 - docker compose #97

danielgafni opened this issue Aug 29, 2022 · 7 comments · May be fixed by #98

Comments

@danielgafni
Copy link

Hey!

A general question here: since docker-compose is now written in Go, the old Python package will eventually become unusable. I already got some errors when trying to install pytest-docker-compose in my project alongside flet:

 And because docker-compose (1.29.1) depends on websocket-client (>=0.32.0,<1)
   and docker-compose (1.29.2) depends on websocket-client (>=0.32.0,<1), every version of docker-compose requires websocket-client (>=0.11.0,<1).
  Because no versions of pytest-docker-compose match >3.2.1,<4.0.0
   and pytest-docker-compose (3.2.1) depends on docker-compose (*), pytest-docker-compose (>=3.2.1,<4.0.0) requires docker-compose (*).
  Thus, pytest-docker-compose (>=3.2.1,<4.0.0) requires websocket-client (>=0.11.0,<1).
  And because flet (0.1.54) depends on websocket-client (>=1.2.1)
   and no versions of flet match >0.1.54,<0.2.0, pytest-docker-compose (>=3.2.1,<4.0.0) is incompatible with flet (>=0.1.54,<0.2.0).
  So, because <my-package> depends on both flet (^0.1.54) and pytest-docker-compose (^3.2.1), vsnkersion solving failed.

The issue he is with the websocket-client dependency. The docker-compose package requires an old version of it.

Anyway, what would the maintainers do about it? Should this awesome package be refactored to use /bin/docker-compose?

Thanks in advance!

@th0ger
Copy link

th0ger commented Sep 16, 2022

Alternative title: Add Support for Docker Compose V2 - docker compose

This issue should be marked high importance.
If Compose V2 is not ugently prioritized, this GREAT package will be dead.

Docker compose V1 is marked as deprecated and went out of support. The latest avalable release was V1 is 1.29.2 (May 2021), and even patches are no longer shipped. Lots of features are being added to the Compose V2 format, and since docker compose is the essentail dependency for this project, it's key to keep up-to-date.

And yes, implementation changed from Python to Go.
Some backgroud for newcomers:

Note on: /bin/docker-compose: This path is actually not guaranteed to exist, unless you've installed Docker Compose V2 from Docker Desktop with aliasing enabled. If you install from e.g. docker-compose-plugin or manually, you would have to create the backward-compatibel docker-compose alias youself, see StackOverflow 72187587. The subcommand docker compose is what we should hook into.

EDIT: Looking at PR/Commits this project may already be dead?

@danielgafni danielgafni changed the title docker-compose is no longer a Python project - what to do? *Add Support for Docker Compose V2* - docker compose Sep 16, 2022
@danielgafni danielgafni changed the title *Add Support for Docker Compose V2* - docker compose **Add Support for Docker Compose V2** - docker compose Sep 16, 2022
@danielgafni danielgafni changed the title **Add Support for Docker Compose V2** - docker compose Add Support for Docker Compose V2 - docker compose Sep 16, 2022
@gabrieldemarmiesse
Copy link

I'm just dropping this here: https://www.docker.com/blog/guest-post-calling-the-docker-cli-from-python-with-python-on-whales/ That allows you to call docker compose from python.

Disclaimer: I made this package :)

@tmeckel
Copy link

tmeckel commented Oct 17, 2022

@gabrieldemarmiesse, @danielgafni, @th0ger I filed PR #98 which uses Python on Whales to support Docker Compose V2

@tmeckel tmeckel linked a pull request Nov 2, 2022 that will close this issue
@tmeckel
Copy link

tmeckel commented Nov 2, 2022

@gabrieldemarmiesse, @danielgafni, @th0ger As long as the PR #98 isn't merged and the package has been published to PyPi the following statement can be used in a requirements.txt file to use the V2 version of the module

pytest-docker-compose @ git+https://github.com/tmeckel/pytest-docker-compose@feat/docker-compose-v2

Using the V2 version in 4 customer projects right now and it works flawlessly on Linux.

@gabrieldemarmiesse
Copy link

Maybe it's time to create a new package on pypi? pytest-docker-compose-v2? since it supports docker compose v2? :)

@th0ger
Copy link

th0ger commented Nov 4, 2022

Maybe it's time to create a new package on pypi? pytest-docker-compose-v2? since it supports docker compose v2? :)

I think it would be better to add more maintainers if possible. There are lost if issues and PRs here that shouldn't get lost. I see that @todofixthis is currently active on GH, so maybe some haloween candy can trick him out of the cave.

A v2 package would make sense from a technical perspective if it proves too hard to support both compose v1 and v2 in the same py package.

@radusuciu
Copy link

Maybe it's time to create a new package on pypi? pytest-docker-compose-v2? since it supports docker compose v2? :)

I find this package useful and I made this fork including @tmeckel's PR with the intent to make it easy for me to maintain going forward (ie. some changes are subjective, eg. using PDM as a package manager): https://github.com/radusuciu/pytest-docker-compose-v2

available on pypi: https://pypi.org/project/pytest-docker-compose-v2/

happy to merge back here if maintainers prefer that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants