@@ -8,6 +8,8 @@ def get_files_by_projects(projects_dirs_paths: list[Path]) -> dict[Path, list[Pa
88 project_dir = projects_dirs_paths [0 ]
99 files_by_projects_dirs [project_dir ] = [
1010 path for path in project_dir .rglob ("*.py" )
11+ # TODO: make configurable?
12+ if '__testdata__' not in path .relative_to (project_dir ).parts and '.venvs' not in path .relative_to (project_dir ).parts
1113 ]
1214 else :
1315 # copy to avoid modifying of argument values
@@ -54,6 +56,8 @@ def get_files_by_projects(projects_dirs_paths: list[Path]) -> dict[Path, list[Pa
5456 # if there are no children with subprojects, we can just rglob
5557 files_by_projects_dirs [project_dir_path ].extend (
5658 path for path in project_dir_path .rglob ("*.py" )
59+ # TODO: make configurable?
60+ if '__testdata__' not in path .relative_to (project_dir_path ).parts and '.venvs' not in path .relative_to (project_dir_path ).parts
5761 )
5862 else :
5963 # process all dir items which don't have child projects
@@ -66,6 +70,8 @@ def get_files_by_projects(projects_dirs_paths: list[Path]) -> dict[Path, list[Pa
6670 elif dir_item .is_dir ():
6771 files_by_projects_dirs [project_dir_path ].extend (
6872 path for path in dir_item .rglob ("*.py" )
73+ # TODO: make configurable?
74+ if '__testdata__' not in path .relative_to (project_dir_path ).parts and '.venvs' not in path .relative_to (project_dir_path ).parts
6975 )
7076
7177 # process all dir items which have child projects
@@ -103,6 +109,8 @@ def get_files_by_projects(projects_dirs_paths: list[Path]) -> dict[Path, list[Pa
103109 # subdirectory without child projects, rglob it
104110 files_by_projects_dirs [project_dir_path ].extend (
105111 path for path in dir_item .rglob ("*.py" )
112+ # TODO: make configurable?
113+ if '__testdata__' not in path .relative_to (project_dir_path ).parts and '.venvs' not in path .relative_to (project_dir_path ).parts
106114 )
107115
108116 return files_by_projects_dirs
0 commit comments