fresh-cat-90827
12/05/2022, 10:48 PM./pants dependencies
does when dependency inference is disabled and enabled š§µcp helloworld/translator/translator_test.py helloworld/translator/translator_another_test.py
$ ./pants dependencies helloworld/translator/translator_test.py
//:reqs#pytest
helloworld/translator/translator.py:lib
$ PANTS_PYTHON_INFER_IMPORTS=False ./pants dependencies helloworld/translator/translator_test.py
helloworld/translator/translator_another_test.py:tests
Why does Pants report translator_another_test.py
to be a dependency of helloworld/translator/translator_test.py
? It's clearly not:
$ ./pants paths --to=helloworld/translator/translator_test.py --from=helloworld/translator/translator_another_test.py
[]
It must have something to do with the fact that they are part of the same target, but I can't find the reasoning behind this behavior when dependency inference is disabled.curved-television-6568
12/05/2022, 10:51 PMfresh-cat-90827
12/05/2022, 10:52 PMpython_sources
, but for python_tests
? šcurved-television-6568
12/05/2022, 10:56 PMhundreds-father-404
12/05/2022, 10:58 PMbut generally it'd be better to have an option to disable this.advanced option on python-infer. In fact I thought we added it, but couldn't find it. Someone wanted it 2 months ago
fresh-cat-90827
12/05/2022, 11:06 PM$ ./pants --changed-since=HEAD --changed-dependees=direct \
--filter-target-type=python_test list
The use case is that if there have been changes to a test module, this command would list all Python test modules in the same python_tests
target which is unnecessaryhappy-kitchen-89482
12/05/2022, 11:45 PMthat is, with dep inference off, thereās an implicit assumption that all files in the same module have a dependency on each other.Is it āall files in the same moduleā or āall files in the same target generatorā?
hundreds-father-404
12/05/2022, 11:46 PMcurved-television-6568
12/06/2022, 12:25 AM