CoPa: General Robotic Manipulation through Spatial Constraints of Parts with Foundation Models