Skip to content
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

nbdev_docs raises FileNotFoundError when looking for _proc/docs #1384

Open
gorkamunoz opened this issue Nov 15, 2023 · 2 comments
Open

nbdev_docs raises FileNotFoundError when looking for _proc/docs #1384

gorkamunoz opened this issue Nov 15, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@gorkamunoz
Copy link

Hi, I am having some recent trouble creating the docs for my library (https://github.com/andichallenge/andi_datasets). Everything used to work fine but recently, whenever I try to run nbdev_docs, I get this error:

FileNotFoundError: [Errno 2] No such file or directory: '/home/gorka/github/andi_datasets/_proc/docs' -> '/home/gorka/github/andi_datasets/docs'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/gorka/miniconda3/envs/andi/bin/nbdev_docs", line 8, in <module>
    sys.exit(nbdev_docs())
  File "/home/gorka/miniconda3/envs/andi/lib/python3.10/site-packages/fastcore/script.py", line 119, in _f
    return tfunc(**merge(args, args_from_prog(func, xtra)))
  File "/home/gorka/miniconda3/envs/andi/lib/python3.10/site-packages/nbdev/quarto.py", line 230, in nbdev_docs
    move(cache/cfg.doc_path.name, cfg.config_path)
  File "/home/gorka/miniconda3/envs/andi/lib/python3.10/site-packages/fastcore/shutil.py", line 8, in _f
    def _f(src, dst, *args, **kwargs): return f(str(src), str(dst), *args, **kwargs)
  File "/home/gorka/miniconda3/envs/andi/lib/python3.10/shutil.py", line 835, in move
    copy_function(src, real_dst)
  File "/home/gorka/miniconda3/envs/andi/lib/python3.10/shutil.py", line 434, in copy2
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "/home/gorka/miniconda3/envs/andi/lib/python3.10/shutil.py", line 254, in copyfile
    with open(src, 'rb') as fsrc:
FileNotFoundError: [Errno 2] No such file or directory: '/home/gorka/github/andi_datasets/_proc/docs'

Somehow nbdev_docs, is looking for _proc/docs, which does not exists. nbdev_preview works just fine and I can see the docs in my localhost. I have run nbdev_docs in another similar library and everything works fine there, even though _proc/docs is neither being created in that one.

How is it that in this library nbdev_docs looks for _proc/docs? Nothing in the settings.ini or so seems to point there. This means that also the CI is failing when pushing to github. Any leads on how to solve this? Thanks!

@gorkamunoz gorkamunoz added the bug Something isn't working label Nov 15, 2023
@gorkamunoz
Copy link
Author

After further exploration, it seems that in this library (and not in any other), the docs in _proc are being created in a folder named _proc/_site and not _proc/docs. Looking at my code, I have no idea why this change happening....

@gorkamunoz
Copy link
Author

I just found the problem: the _quarto.yml file has to explicit point to the docs folder:

project:
  output-dir: docs
  type: website

Somehow I thought that it would be sufficient for nbdev.yml to have that information. I guess this is intended as nbdev.yml is autogenerated from _quarto.yml?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant