def parse_dependency(value):
    """
    Basic support for version expression.  Right now it just parses
      mypackage==1.0.0 -> ('mypackage', '1.0.0')
      mypackage -> ('mypackage', None)
    """

    # Split into parts
    parts = value.split('==')

    # We always have name
    name = parts[0]

    # Pull out the version, or report an error
    if len(parts) == 1:
        version = None
    elif len(parts) == 2:
        version = parts[1]
    else:
        raise Exception('Invalid package expression: "%s"' % value)

    return (name, version)