@@ -666,30 +666,33 @@ def filter_functions(
666666 submodule_ignored_paths_count : int = 0
667667 blocklist_funcs_removed_count : int = 0
668668 previous_checkpoint_functions_removed_count : int = 0
669- tests_root_str = str (tests_root )
670- module_root_str = str (module_root )
669+ # Normalize paths for case-insensitive comparison on Windows
670+ tests_root_str = os .path .normcase (str (tests_root ))
671+ module_root_str = os .path .normcase (str (module_root ))
671672
672673 # We desperately need Python 3.10+ only support to make this code readable with structural pattern matching
673674 for file_path_path , functions in modified_functions .items ():
674675 _functions = functions
675676 file_path = str (file_path_path )
676- if file_path .startswith (tests_root_str + os .sep ):
677+ file_path_normalized = os .path .normcase (file_path )
678+ if file_path_normalized .startswith (tests_root_str + os .sep ):
677679 test_functions_removed_count += len (_functions )
678680 continue
679681 if file_path in ignore_paths or any (
680- file_path .startswith (str (ignore_path ) + os .sep ) for ignore_path in ignore_paths
682+ file_path_normalized .startswith (os . path . normcase ( str (ignore_path ) ) + os .sep ) for ignore_path in ignore_paths
681683 ):
682684 ignore_paths_removed_count += 1
683685 continue
684686 if file_path in submodule_paths or any (
685- file_path .startswith (str (submodule_path ) + os .sep ) for submodule_path in submodule_paths
687+ file_path_normalized .startswith (os .path .normcase (str (submodule_path )) + os .sep )
688+ for submodule_path in submodule_paths
686689 ):
687690 submodule_ignored_paths_count += 1
688691 continue
689692 if path_belongs_to_site_packages (Path (file_path )):
690693 site_packages_removed_count += len (_functions )
691694 continue
692- if not file_path .startswith (module_root_str + os .sep ):
695+ if not file_path_normalized .startswith (module_root_str + os .sep ):
693696 non_modules_removed_count += len (_functions )
694697 continue
695698 try :
0 commit comments