Description: Making traitsui dependency optional
 If users don't have traitsui, then GUI-specific functions now do nothing
 instead of crashing the application.  This really helps for running unit tests
 on build machines without any X-server which have problems when running
 traitsui functions. Failure to import traitsui is no longer fatal. traitsui
 is only Recommended until we can get it python3'd. This lets us keep ~98% of
 functionality.
Author: Stewart Fergusonm <stew@ferg.aero>
Forwarded: https://github.com/enthought/apptools/pull/86
Last-Update: 2019-02-03
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/apptools/naming/trait_defs/naming_traits.py
+++ b/apptools/naming/trait_defs/naming_traits.py
@@ -22,8 +22,11 @@ from traits.api \
 from traits.trait_base \
     import class_of, get_module_name
 
-from traitsui.api \
-    import DropEditor
+try:
+    from traitsui.api \
+        import DropEditor
+except ImportError:
+    pass
 
 from apptools.naming.api \
     import Binding
@@ -101,11 +104,15 @@ class NamingTraitHandler ( TraitHandler
 
     def get_editor ( self, trait ):
         if self.editor is None:
-            from traitsui.api import DropEditor
+            try:
+                from traitsui.api import DropEditor
+
+                self.editor = DropEditor( klass    = self.aClass,
+                                          binding  = True,
+                                          readonly = False )
+            except ImportError:
+                pass
 
-            self.editor = DropEditor( klass    = self.aClass,
-                                      binding  = True,
-                                      readonly = False )
         return self.editor
 
     def post_setattr ( self, object, name, value ):
--- a/apptools/__init__.py
+++ b/apptools/__init__.py
@@ -7,6 +7,5 @@ except ImportError:
     __version__ = 'not-built'
 
 __requires__ = [
-    'traitsui',
     'configobj',
 ]
