Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/about/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Fixes:

- Improve `.gitignore` iteration speed by @silversquirl in #1103
- Warn on 3.13.4 on Windows by @henryiii in #1104
- Add logging explaining why a file is included/excluded by @henryiii in #1110

Documentation:

Expand Down
19 changes: 18 additions & 1 deletion src/scikit_build_core/build/_file_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@

import pathspec

from scikit_build_core.format import pyproject_format
from .._logging import logger
from ..format import pyproject_format

if TYPE_CHECKING:
from collections.abc import Generator, Sequence
Expand Down Expand Up @@ -72,19 +73,31 @@ def each_unignored_file(
for p in all_paths:
# Always include something included
if include_spec.match_file(p):
logger.info("Including {} because it is explicitly included.", p)
yield p
continue

# Always exclude something excluded
if user_exclude_spec.match_file(p):
logger.info(
"Excluding {} because it is explicitly excluded by the user.", p
)
continue

# Ignore from global ignore
if global_exclude_spec.match_file(p):
logger.info(
"Excluding {} because it is explicitly excluded by the global ignore.",
p,
)
continue

# Ignore built-in patterns
if builtin_exclude_spec.match_file(p):
logger.info(
"Excluding {} because it is excluded by the built-in ignore patterns.",
p,
)
continue

# Check relative ignores (Python 3.9's is_relative_to workaround)
Expand All @@ -93,6 +106,10 @@ def each_unignored_file(
for np, nex in nested_excludes.items()
if dirpath == np or np in dirpath.parents
):
logger.info(
"Excluding {} because it is explicitly included by nested ignore.",
p,
)
continue

yield p
Loading
Loading