The check script needs to run at build time. Add a new argument to makePythonWriter for the appropriate buildPackages version of pythonPackages, and use this to run the check script.
buildPackages