https://pantsbuild.org/ logo
#general
Title
# general
h

happy-family-315

02/08/2023, 9:15 AM
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

refined-addition-53644

02/08/2023, 9:16 AM
yeah sadly that’s the case currently. There is quite a bit of duplication that happens with certain tools.
h

happy-kitchen-89482

02/08/2023, 4:01 PM
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
12 Views