steep-eve-20716
07/25/2024, 5:07 PMsteep-eve-20716
07/25/2024, 7:44 PMhappy-kitchen-89482
07/25/2024, 8:47 PMhappy-kitchen-89482
07/25/2024, 8:48 PMsteep-eve-20716
07/25/2024, 8:55 PMFlask>=1.0
very flexible minimum version
• Service1:
◦ imports LibraryA
◦ imports and pins Flask==2.0
to avoid a bug in newest versions
• Service2:
◦ imports LibraryA
◦ imports and pins Flask==2.1
for some other reason
> you manually ensure that they are mutually compatible?
Yes, poetry throws an error if the constraints were not compatible. For example, if I made a service try to use Flask lower than 1.0:
➜ poetry lock
Updating dependencies
Resolving dependencies... (0.1s)
Because service2 depends on libB (0.1.0) @ file:///Users/jasondamour/Workspace/pants-vs-poetry/Libraries/libB which depends on Flask (>=1.0), flask is required.
So, because service2 depends on flask (0.1.0), version solving failed.
happy-kitchen-89482
07/25/2024, 8:57 PMsteep-eve-20716
07/25/2024, 8:57 PMsteep-eve-20716
07/25/2024, 8:57 PMsteep-eve-20716
07/25/2024, 9:00 PMThe above example repo would work if Pants didn't know that LibraryA was in the repo, and treated it like an external dependency.This is the really key frustration. If pants didn't know anything about LibraryA and I created a resolve for Service1 and Service2, it would work perfectly. But I do want pants to know about LibraryA sources. I just don't want to coerce LibraryA into a resolve, nor generate lockfiles for it. It should be "neutral" and be usable in all resolves, and whatever resolve imports it should be able to override transitive deps
happy-kitchen-89482
07/25/2024, 9:01 PMsteep-eve-20716
07/25/2024, 9:01 PMhappy-kitchen-89482
07/25/2024, 9:05 PMsteep-eve-20716
07/25/2024, 9:05 PMhappy-kitchen-89482
07/25/2024, 9:06 PMhappy-kitchen-89482
07/25/2024, 9:12 PM