Is there a way to reference the pytest requirement...
# general
f
Is there a way to reference the pytest requirement defined in
pants.toml
to allow pants to find that as an owner during dep resolution. Currently
import pytest
in my tests works (because the python backend defines its own pytest version) but it warns that it isn't mapped to an owner when doing dep inference. I can fix this by adding a blanket "pytest" to requirements file somewhere, but that feels weird
doing this "feels wrong" because it's unpinned/open-ended:
Copy code
python_requirement(
    name="dev",
    requirements=["pytest"],
    description="Hack to get pytest ownership recognition to work in tests.",
)
r
why does adding it to requirements file feel weird? It won't be packaged in any application anyways as long as you are relying on pants to figure out all the dependencies.
b
Adding it to requirements is right, but it is weird and requires duplication of versions right now. In 2.16 (I think?), tools will be able to be pulled from your normal resolve, which will make that requirement the “source of truth” in terms of version, and resolve the duplication
f
requires duplication of versions right now
Exactly that is what felt weird
👍 1
I can try out 2.16rc3 that Stu cut today
b
Yeah that's exactly the thing 2.16 fixes 🎉