modern-manchester-33562
08/18/2023, 9:08 AMunowned_dependency_behavior = "error" we're seeing the following error:
UnownedDependencyError: Pants cannot infer owners for the following imports in the target test/core/foo_test/unit_tests/test_bar.py:tests:
* pytest (line: 2)
These imports are not in the resolve used by the target (`python-default`), but they were present in other resolves:
* pytest: 'dev' from reqs:pytest_requirements_dev#pytest
Switching this to ignore seems to have no effect since it is still using the pytest specific resolve (we set install_from_resolve = "dev"). Why isn't the dependency inference understand this?
Also, looking at the example projects it seems that the recommendation is to have runtime and test requirements together in one lock file. Is this true? Should we rather restructure our setup to reflect this?broad-processor-92400
08/18/2023, 8:49 PMmodern-manchester-33562
08/19/2023, 6:20 PMpytest called dev. It contains all requirements of python-default and all test requirements including pytest. When running pants test :: everything works as expected. However, during dependency inference checking if unowned_dependency_behavior = "error" is set, then it incorrectly tries to infer these dependencies using the python-default resolve. To me it looks like
[pytest]
install_from_resolve = "dev"
is ignored during dependency inference. Can you confirm or do we have another misconfiguration elsewhere?broad-processor-92400
08/20/2023, 12:05 AMacoustic-winter-15134
03/26/2025, 6:55 PM