def components(accountable, project_key):
    """
    Returns a list of all a project's components.
    """
    components = accountable.project_components(project_key)
    headers = sorted(['id', 'name', 'self'])
    rows = [[v for k, v in sorted(component.items()) if k in headers]
            for component in components]
    rows.insert(0, headers)
    print_table(SingleTable(rows))
Returns a list of all a project's components.