Hi, some of my python tests import pytest. I'm get...
# general
h
Hi, some of my python tests import pytest. I'm getting a warning every time this happens:
Copy code
[WARN] Pants cannot infer owners for the following imports in the target test_...py:tests:
  * pytest (line: 1)
If I add pytest to requirements.txt and my default lockfile this does not happen. But now I have 2 pytest versions to maintain. One in the default lockfile and one in the pytest lockfile. Is this the only way to resolve the warning. I think pants should infer dependencies based on the pytest lockfile too when running
./pants test ...
👍 2
r
yeah sadly that’s the case currently. There is quite a bit of duplication that happens with certain tools.
h
Yeah,
pytest
has two roles here, it's a library you import in your code (well, tests) like any other, and it's also a tool that Pants invokes.
I am working towards being able to point specific tools at your user lockfile instead of having a separate lockfile for them.
Which would solve this duplication