A compound of formula and a stereoisomer thereof or a pharmaceutically acceptable salt thereof: wherein the ring A is selected from optionally substituted 4-12-membered heterocyclyl or 5-10-membered heteroaryl; R 1 is selected from H, hydroxyl, optionally substituted Ci-Cs alkyl, C 3 -C 8 cycloalkyl, C 2 -C 8 alkenyl, C 2 -C 8 alkynyl, 4-12-membered heterocyclyl, 6-10-membered aryl or 5-10-membered heteroaryl; R 2 is selected from cyano, -C=ONR 6 R 7, -C=ONR 6 NR 7 R 8, -C=ONHOR 6, -S m R 8, -S m -NHR 8 or -C=OOR 6; L is selected from amino, -NR 6 C=O-, -NR 6 C=ONR 10 -, -C=ONR 10 -, -C=ONR 6 O-, -C=ONR 6 NR 10 -, -NR 6 S m -, -S m NR 6 -, -NR 6 S m NR 7 -, -S m -, -C=O- or -C=OO-; or L is absent; R 3 is selected from H, optionally substituted Ci-Cs alkyl, C 3 -C 8 cycloalkyl or -C=OR 6; R 4 and R 5 are each independently selected from H, deuterium, halogen, cyano, nitro, optionally substituted Ci-Cs alkyl, C 3 -C 8 cycloalkyl, 6-10-membered aryl or 5-10-membered heteroaryl; R 6, R 7 and R 10 are each independently selected from H, optionally substituted Ci-Cs alkyl or C 3 -C 8 cycloalkyl; or, R 10 taken with N and R 1 to which it is attached can form an optionally substituted 4-12-membered heterocyclyl; wherein the substituent groups in the ring A and R 1 are each independently selected from one or more of halogen, hydroxyl, cyano, amino, sulfydryl, nitro, C 1 -C 8 alkyl, C 1 -C 8 alkoxy, C 3 -C 8 cycloalkyl, 4-12-membered heterocyclyl, 6-10-membered aryl, 5-10-membered heteroaryl, -(CH 2) n C=OOR 8, -OC=OR 8, -C=OR 8, -C=ONR 8 R 9, -NHC=OR 8, -NR 8 R 9, -OC=ONR 8 R 9, -NHC=ONR 8 R 9, -S m R 8, -S m -NHR 8, -NHC=OOR 8 or -NHS m R 8; m is selected from 1 or 2; n is selected from 1, 2, 3, 4 or 5; R 8 and R 9 are each independently selected from H, optionally substituted C 1 -C 8 alkyl or C 3 -C 8 cycloalkyl; and the substituent groups in the R 3, R 4, R 5, R 6, R 7, R 8, R 9 and R 10 are each independently selected from one or more of deuterium, halogen, hydroxyl, cyano, amino, sulfydryl, nitro, C 1 -C 8 alkyl, C 1 -C 8 alkoxy or C 3 -C 8 cycloalkyl. wherein the ring A is selected from optionally substituted 4-12-membered heterocyclyl or 5-10-membered heteroaryl; R 1 is selected from H, hydroxyl, optionally substituted Ci-Cs alkyl, C 3 -C 8 cycloalkyl, C 2 -C 8 alkenyl, C 2 -C 8 alkynyl, 4-12-membered heterocyclyl, 6-10-membered aryl or 5-10-membered heteroaryl; R 2 is selected from cyano, -C=ONR 6 R 7, -C=ONR 6 NR 7 R 8, -C=ONHOR 6, -S m R 8, -S m -NHR 8 or -C=OOR 6; L is selected from amino, -NR 6 C=O-, -NR 6 C=ONR 10 -, -C=ONR 10 -, -C=ONR 6 O-, -C=ONR 6 NR 10 -, -NR 6 S m -, -S m NR 6 -, -NR 6 S m NR 7 -, -S m -, -C=O- or -C=OO-; or L is absent; R 3 is selected from H, optionally substituted Ci-Cs alkyl, C 3 -C 8 cycloalkyl or -C=OR 6; R 4 and R 5 are each independently selected from H, deuterium, halogen, cyano, nitro, optionally substituted Ci-Cs alkyl, C 3 -C 8 cycloalkyl, 6-10-membered aryl or 5-10-membered heteroaryl; R 6, R 7 and R 10 are each independently selected from H, optionally substituted Ci-Cs alkyl or C 3 -C 8 cycloalkyl; or, R 10 taken with N and R 1 to which it is attached can form an optionally substituted 4-12-membered heterocyclyl; wherein the substituent groups in the ring A and R 1 are each independently selected from one or more of halogen, hydroxyl, cyano, amino, sulfydryl, nitro, C 1 -C 8 alkyl, C 1 -C 8 alkoxy, C 3 -C 8 cycloalkyl, 4-12-membered heterocyclyl, 6-10-membered aryl, 5-10-membered heteroaryl, -(CH 2) n C=OOR 8, -OC=OR 8, -C=OR 8, -C=ONR 8 R 9, -NHC=OR 8, -NR 8 R 9, -OC=ONR 8 R 9, -NHC=ONR 8 R 9, -S m R 8, -S m -NHR 8, -NHC=OOR 8 or -NHS m R 8; m is selected from 1 or 2; n is selected from 1, 2, 3, 4 or 5; R 8 and R 9 are each independently selected from H, optionally substituted C 1 -C 8 alkyl or C 3 -C 8 cycloalkyl; and the substituent groups in the R 3, R 4, R 5, R 6, R 7, R 8, R 9 and R 10 are each independently selected from one or more of deuterium, halogen, hydroxyl, cyano, amino, sulfydryl, nitro, C 1 -C 8 alkyl, C 1 -C 8 alkoxy or C 3 -C 8 cycloalkyl.