fastai / nbdev

Create delightful software with Jupyter Notebooks
https://nbdev.fast.ai/
Apache License 2.0
4.93k stars 488 forks source link

nbdev_update_lib errors out when fname not supplied #415

Closed RenzoBenemerito closed 3 years ago

RenzoBenemerito commented 3 years ago

https://github.com/fastai/nbdev/blob/f8d6ed294425a6b306eeff09a640714dc5ed252d/nbdev/sync.py#L126

When doing nbdev_update_lib without specifying the optional fname argument, it fails with an error as shown below instead of traversing the lib path directory.

image

RenzoBenemerito commented 3 years ago

I think its caused by this commit https://github.com/fastai/nbdev/commit/f2f4c32c385d3dc7920edd723d73f704bc00255d#diff-d8cd2fcd987f7884b494f7373cf50eb48cd2f925120114e153b08f779e326f95

hamelsmu commented 3 years ago

edit: found the link, but I cannot reproduce your error. I'm pretty sure you need to ugprade nbdev

pip install -U git+https://github.com/fastai/nbdev.git

hamelsmu commented 3 years ago

If upgrading doesn't fix it for you will be happy to reopen this issue please let me know.

RenzoBenemerito commented 3 years ago

If upgrading doesn't fix it for you will be happy to reopen this issue please let me know.

The problem still persists, I already have the latest version of nbdev

image

I think we need to add a None checker before the if statement in the code. If the default of fname is None and you execute the if statement fname.endswith, it will cause the error seen above.

hamelsmu commented 3 years ago

Thanks. I was testing the wrong command! I was testing nbdev_build_lib instead 🤦🏽 sorry. This is going to be fixed shortly via #416

RenzoBenemerito commented 3 years ago

Thanks. I was testing the wrong command! I was testing nbdev_build_lib instead 🤦🏽 sorry. This is going to be fixed shortly via #416

Thank you sir! 💯