path_glob: "%%PYTHON_SITELIBDIR%%/*" trigger: { type: lua sandbox: false script: <=> removed stale bytecode " .. bytecode_file) os.remove(full_path .. "/" .. bytecode_file) end end end end local res = pkg.readdir(full_path) if #res == 0 then --print(" >=> removed empty directory " .. full_path ) os.remove(full_path) end end end end print(">=> Cleaning stale bytecode files...") cleanup("%%PYTHON_SITELIBDIR%%") print(">=> Byte-compiling Python source files...") pkg.exec({"%%PYTHON_VERSION%%", "-m", "compileall", "-q", "%%PYTHON_SITELIBDIR%%"}) pkg.exec({"%%PYTHON_VERSION%%", "-O", "-m", "compileall", "-q", "%%PYTHON_SITELIBDIR%%"}) pkg.exec({"%%PYTHON_VERSION%%", "-OO", "-m", "compileall", "-q", "%%PYTHON_SITELIBDIR%%"}) EOS }