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

Version Conflict with PyYAML 6.0 #70

Closed
PJ-Schulz opened this issue Jan 18, 2022 · 4 comments
Closed

Version Conflict with PyYAML 6.0 #70

PJ-Schulz opened this issue Jan 18, 2022 · 4 comments
Assignees

Comments

@PJ-Schulz
Copy link

Hello

I would like to use pytest-docker in my library. However, I also need PyYAML with version 6.0. poetry is used as package manager. When I now install pytest-docker and PyYAML, I get a poetry SolverProblemError:

p@ubuntu:~/repos/testsrepos/dockerpytest$ poetry add pyyaml pytest-docker
Using version ^6.0 for PyYAML
Using version ^0.10.3 for pytest-docker

Updating dependencies
Resolving dependencies... (0.5s)

  SolverProblemError

  Because no versions of docker-compose match >1.27.3,<1.27.4 || >1.27.4,<1.28.0 || >1.28.0,<1.28.2 || >1.28.2,<1.28.3 || >1.28.3,<1.28.4 || >1.28.4,<1.28.5 || >1.28.5,<1.28.6 || >1.28.6,<1.29.0 || >1.29.0,<1.29.1 || >1.29.1,<1.29.2 || >1.29.2,<2.0
   and docker-compose (1.27.3) depends on PyYAML (>=3.10,<6), docker-compose (>=1.27.3,<1.27.4 || >1.27.4,<1.28.0 || >1.28.0,<1.28.2 || >1.28.2,<1.28.3 || >1.28.3,<1.28.4 || >1.28.4,<1.28.5 || >1.28.5,<1.28.6 || >1.28.6,<1.29.0 || >1.29.0,<1.29.1 || >1.29.1,<1.29.2 || >1.29.2,<2.0) requires PyYAML (>=3.10,<6).
  And because docker-compose (1.27.4) depends on PyYAML (>=3.10,<6)
   and docker-compose (1.28.0) depends on PyYAML (>=3.10,<6), docker-compose (>=1.27.3,<1.28.2 || >1.28.2,<1.28.3 || >1.28.3,<1.28.4 || >1.28.4,<1.28.5 || >1.28.5,<1.28.6 || >1.28.6,<1.29.0 || >1.29.0,<1.29.1 || >1.29.1,<1.29.2 || >1.29.2,<2.0) requires PyYAML (>=3.10,<6).
  And because docker-compose (1.28.2) depends on PyYAML (>=3.10,<6)
   and docker-compose (1.28.3) depends on PyYAML (>=3.10,<6), docker-compose (>=1.27.3,<1.28.4 || >1.28.4,<1.28.5 || >1.28.5,<1.28.6 || >1.28.6,<1.29.0 || >1.29.0,<1.29.1 || >1.29.1,<1.29.2 || >1.29.2,<2.0) requires PyYAML (>=3.10,<6).
  And because docker-compose (1.28.4) depends on PyYAML (>=3.10,<6)
   and docker-compose (1.28.5) depends on PyYAML (>=3.10,<6), docker-compose (>=1.27.3,<1.28.6 || >1.28.6,<1.29.0 || >1.29.0,<1.29.1 || >1.29.1,<1.29.2 || >1.29.2,<2.0) requires PyYAML (>=3.10,<6).
  And because docker-compose (1.28.6) depends on PyYAML (>=3.10,<6)
   and docker-compose (1.29.0) depends on PyYAML (>=3.10,<6), docker-compose (>=1.27.3,<1.29.1 || >1.29.1,<1.29.2 || >1.29.2,<2.0) requires PyYAML (>=3.10,<6).
  And because docker-compose (1.29.1) depends on PyYAML (>=3.10,<6)
   and docker-compose (1.29.2) depends on PyYAML (>=3.10,<6), docker-compose (>=1.27.3,<2.0) requires PyYAML (>=3.10,<6).
  Because no versions of pytest-docker match >0.10.3,<0.11.0
   and pytest-docker (0.10.3) depends on docker-compose (>=1.27.3,<2.0), pytest-docker (>=0.10.3,<0.11.0) requires docker-compose (>=1.27.3,<2.0).
  Thus, pytest-docker (>=0.10.3,<0.11.0) requires PyYAML (>=3.10,<6).
  So, because dockerpytest depends on both PyYAML (^6.0) and pytest-docker (^0.10.3), version solving failed.

Does anyone know how to use pytest-docker with PyYAML 6.0, or how to fix this bug?

@Luminaar Luminaar self-assigned this Jan 18, 2022
@Luminaar
Copy link
Collaborator

Hello, thank you for raising the issue.

There seems to be no easy solution ― the problem is in a transitive dependency that we have no control over (we depend on docker-compose which depends on pyyaml<6.0). One possible solution would be to submit an issue or PR to the docker-compose repository, though there is a new version of docker-compose which is not written in Python and I don't know how willing the devs will be to change the old version.

Another solution would be to use pyyaml<6.0 in your project, which of course might not be feasible if you depend on fixes from version 6 (from the changelog it seems that the main breaking change is removing support for Python2.7).

Finally, it might be possible to change pytest-docker in such a way to allow users to provide their own docker-compose installation instead of installing it directly. This will require a greater discussion as well as a major version bump.

@PJ-Schulz
Copy link
Author

Thank for the detailed answer.
The easiest way is to use a version of pyyaml<6.0 at the moment. But if there will be new features in pyyaml in the future, they cannot be used together with pytest-docker. So this is not the best solution.

Using a pre-installed docker-compose has the same dependency on pyyaml<6.0, unless someone uses their own version of docker-compose or a version >2.

I have opened an issue on docker/compose to update the dependency to 6.0 : docker/compose#9114

@otetard
Copy link
Contributor

otetard commented Jan 29, 2022

An attempt to not strictly depend on Docker Compose (and not on PyYAML either) is provided in this PR: #72.

@n1ngu
Copy link
Contributor

n1ngu commented Jul 28, 2022

Fixed by #72, would you please close the issue @PJ-Schulz ?

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

No branches or pull requests

4 participants