France will end sales of petrol and diesel vehicles by 2040 as part of an ambitious plan to meet its targets under the Paris climate accord, Emmanuel Macron’s government has announced.