Skip to content

Resolution fails for boto3/botocore in multiple python versions #3367

@mcouthon

Description

@mcouthon
  • I am on the latest Poetry version.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).
  • OS version and name: macOS Catalina 10.15.7
  • Poetry version: Poetry version 1.1.4
  • Link of a Gist with the contents of your pyproject.toml file: link

Issue

We need very specific boto3/botocore versions for compatibility with legacy code. In our non-poetry projects we set the following in the requirements.txt:

botocore==1.12.192;python_version<"3.0"
botocore==1.17.63;python_version>"3.0"
boto3==1.9.192;python_version<"3.0"
boto3==1.14.63;python_version>"3.0"

And installation works great in both python 2.7 and python 3.x.

I've attempted to create a comparable pyproject.toml:

[tool.poetry.dependencies]
python = "^2.7 || ^3.6"

botocore = [
    {version = "1.12.192", python = "^2"},
    {version = "1.17.63", python = "^3"}
]
boto3 = [
    {version = "1.9.192", python = "^2"},
    {version = "1.14.63", python = "^3"}
]

But poetry lock results in an error (on both python versions). Here's the error in a python 3.8 env:

   1: conflict: boto3 (1.14.63) depends on botocore (>=1.17.63,<1.18.0)
   1: ! not botocore (>=1.17.63,<1.18.0) is satisfied by botocore (1.12.192)
   1: ! which is caused by "test depends on botocore (1.12.192)"
   1: ! thus: boto3 is forbidden
   1: ! boto3 (1.14.63) is satisfied by boto3 (1.14.63)
   1: ! which is caused by "test depends on boto3 (1.14.63)"
   1: ! thus: version solving failed

And while the resolution starts with:

   0: Retrying dependency resolution with the following overrides ({Package('test', '0.1.0'): {'botocore': <Dependency botocore (1.12.192)>, 'boto3': <Dependency boto3 (1.9.192)>}}).

It at some point switches to:

   0: Retrying dependency resolution with the following overrides ({Package('test', '0.1.0'): {'botocore': <Dependency botocore (1.12.192)>, 'boto3': <Dependency boto3 (1.14.63)>}}).

Which of course causes the error (as these two are indeed incompatible versions).

Full output of poetry lock -vvv can be seen here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/solverRelated to the dependency resolverkind/bugSomething isn't working as expected

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions