Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: sdist.exclude takes precedence over .gitignore #872

Merged
merged 1 commit into from
Aug 22, 2024

Conversation

alexreinking
Copy link
Contributor

Previously, sdist.exclude and the built-in EXCLUDE_LINES were prepended to the list of .gitignore rules. However, a common pattern of using * to exclude everything and then using !-rules to list what should be included renders this feature useless.

This commit changes the behavior of each_unignored_file to sequentially consider the following sets of independent rules:

  1. Explicit inclusions
  2. Explicit exclusions
  3. Global exclusions from the .gitignore files
  4. The built-in exclusions
  5. Nested exclusions from .gitignore

Fixes #871

Previously, sdist.exclude and the built-in EXCLUDE_LINES were prepended
to the list of .gitignore rules. However, a common pattern of using *
to exclude everything and then using !-rules to list what should be
included renders this feature useless.

This commit changes the behavior of each_unignored_file to sequentially
consider the following sets of independent rules:

1. Explicit inclusions
2. Explicit exclusions
3. Global exclusions from the .gitignore files
4. The built-in exclusions
5. Nested exclusions from .gitignore

Fixes scikit-build#871
@henryiii henryiii changed the title sdist.exclude takes precedence over .gitignore fix: sdist.exclude takes precedence over .gitignore Aug 22, 2024
Copy link

codecov bot commented Aug 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.01%. Comparing base (26ca7ed) to head (3f0bfb0).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #872      +/-   ##
==========================================
+ Coverage   83.98%   84.01%   +0.02%     
==========================================
  Files          74       74              
  Lines        4372     4378       +6     
==========================================
+ Hits         3672     3678       +6     
  Misses        700      700              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@alexreinking
Copy link
Contributor Author

@henryiii -- I'm not understanding what failed in the CI runs or why. Can you take a look, please?

@henryiii
Copy link
Collaborator

GHA was down: https://www.githubstatus.com

@henryiii henryiii merged commit 3236636 into scikit-build:main Aug 22, 2024
57 of 59 checks passed
@henryiii
Copy link
Collaborator

Thanks!

@alexreinking alexreinking deleted the patch-1 branch August 22, 2024 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sdist.exclude should not be overridden by .gitignore
2 participants