Skip to content

Commit d794f32

Browse files
committed
fix excluded dir marker check
When checking for markers that exclude the directory that contains them, the hook erroneously expected these markers to be directories instead of files. This breaks with the CACHEDIR.TAG spec, which explicitly states: > This file *must* be an ordinary file, not for example a symbolic link.
1 parent 51fbd7e commit d794f32

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/maturin_import_hook/project_importer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ def get_files_in_dir(
593593

594594
for dir_str, dirs, files in os.walk(root_path, topdown=True):
595595
dir_path = Path(dir_str)
596-
include_dir = dir_path not in ignore_dirs and not any(dir_name in excluded_dir_markers for dir_name in dirs)
596+
include_dir = dir_path not in ignore_dirs and not any(name in excluded_dir_markers for name in files)
597597

598598
if include_dir:
599599
dirs[:] = sorted(dir_name for dir_name in dirs if dir_name not in excluded_dir_names)

0 commit comments

Comments
 (0)