So we have a rather large program written in Python using PySide/QT to get most of its GUI work done. We use Chaco to do some plotting.
This program also has a full CLI interface.
Every now and then a developer accidentally creates an import chain that causes our CLI runs to try and import something from PySide or Chaco. This causes our CLI runs to die with "cannot connect to x server" as either PySide or Chaco is trying to initialize X via QT.
Any tips on how to prevent this? Can we stub out and override some function that is doing this? Some flag we can pass along? Currently our prevention mechanism is track down the bad import and refactor.