-
Notifications
You must be signed in to change notification settings - Fork 74
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
Added ignore kwarg to traverse() in common, allowing directory pruning #209
Conversation
Hmm, I forgot about the Windows implementation |
Thanks, ill review later when i get to my computer.
I think there are only a few Windows users, so unless you have easy access
to windows computer, no need to worry for now! (as long as it doesn't crash)
…On Sun, Feb 28, 2021, 00:34 Cobertos ***@***.***> wrote:
Hmm, I forgot about the Windows implementation
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#209 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACHEBKDGBX2R7GUO74CCQTTBGFSTANCNFSM4YKOUCVA>
.
|
Oh okay, I already fixed x3 |
Oh, I also forgot to mention that this requires |
Ah, it's already a dependency: Line 34 in 20a07c2
so no problem with that. |
Sorry, need to figure out how to run github CI against other's people's PRs -- at the moment it's only triggered by my own pushes only, so I need to checkout PR and push it to trigger. Looks like it's failing
guess find doesn't guarantee order. mypy also is going to complain
If you allow edits from maintainers, I don't mind quickly fixing it. |
Hmm, it should allow maintainers to edit. The checkbox was checked?
Oh yeah, the order, I usually use pythons unittest asserts. Probably just
needs a Set comparison
What is the Python typing stuff, how do I run it? Never seen that before.
…On Sun, Feb 28, 2021, 9:01 AM karlicoss ***@***.***> wrote:
Sorry, need to figure out how to run github CI against other's people's
PRs -- at the moment it's only triggered by my own pushes only, so I need
to checkout PR and push it to trigger.
------------------------------
Looks like it's failing ignore_find test (CI=true tox -e tests -- -k
ignore_find)
E Full diff:
E [
E + PosixPath('/adhoc-project/tests/testdata/traverse/imhere.txt'),
E PosixPath('/adhoc-project/tests/testdata/traverse/imhere2/real.txt'),
E - PosixPath('/adhoc-project/tests/testdata/traverse/imhere.txt'),
E ]
guess find doesn't guarantee order.
------------------------------
mypy also is going to complain CI=true tox -e mypy-core:
src/promnesia/common.py: note: In function "find_args":
src/promnesia/common.py:401: error: Argument 1 to "chain" has incompatible type "*Iterator[List[str]]"; expected
"Iterable[List[str]]" [arg-type]
ignore_names = list(itertools.chain(*intersperse(['-o'], ignore_names)))
^
src/promnesia/common.py:411: error: List item 2 has incompatible type "List[Sequence[str]]"; expected "str" [list-item]
*prune_dir_args,
^
src/promnesia/common.py:413: error: List item 5 has incompatible type "List[Sequence[str]]"; expected "str" [list-item]
*ignore_file_args
^
src/promnesia/common.py: note: In function "fdfind_args":
src/promnesia/common.py:425: error: Argument 1 to "chain" has incompatible type "*List[List[str]]"; expected
"Iterable[List[str]]" [arg-type]
ignore_args = list(itertools.chain(*ignore_args))
^
src/promnesia/common.py:429: error: List item 1 has incompatible type "List[List[str]]"; expected "str" [list-item]
*ignore_args,
^
If you allow edits from maintainers, I don't mind quickly fixing it.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#209 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABTSGCH52YDLZFDKRRR6JVTTBJEERANCNFSM4YKOUCVA>
.
|
Ah, indeed, pushing onto the branch works, not sure why it didn't first time I tried! Python typing stuff is mypy. In principle, possible to run it as Lines 32 to 39 in 708d073
Either way, it was nothing major, just mypy being a bit picky about reusing the name with a different type, I quickly fixed it. |
Oh I see, I haven't used tox at all. I will have to look into how that's all set. Looks like you got the PR CI stuff working too. |
Thanks for the contribution! |
This adds an optional kwarg to traverse() in common.py, allowing directories that are ignored to be pruned by fdfind and find, instead of iterating over and excluding later.
There's also two tests to make sure that this is working with both fdfind and find. Passes on my machine