Hi all, it seems like resolves don't support a ver...
# general
s
Hi all, it seems like resolves don't support a very basic workflow, and it might be a dealbreaker for my company. We have a repository of both libraries and services. The services may have conflicting dep version constraints. The libraries must be consumable by all services. If I use resolves... 1. I have to manually declare that each library must be added to every resolve in the repository 2. Then the unit tests for our library have to run for each resolve (and I have 20+ services, so our pipeline is 20x slower) In poetry, it behaves far more intuitively. Theres a venv per-module, so services can have conflicting dep versions and libraries run unit tests against their own version constraints I created a sample repo to experiment with and to demonstrate the difficulty working with pants. I understand that resolves have some advantages over other approaches, but I would like to opt-out some features of resolves to have compatibility with poetry.
@happy-kitchen-89482 Sorry for a direct ping, but this makes-or-breaks a month long implementation for me. If you have any guidance on how we can have libraries being consumed by services where the services have separate lockfiles without adding libraries to each resolve, that would be great
h
So the libraries themselves use 3rd party requirements, with version constraints, and the services have their own requirement constraints, and you manually ensure that they are mutually compatible?
So presumably any conflicting version constraints in the services are for requirements not used by the libraries?
s
> So presumably any conflicting version constraints in the services are for requirements not used by the libraries? Not necessarily, i.e.: • LibraryA: ◦
Flask>=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:
Copy code
➜  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.
h
s
The above example repo would work if Pants didn't know that LibraryA was in the repo, and treated it like an external dependency.
Yea the linked sample repo is a bit more detailed
The 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
h
I'll take a look at your example repo
🙏 1
s
I really appreciate it!!
h
So the libraries are intended to be published?
s
In our real repo, we have ~10 libraries. Some are internal and some are published
h
Got it
I'll follow up on the ticket, for posterity
👍 1