The chemical reactions and pathways involving a purine-containing compound, i.e. any compound that contains purine or a formal derivative thereof.