Provided are pyridines and pyrazines, which are inhibitors of kinase P13K and have the formula (I) as depicted, wherein R1 and R2 are each independently selected from hydrogen, C1-C6 alkyl, C3-C8 cycloalkyl, C1-C3 alkyl-C3-C8 cycloalkyl, C1-C3 alkyl-C1-C6 alkoxy and (CH2)m heterocyclyl or R1 and R2, together with the nitrogen atom to which they are attached form a 5- or 6-membered nitrogen-containing heterocyclic group and the other substituents are as specified. The compounds are useful in treating a wide range of inflammatory or allergic conditions.