average-australia-85137
08/24/2021, 5:54 PMhundreds-father-404
08/24/2021, 6:28 PM!
at each call site. Ack that's tedious
2. Intentionally introduce a new thing that results in ambiguity. Like, add a second version of the third-party dependency so that it's ambiguous and you have to explicitly opt-in to including the dep. But that is also kind of tedious and will result in lots of warnings about ambiguity, which you may want to avoid
I'm wondering more about your motivation - how come you don't want some things included?average-australia-85137
08/24/2021, 6:57 PM!
at each call site?
The context here is that we have a class that has attributes with types if imported eventually pull in the entire code base. But those attributes are never set or accessed in that file they are just declared so mypy doesn’t yell at us laterhundreds-father-404
08/24/2021, 6:59 PMaverage-australia-85137
08/24/2021, 7:03 PMhundreds-father-404
08/24/2021, 7:08 PMsources
, Pants creates a target per file for you automatically
Run ./pants dependencies path/to/file_with_import_you_want_to_ignore.py
, and you should see a file like path/to/file_to_ignore.py
or path/to/file_to_ignore.py:lib
. Copy that and put it with !
in the prefix in the dependencies
for the call site target. Does that make sense?average-australia-85137
08/24/2021, 7:42 PM