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

binder notebook copy problem when examples_dirs and gallery_dirs are strings instead of list #389

Open
lesteve opened this issue Jun 6, 2018 · 0 comments

Comments

@lesteve
Copy link
Member

lesteve commented Jun 6, 2018

Yeah first bug report ;-)! I thought I tried on scikit-learn before the release but actually I did not try configuring binder fully ...

Note that there is a work-around in conf.py of using a list with a single element.

diff --git a/doc/conf.py b/doc/conf.py
index 773afba..edc39d9 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -332,8 +332,8 @@ sphinx_gallery_conf = {
     'reference_url': {
         'sphinx_gallery': None,
         },
-    'examples_dirs': examples_dirs,
-    'gallery_dirs': gallery_dirs,
+    'examples_dirs': examples_dirs[0],
+    'gallery_dirs': gallery_dirs[0],
     'subsection_order': ExplicitOrder(['../examples/sin_func',
                                        '../examples/no_output',
                                        '../tutorials/seaborn']),

Output:

Exception occurred:
  File "/home/local/lesteve/miniconda3/lib/python3.6/shutil.py", line 309, in copytree
    names = os.listdir(src)
FileNotFoundError: [Errno 2] No such file or directory: '/home/local/lesteve/dev/sphinx-gallery/doc/a'
The full traceback has been saved in /tmp/sphinx-err-slqy8rcw.log, if you want to report the issue to the developers.

IIRC somewhere in the code example_dirs and gallery_dirs are turned into a single element list if they are strings and that it happens quite early in the code. I am not sure why but it looks like the binder logic is independent of that for some reason.

Found in scikit-learn (which does specify neither example_dirs nor gallery_dirs so get the default 'examples' and 'auto_examples').

Edit: 'a' is the first item of 'auto_examples' hence the folder '/home/local/lesteve/dev/sphinx-gallery/doc/a'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant