-
Notifications
You must be signed in to change notification settings - Fork 648
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
Avoid ignore crate finding cache gitignore #2615
Conversation
We put a `.gitignore` with `*` at the top of our cache. When maturin was building a source distribution inside the cache, it would walk up the tree to find a gitignore, see that and ignore all python files. We now add an (empty) `.git` directory one directory below, in the root of built-wheels, which prevents ignore walking further up (it marks the top level a git repository). Deptry (from #2490) is a mid sized rust package with additional python packages, so instead of using it in the test i've replaced it with a small (44KB total) reproducer that uses cffi for faster building, the entire test taking <2s on my machine. Fixes #2490
:D this is an endless source of trouble Related: |
Why doesn't #2466 address this? |
As i understand it, ignore walks up until it finds a git repository root, since gitignores extend each other (cc @BurntSushi) |
Yeah, although you can opt out of You can also explicitly opt out of the "ascend the directory tree" behavior with |
@@ -0,0 +1,11 @@ | |||
[package] | |||
name = "deptry_reproducer" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we put this in editable-installs
, just because that's where all our other local packages are?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mind if i rename editable installs to packages
first in a separate PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that’s fine.
@charliermarsh should I release this? |
We put a
.gitignore
with*
at the top of our cache. When maturin was building a source distribution inside the cache, it would walk up the tree to find a gitignore, see that and ignore all python files. We now add an (empty).git
directory one directory below, in the root of built-wheels cache. This prevents ignore walking further up (it marks the top level a git repository).Deptry (from #2490) is a mid sized rust package with additional python packages, so instead of using it in the test i've replaced it with a small (44KB total) reproducer that uses cffi for faster building, the entire test taking <2s on my machine.
Fixes #2490