fresh-cat-90827
04/11/2023, 5:19 PMA depends on B because B provides foo, however, the foo is declared in C, so now A depends both on B and C (transitively). A -> B -> C is what we have but we could have A -> C and B -> C. 🧵fresh-cat-90827
04/11/2023, 5:19 PM# a.py
from b import foo
# this should really be
# from c import foo
# b.py
from c import foo
# c.py
foo = "bar"
I've searched online for a while and found nothing. Pants dependency graph won't be of help as it doesn't currently expose imported items (i.e. individual code elements) - one would need to check where the variable is declared anyway (which is not trivial).
This issue is not immediately harmful -- if foo is not longer in B (but A still depends on it), then this would be likely caught during the tests. But it does lead to unnecessary dependencies which may be harmful if B depends on ton of other stuff, in particular.wide-midnight-78598
04/11/2023, 5:26 PMbitter-ability-32190
04/11/2023, 5:29 PMwide-midnight-78598
04/11/2023, 5:33 PMfresh-cat-90827
04/11/2023, 5:34 PMfresh-cat-90827
04/11/2023, 5:35 PM