From 1d5a7d8ca9849c40d39813e7c99e0bf79460bbc3 Mon Sep 17 00:00:00 2001 From: Ryan Ly Date: Fri, 9 Feb 2024 22:53:26 -0800 Subject: [PATCH 1/5] Exclude pynwb retinotopy from sphinx --- docs/source/conf.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/source/conf.py b/docs/source/conf.py index c46d2edd5..e4d70da10 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -209,6 +209,13 @@ def __call__(self, filename): # directories to ignore when looking for source files. exclude_patterns = ['_build', 'test.py'] +# This value contains a list of modules to be mocked up. This is useful +# when some external dependencies are not met at build time and break the +# building process. +autodoc_mock_imports = [ + 'pynwb.retinotopy', +] + # The reST default role (used for this markup: `text`) to use for all documents. # default_role = None From 29b1eeb8c3c89b7f7d5c4207734948b705d9c36f Mon Sep 17 00:00:00 2001 From: Ryan Ly Date: Wed, 14 Feb 2024 12:44:47 +0900 Subject: [PATCH 2/5] Update conf.py --- docs/source/conf.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index e4d70da10..a9f48a317 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -209,12 +209,12 @@ def __call__(self, filename): # directories to ignore when looking for source files. exclude_patterns = ['_build', 'test.py'] -# This value contains a list of modules to be mocked up. This is useful -# when some external dependencies are not met at build time and break the -# building process. -autodoc_mock_imports = [ - 'pynwb.retinotopy', -] +# # This value contains a list of modules to be mocked up. This is useful +# # when some external dependencies are not met at build time and break the +# # building process. +# autodoc_mock_imports = [ +# 'pynwb.retinotopy', +# ] # The reST default role (used for this markup: `text`) to use for all documents. # default_role = None @@ -411,6 +411,10 @@ def __call__(self, filename): # see http://www.sphinx-doc.org/en/master/extdev/appapi.html # +apidoc_exclude = [ + "../../src/pynwb/retinotopy.py", +] + def run_apidoc(_): from sphinx.ext.apidoc import main as apidoc_main import os @@ -418,7 +422,7 @@ def run_apidoc(_): out_dir = os.path.dirname(__file__) src_dir = os.path.join(out_dir, '../../src') sys.path.append(src_dir) - apidoc_main(['-f', '-e', '--no-toc', '-o', out_dir, src_dir]) + apidoc_main(['-f', '-e', '--no-toc', '-o', out_dir, src_dir, *apidoc_exclude]) from abc import abstractproperty From e025ca61e4994cf96839ab7a0453d6f92d40aa85 Mon Sep 17 00:00:00 2001 From: Ryan Ly Date: Wed, 14 Feb 2024 12:49:46 +0900 Subject: [PATCH 3/5] Update conf.py --- docs/source/conf.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index a9f48a317..4fb9f9acd 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -411,8 +411,9 @@ def __call__(self, filename): # see http://www.sphinx-doc.org/en/master/extdev/appapi.html # +# paths to modules to be excluded by apidoc when generating rst files apidoc_exclude = [ - "../../src/pynwb/retinotopy.py", + "../../src/pynwb/retinotopy", ] def run_apidoc(_): From b7deca6233c10a1bcd0637d48f8687a6335e047a Mon Sep 17 00:00:00 2001 From: Ryan Ly Date: Wed, 14 Feb 2024 13:25:03 +0900 Subject: [PATCH 4/5] Update conf.py --- docs/source/conf.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 4fb9f9acd..16ed7a669 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -207,7 +207,13 @@ def __call__(self, filename): # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. -exclude_patterns = ['_build', 'test.py'] +exclude_patterns = ['_build', 'test.py', "../../src/pynwb/retinotopy.py",] + +# List of patterns, relative to source directory, of modules to be +# excluded by apidoc when generating rst files. +apidoc_exclude = [ + "../../src/pynwb/retinotopy.py", +] # # This value contains a list of modules to be mocked up. This is useful # # when some external dependencies are not met at build time and break the @@ -411,11 +417,6 @@ def __call__(self, filename): # see http://www.sphinx-doc.org/en/master/extdev/appapi.html # -# paths to modules to be excluded by apidoc when generating rst files -apidoc_exclude = [ - "../../src/pynwb/retinotopy", -] - def run_apidoc(_): from sphinx.ext.apidoc import main as apidoc_main import os From e76965d24bdc990c89828d2a1ac3fedd36031ceb Mon Sep 17 00:00:00 2001 From: Ryan Ly Date: Fri, 16 Feb 2024 09:22:49 +0900 Subject: [PATCH 5/5] Fix sphinx apidoc exclude --- docs/source/conf.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 16ed7a669..8e3d42ab3 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -207,7 +207,7 @@ def __call__(self, filename): # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. -exclude_patterns = ['_build', 'test.py', "../../src/pynwb/retinotopy.py",] +exclude_patterns = ['_build', 'test.py'] # List of patterns, relative to source directory, of modules to be # excluded by apidoc when generating rst files. @@ -215,13 +215,6 @@ def __call__(self, filename): "../../src/pynwb/retinotopy.py", ] -# # This value contains a list of modules to be mocked up. This is useful -# # when some external dependencies are not met at build time and break the -# # building process. -# autodoc_mock_imports = [ -# 'pynwb.retinotopy', -# ] - # The reST default role (used for this markup: `text`) to use for all documents. # default_role = None @@ -424,7 +417,8 @@ def run_apidoc(_): out_dir = os.path.dirname(__file__) src_dir = os.path.join(out_dir, '../../src') sys.path.append(src_dir) - apidoc_main(['-f', '-e', '--no-toc', '-o', out_dir, src_dir, *apidoc_exclude]) + apidoc_exclude_abs = [os.path.join(out_dir, f) for f in apidoc_exclude] + apidoc_main(['-f', '-e', '--no-toc', '-o', out_dir, src_dir, *apidoc_exclude_abs]) from abc import abstractproperty