Repository navigation
Closed
Labels
area/solverRelated to the dependency resolverRelated to the dependency resolverkind/bugSomething isn't working as expectedSomething isn't working as expected
Description
- 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 (
-vvvoption).
- 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.
Reacted by Omer Hadari, David Hotham, Michal Szelag, Evan Shenkman, Matan Rosenberg, Nathan Meisels, Alex Verdyan, Gilad Peleg and Robinson Chaplain
Reacted by Gilad Peleg
Metadata
Metadata
Assignees
Labels
area/solverRelated to the dependency resolverRelated to the dependency resolverkind/bugSomething isn't working as expectedSomething isn't working as expected
Activity
tchar commentedon Aug 10, 2021
Not sure if I should create a new issue, but this looks similar to mine.
I have a similar problem with dev dependencies.
Output
I forced uploaded to PyPI and I can normally install my package through pip (it just mentions that the dev dependency is not getting installed, which end users don't really care unless they want to test)
Also I am telling poetry not to install tox on a superset of python versions that I specified for six==1.11.0, so this should't even be a conflict.
nugend commentedon Sep 2, 2021
Anyone have any ideas on how to work around this issue?
mcouthon commentedon Sep 2, 2021
We just gave up, and created a python2 incompatible version of the package 🤷
radoering commentedon Nov 1, 2021
I think, I found a solution for this issue. With the changes in PR #4695, I was able to lock the
boto3/botocoreexample. The solution relies on poetry recognizing if the intersection of markers is empty. Unfortunately, there is also some room for improvement. See #4694 for details. Without this improvement to poetry-core, some unnecessary combinations of overrides are solved in dependency resolution, resulting in an addtional version ofbotocorein the lock file. I am not 100 % sure, but I think this additional entry in the lock file does no damage, because it not used for any python version.GtTmy commentedon Dec 23, 2021
I have a similar case. poetry (1.1.12) cannot solve the following dependencies.
And I confirmed that #4695 makes it possible.
With poetry 1.1.12
https://gist.github.com/GtTmy/22bfd306a53ed7538eededd31f443cca
With #4695
GrimHacker commentedon Mar 14, 2022
I believe i'm seeing this as well.
And I confirmed that #4695 makes it possible.
With poetry 1.1.13
With #4695
#506 Use Pipenv
github-actions commentedon Mar 1, 2024
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.