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

Installation fails due to conflicting pyyaml version #39

Closed
NeolithEra opened this issue Dec 21, 2019 · 4 comments
Closed

Installation fails due to conflicting pyyaml version #39

NeolithEra opened this issue Dec 21, 2019 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@NeolithEra
Copy link

NeolithEra commented Dec 21, 2019

Hi, users are unable to run ssmash due to dependency conflict with pyyaml package. As shown in the following full dependency graph of ssmash, ssmash requires pyyaml >=5.1,<6,while flying-circus requires <5.2.0,>=5.1.1.

According to pip’s “first found wins” installation strategy, pyyaml 5.2 is the actually installed version. However, pyyaml 5.2 does not satisfy PyYAML<5.2.0,>=5.1.1.

Dependency tree-----------

ssmash - 2.0.1
| +- click(install version:7.0 version range:>=7.0,<8)
| +- flying-circus(install version:0.7.2 version range:>=0.7,<0.8)
| | +- attrs(install version:19.3.0 version range:>=18.2.0)
| | +- inflection(install version:0.3.1 version range:<0.4,>=0.3.1)
| | +- pyyaml(install version:3.13 version range:<5.2.0,>=5.1.1)
| +- inflection(install version:0.3.1 version range:==0.3.1)
| +- pyyaml(install version:5.2 version range:>=5.1,<6)

Thanks for your help.
Best,
Neolith

@NeolithEra
Copy link
Author

Suggested Solution

  1. Fix your direct dependency to be pyyaml <5.2.0. I have checked this revision will not affect your downstream projects now.

  2. Remove your direct dependency pyyaml, and use pyyaml transitively introduced by flying-circus.

  3. Ask your upstream project flying-circus to loose the version range of pyyaml.

@garyd203 Which solution do you prefer, 1, 2 or 3?
Please let me know your choice. I can submit a PR to solve this issue.

@garyd203 garyd203 added the bug Something isn't working label Dec 23, 2019
@garyd203
Copy link
Owner

Hi @NeolithEra , thanks a lot for the detailed bug report. This issue hadn't affected me because I have been using poetry to install (which does resolve the PyYAML versions in a compatible way), rather than pip, so thanks for bringing it to my attention.

For a solution, it's not desirable to loosen the PyYAML version range for flying-circus (which is somewhat coupled to the internals of PyYAML), unfortunately.

The best approach seems to be if we restrict our version of PyYAML to something compatible (say, "PyYAML>=5.1,<5.2") - your option (1). Are you happy to put together a PR along those lines?

@garyd203
Copy link
Owner

I will pick this up

@garyd203 garyd203 self-assigned this Dec 29, 2019
garyd203 added a commit that referenced this issue Dec 29, 2019
As described in #39 the version
resolution for `pip` will pick up the more lenient version range for
`ssmash` before it finds the restrictive version range for
`flying-circus`. The bets compromise seems to be to pin our version to
that of `flying-cirucs`.
garyd203 added a commit that referenced this issue Dec 29, 2019
As described in #39 the version
resolution for `pip` will pick up the more lenient version range for
`ssmash` before it finds the restrictive version range for
`flying-circus`. The bets compromise seems to be to pin our version to
that of `flying-cirucs`.
garyd203 added a commit that referenced this issue Dec 29, 2019
As described in #39 the version
resolution for `pip` will pick up the more lenient version range for
`ssmash` before it finds the restrictive version range for
`flying-circus`. The bets compromise seems to be to pin our version to
that of `flying-cirucs`.
@garyd203
Copy link
Owner

Appears to be resolved now. Thanks @NeolithEra :)

$ docker run -it python:3.6 "bash"
root:/# pip install ssmash
/ ... /
Installing collected packages: click, inflection, PyYAML, attrs, flying-circus,
ssmash
Successfully installed PyYAML-5.1.2 attrs-18.2.0 click-7.0 flying-circus-0.7.2 i
nflection-0.3.1 ssmash-2.1.2

root:/# ssmash --help
Usage: ssmash [OPTIONS] COMMAND1 [ARGS]... [COMMAND2 [ARGS]...]...

  Convert a plain YAML file with application configuration into a
  CloudFormation template with SSM parameters.

Options:
  -i, --input, --input-file FILENAME
                                  Where to read the application configuration
                                  YAML file
  -o, --output, --output-file FILENAME
                                  Where to write the CloudFormation template
                                  file
  --description TEXT              The description for the CloudFormation
                                  stack.
  --help                          Show this message and exit.

Commands:
  invalidate-ecs     Invalidate the cache in an ECS Service that uses these...
  invalidate-lambda  Invalidate the cache in a Lambda Function that uses...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants