def removedeps(step, deps):
    """Remove a step.

    Since other steps might depend on it, once we're done with the
    step, we need to remove it from their dependencies.
    """

    maybenext = []

    del deps[step]
    for otherstep, deplist in deps.items():
        if step in deplist:
            deps[otherstep].remove(step)
            # if otherstep now has no dependencies, it's a
            # candidate for the next step to take
            if not deps[otherstep]:
                maybenext.append(otherstep)

    return maybenext