cool-easter-32542
05/12/2023, 5:41 AMdependencies-closed option which includes the input targets in the output. A Python module may import (and therefore depend) on itself by having an import of a member from that module or a string literal that would be mapped to that module name. You may want to skip reporting dependencies on the module itself to avoid adding # pants: no-infer-dep comments.
For example, it is not uncommon to declare a logger name in a Python module in this way:
```
# src/project/console.py
...
logger_name = "src.project.console"
```
which would result in having src/project/console.py reported as being dependent on src/project/console.py.
When analyzing the dependency graph using graph-based tools, it is desired to avoid cycles as the expectation is that the dependency graph would be a DAG, and having cycles in the graph (src/project/console.py depends on itself) will impede the graph analysis.
Describe the solution you'd like
A new flag --python-infer-ignore-self-imports to control whether these type of dependencies should be ignored.
Describe alternatives you've considered
Adding # pants: no-infer-dep comments on the undesired lines which may get impractical in a large repo.
pantsbuild/pants