PARIS — In the aftermath of a historic presidential election, France’s politics are in upheaval. A generation of political leaders has been swept aside. New ones are emerging. Parties are collapsing or struggling to remake themselves as politicians scramble to form alliances to maintain their power.

The most obvious and pressing challenge confronts the victor, Emmanuel Macron, who will officially become president on Sunday. With national legislative elections less than five weeks away, he must find a way to forge a working majority in the National Assembly, France’s lower house of Parliament.

For Mr. Macron, the legislative elections are in many ways the third round of the presidential race — they are even called that by some in the French news media — because they will determine his real strength to push through his controversial agenda to make the French economy less rigid.

Mr. Macron has no party in the current Parliament. So his top aides have urgently set about selecting candidates to run in almost every parliamentary district in the country.