No, Anthony Pettis has not retired from MMA. He has not fought since 2019, but he has not announced his retirement. He is still under contract with the UFC, and he has said that he would like to return to fighting.
Pettis Punch: Testing Your Knowledge on MMA Phenom Anthony "Showtime" Pettis