-
Notifications
You must be signed in to change notification settings - Fork 29
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
Add functionality for ignoring notebooks #13
Conversation
Thanks for your contribution @natanlao We can actually simplify this quite a bit. From requirements perspective, we don't need to support multiple With these requirements in mind we can simply implement the following,
Edit: Updated my own suggestions. |
I'm not sure that only looking for a single
That works! Line 30 in 833ccde
|
@natanlao I'm sorry I haven't been able to find free time to review this properly. I want to clone your changes and try it out locally for a meaningful review. I will get to it early next week. Sorry again for the delay. |
@amit1rrr All good! Thanks for your time. |
elif path.is_dir(): | ||
LOG.info("Recursively scanning %s for notebooks...", path) | ||
ignored = build_ignore_list(path) | ||
notebooks = filter(lambda nb: nb not in ignored, path.glob('**/*.ipynb')) |
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.
Ignore paths are not working recursively.
E.g. Even if I have following rule in .treonignore
site/en/r2/*
all these following files are not-ignored
/workspace/treon/tmp/docs/site/en/r2/tutorials/eager/custom_layers.ipynb
/workspace/treon/tmp/docs/site/en/r2/tutorials/load_data/images.ipynb
...
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.
Ah, good catch. It looks like pathlib
isn't working predictably...
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.
This is still not working for me.
I have following rules in .treonignore -
site/en/r2/*
site/en/r2/tutorials/load_data/tf_records.ipynb
and the following files are still not ignored
'/workspace/treon/tmp/docs/site/en/r2/tutorials/eager/custom_layers.ipynb', '/workspace/treon/tmp/docs/site/en/r2/tutorials/load_data/images.ipynb', '/workspace/treon/tmp/docs/site/en/r2/tutorials/load_data/tf_records.ipynb'
Thanks for the review @amit1rrr! I've addressed your comments and added tests cases where appropriate. |
I tried it again. Somehow the ignore list is still not working for me. Posted example in a separate comment. I honestly think that this approach is getting too complicated in our quest to be identical as Some benefits over current approach,
|
Okay! Sounds good to me. |
Discarding this PR now that we have --exclude command line option. |
Sorry, this got stuck on my backlog! Thanks for following up. |
No worries @natanlao |
Closes #1. Allows ignoring notebooks with a
.treonignore
file. It mimics how.gitignore
files work, except a little simpler.