How to compile custom actions.py to find syntax errors on docker compose

Hi,

I am running rasa/rasa x on docket compose. After making changes in actions.py, I use to down and up docker compose. Before getting down and up docker compose, is there a way to check and found syntax error on actions.py. Any command for that?

Thanks