Fix various problems with --import-graph filename parsing (#4259)

Avoids backwards-incompatible changes.
 - Raise error if graphvis is not installed (instead of reporting success)
 - Fix tempfile creation bug when outputfile includes directories
 - Fix bug when using file extension that isn't 3 characters long
 - Fix confusing help text
 - Rename deprecated .dot extension to .gv
 - Default to .png if no extension is specified

* Add typing to modified functions (and ignore mypy thinking codecs.open()
returns an int)

Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
5 files changed