I think there's a `parse_requirements` dingus in pip that does all of this.