Hi all, I've been trying to find a clear answer to...
# general
f
Hi all, I've been trying to find a clear answer to this from the docs, as well as pantsbuild GH issue threads but to no avail: In a multi-resolve Python repo, is there a way to configure pants such that each resolve has control over the version of tool in use? For example, say I have resolves
A
,
B
, and
C
. Each with the following test requirements: • Resolve
A
needs:
pytest>=9.0.2
and
pytest-asyncio
. • Resolve
B
needs only
pytest==8.4.0
• Resolve
C
needs
pytest>=8.0.0,<8.4.0
Is it possible to configure these resolves to each use their own pytest tool versions? Ideally, is there a simple way to do this via a standard pyproject.toml test-only dependencies section (e.g.
dependency-groups
and/or
project.optional-dependencies
)?
b
https://www.pantsbuild.org/stable/reference/subsystems/pytest#install_from_resolve So that's 1 named resolve. By the structure of toml, there can only be one of these tables configuring pytest; so the only conclusion I can see is that you get 1 and only 1 today.
It sounds like you effectively want:
Copy code
[pytest]
install_from_resolve = { ambient = true }
Or some-such mod spelling.
March 2023: Good luck getting someone else to take up your torch. That's been sitting dead. I'd imagine you need to dive in if you want this: https://github.com/pantsbuild/pants/issues/18532 For context Dan / his company at the time (used to be) a big user, was a contributor, etc and it still didn't get done.
šŸ‘€ 1
f
That issue link is very helpful, and pretty much describes exactly the same thing I'm looking for. Thank you for the helpful context. I'll take a look at the draft PR linked to that issue šŸ‘