import warnings
try:
    import PySide  # noqa
except ImportError:
    warnings.warn("Failed to import PySide. "
                  "gui will not be available.", ImportWarning)

    def main():
        """Start signac-gui.

        The gui is only available if PySide is installed."""
        raise ImportError(
            "You need to install PySide to use the gui.")
else:
    from .gui import main

__all__ = ['main']

import warnings
try:
    import PySide  # noqa
    import pymongo  # noqa
except ImportError as error:
    msg = "{}. The signac gui is not available.".format(error)
    warnings.warn(msg, ImportWarning)

    def main():
        """Start signac-gui.

        The gui requires PySide and pymongo."""
        raise ImportError(msg)
else:
    from .gui import main

__all__ = ['main']

Remove hard dependency for pymongo.
Remove hard dependency for pymongo.

Caused by pulling the gui package into the signac namespace.
Fixes issue #24.

  import warnings
  try:
      import PySide  # noqa
+     import pymongo  # noqa
- except ImportError:
+ except ImportError as error:
-     warnings.warn("Failed to import PySide. "
-                   "gui will not be available.", ImportWarning)
+     msg = "{}. The signac gui is not available.".format(error)
+     warnings.warn(msg, ImportWarning)
  
      def main():
          """Start signac-gui.
  
-         The gui is only available if PySide is installed."""
+         The gui requires PySide and pymongo."""
-         raise ImportError(
+         raise ImportError(msg)
-             "You need to install PySide to use the gui.")
  else:
      from .gui import main
  
  __all__ = ['main']
  
Remove hard dependency for pymongo.
## Code Before:
import warnings
try:
    import PySide  # noqa
except ImportError:
    warnings.warn("Failed to import PySide. "
                  "gui will not be available.", ImportWarning)

    def main():
        """Start signac-gui.

        The gui is only available if PySide is installed."""
        raise ImportError(
            "You need to install PySide to use the gui.")
else:
    from .gui import main

__all__ = ['main']

## Instruction:
Remove hard dependency for pymongo.
## Code After:
import warnings
try:
    import PySide  # noqa
    import pymongo  # noqa
except ImportError as error:
    msg = "{}. The signac gui is not available.".format(error)
    warnings.warn(msg, ImportWarning)

    def main():
        """Start signac-gui.

        The gui requires PySide and pymongo."""
        raise ImportError(msg)
else:
    from .gui import main

__all__ = ['main']
