-
-
Notifications
You must be signed in to change notification settings - Fork 324
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
Limit search for VCS ignore files in hatchling
#1273
Comments
My thought is to maintain the behavior of finding the first ignore file, but then only break if a How does that sound? |
An example project can be found at https://github.com/astral-test/uv-public-pypackage/tree/395ba191b190da0451c1e67a9b4a1cb5340398e5 Reproduction is something like this
Would this break if run from the repository root then? Since it'd have a |
Hello, I came across this issue while troubleshooting why rules from a global .gitignore configuration were not being recognized. Honoring the first identified .gitignore for a project is not sufficient for the case where the full rule set that would normally apply to a project context also depends on other configuration used by Git. Rather than try to maintain hatchling specific semantics for resolving and honoring the Git ignore set, would it be possible for hatchling to defer to Git's own ruleset interpretation? For example, something like I think asking Git itself to be the filter would also address the concern for projects that do not include a .gitignore file which should then fall back onto whatever heuristic Git uses in that situation. |
pypa/hatch#1273 bit us again, unfortunately we need to just populate this to be sure we stop upward traversal on build.
Finding a |
If a Git repository does not contain a
.gitignore
file,hatchling build
will search for one in the parent directories. This makes building source distributions for a package inconsistent across systems as an arbitrary.gitignore
file can be selected. This could be resolved by avoiding traversal acrossgit
boundaries, i.e. limit the search to a single repository or by disabling this behavior by default (in which case, it will probably be enabled in a monorepo with a.gitignore
).The text was updated successfully, but these errors were encountered: