Switch to python script and build astropy