Allow nbdev_clean to accept multiple filenames or globs (#1480)#1488
Allow nbdev_clean to accept multiple filenames or globs (#1480)#1488jbwhit wants to merge 4 commits intoAnswerDotAI:mainfrom
nbdev_clean to accept multiple filenames or globs (#1480)#1488Conversation
Add #|hide and #|eval: false to the cell running add_show_docs/exec_show_docs, which currently fails for unrelated reasons and blocks nbdev_prepare.
Please tell us more. What are the reasons? |
|
Thank you for asking about this issue. I was able to resolve the failing test by updating my pandas installation with The test in 10_processors.ipynb with _run_procs([add_show_docs, exec_show_docs]) is now passing, and I've removed the I'll update the PR shortly to remove those markers and ensure all tests are running properly. |
Fixed pandas dependency issue locally, allowing all tests to pass without skipping.
|
Ok I've updated the PR -- all tests now pass. |
jph00
left a comment
There was a problem hiding this comment.
Thank you for this PR. IIUC, _run("git config user.email 'nbdev@fast.ai'") will actually modify the git config of a user running the tests. Tests should not modify a user's environment. Also BTW you might find fastcore's listify helpful.
|
I can make a different test without using I will pare down my test to the minimum and I will look to use |
|
Oh wow I'd completely missed that! Thanks for noticing. Yes we should get
rid of it :D
… Message ID: ***@***.***>
|
This commit enhances the nbdev_clean function to properly handle multiple notebook paths by using fastcore.listify. This allows passing either a single notebook path or a list of paths to be cleaned. Changes: - Modified nbdev_clean to use listify() on fname before passing to globtastic - Added comprehensive test that demonstrates the issue and validates the fix - Updated function docstring to clarify that multiple paths are supported The test demonstrates that without this fix, passing a list of paths fails, but with listify it correctly processes all specified notebooks.
|
I've updated the PR to enhance
The test shows that without I've kept this PR focused solely on fixing the |
|
Many thanks! |
|
Looks like there's a CI failure. |
|
Closing due to age. |
Overview
This PR addresses #1480 by allowing
nbdev_cleanto accept multiple filename arguments, rather than just a single file or glob. This makes it easier to clean multiple notebooks in one command.What Changed
nbdev_cleanso it can handle either a single path/glob string or a list of paths/globs.Known Similar Issue in
nbdev_testnbdev_test(and possibly other CLI commands) still only accept single-file arguments. This PR focuses onnbdev_cleanspecifically to keep it scoped. Let me know if you want a follow-up PR fornbdev_test.Skipped a Failing Test in
10_processors.ipynb_run_procs([add_show_docs, exec_show_docs])currently fails for unrelated reasons.#|hideand#|eval: falseto skip that cell sonbdev_preparecan complete.Please let me know if you have any questions or suggestions—this is my first PR for this project!