Replace specific .pi subdirectory paths with a broader glob pattern and add Python cache files to prevent committing generated artifacts.