Someone check me on this. I think I need a new fea...
# development
b
Someone check me on this. I think I need a new feature (at least for
pytest
) where the resolve the requirements come from isn't static. Instead you'd set
install_from_resolve
to
true
to say "install from the resolve of the test' source. It's for cases where: • You have
test_resolve_a
in resolve A. It uses fixtures or whatever, so does
import pytest
• You also have
test_resolve_b
in resolve B. Same schtick.
import pytest
• Their ICs don't overlap So no value of
install_from_resolve
would work. Not even putting
pytest
in its own resolve (because of the imports). Instead
pytest
should come from the resolve of the source file.
@happy-kitchen-89482 thoughts?
This isn't contrived either. • Resolve A is my company code. Python 3.8 • Resole B is my in-repo Pants plugins, Python 3.9
h
You could have a resolve that supports both versions (assuming it can be generated)?
b
Logically, I don't think that's correct. My user code shouldn't (and can't) import
pants
.
h
Why would having pytest in its own resolve not work?
b
It would, but would also be janky. Dependency inference means
pytest
would also have to be in each of the resolves, and hopefully of the same version as the pytest resolve.
h
I could imagine a dynamic
install_from_resolve
being useful (although not by passing
True
, as that is a typing nightmare). It would need to be implemented generically, but I think that's fine. We should always be partitioning by resolve before we use a tool anyway.
It may even be more natural for some, as it more closely tracks non-Pants venv-based workflows
b
I'm not sure it would be a typing nightmare. Unions exist 🙂
h
Not in the options system though
We have a specific set of types there
Which we also have to handle in Rust
b
Oh right. It's doable, I think, but possible ill-advised
h
I very much don't want to complicate the options system any further
It's already a beast
s
I hit the same use case for pylint before I left Color - there’s an existing issue floating somewhere
Oh wait I guess that was pytest too
Been awhile 😅