quaint-telephone-89068
11/09/2022, 6:12 PMdependees (now dependents) does not return dependent files. On the latest version 2.14 and it seems to be a warning:
10:28:00.15 [WARN] Pants cannot infer owners for the following imports in the target app/module_1/example.py:
* app.module_2.example.test (line: 1)
On earlier versions it returns no output.
Describe the solution you'd like
When removing modules and then running ./pants dependees --changed-since (or dependents), dependent targets of the removed modules will be returned in the output.
For example, given this module:
app/
__init__.py
module_1/
__init__.py
example.py (imports app.module_2.example)
BUILD
module_2/
__init__.py
example.py
BUILD
When removing app/module_2/, add changes in git and then running ./pants dependees --changed-since=HEAD it should return app/module_1/example.py in the results.
Describe alternatives you've considered
An additional layer of tooling over pants to detect these issues. Custom logic to account for this. Open to more ideas.
Additional info
Please see example repo with predefined version branches:
• https://github.com/njgrisafi/pants-example
Checkout one of the follow version branches above and perform the following test:
1. rm -rf app/module_2/
2. git add --all
3. ./pants dependees --changed-since=HEAD
pantsbuild/pants