Exclude __pycache__ dirs for project generation

This commit is contained in:
jelmert 2025-04-15 09:35:21 +02:00 committed by Jelmer Draaijer
parent d19f22967f
commit 2bcf200ea8

View File

@ -151,10 +151,11 @@ def _fixture_id(ctx):
def build_files_list(base_path: Path): def build_files_list(base_path: Path):
"""Build a list containing absolute paths to the generated files.""" """Build a list containing absolute paths to the generated files."""
excluded_dirs = {".venv", "__pycache__"}
f = [] f = []
for dirpath, subdirs, files in base_path.walk(): for dirpath, subdirs, files in base_path.walk():
if ".venv" in subdirs: subdirs[:] = [d for d in subdirs if d not in excluded_dirs]
subdirs.remove(".venv")
for file_path in files: for file_path in files:
f.append(dirpath / file_path) f.append(dirpath / file_path)