How do I resolve moto and boto3 more quickly? #7937
-
Recently we deleted the lock file from our project because we wanted to automatically use the latest versions of all the dependencies. I think now it was a mistake because the project doesn't install properly. Poetry appears to fail to resolve correctly the dependencies of moto and boto3. With the lock file, The lock file before it was deleted specified Without the lock file, The latest CI run took nearly 4 hours and ended up installing ancient versions You can show the problem with Poetry's resolver by running the following commands against my project. cd "$(mktemp --dir)"
git clone https://github.com/connelldave/botocove
cd botocove
poetry debug resolve -vv And you can produce the same output with this minimal pyproject.toml file. [tool.poetry]
name = "test"
version = "1"
description = ""
authors = []
[tool.poetry.dependencies]
python = "3.8"
moto = "*"
boto3 = "*" The complete output of the first solution:
The errors from the next five solutions:
The resolver appears to be counting down through every single version of botocore, of which there are thousands, and discarding each of the for some unresolved dependency on urllib3. My library uses moto for testing and so I can control its version precisely if I need to. I don't want to restrict the version of boto3 because users of the library will also use it explicitly and specify a version. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
@iainelder Can you try pinning Incompatibility is a known issue (boto/botocore#2926) at the moment, so giving a hint to Poetry could make the resolution faster. |
Beta Was this translation helpful? Give feedback.
-
Awesome, @edgarrmondragon ! Thanks for the pointing to the botocore issue. The new resolution time is 2 seconds and it seems to pick the latest versions of the moto and boto3. pyproject.toml file that pins urllib3: [tool.poetry]
name = "test"
version = "1"
description = ""
authors = []
[tool.poetry.dependencies]
python = "3.8"
moto = "*"
boto3 = "*"
urllib3 = "<2" Full output of the resolver:
|
Beta Was this translation helpful? Give feedback.
@iainelder Can you try pinning
urllib3
to<2
and check if the resolution time improves?Incompatibility is a known issue (boto/botocore#2926) at the moment, so giving a hint to Poetry could make the resolution faster.