From 9b227ecfc07d595cab6680e4e86977dd6bf7800a Mon Sep 17 00:00:00 2001 From: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com> Date: Mon, 6 Dec 2021 17:19:56 +0800 Subject: [PATCH] [Fix] Remove outdated code in docs/conf.py (#1560) --- .gitignore | 2 ++ docs/conf.py | 17 ----------------- docs_zh_CN/conf.py | 15 --------------- requirements/docs.txt | 1 - setup.cfg | 2 +- 5 files changed, 3 insertions(+), 34 deletions(-) diff --git a/.gitignore b/.gitignore index d5a801618..1990fc8fb 100644 --- a/.gitignore +++ b/.gitignore @@ -117,3 +117,5 @@ venv.bak/ # datasets and logs and checkpoints data/ work_dir/ + +src/ diff --git a/docs/conf.py b/docs/conf.py index bea4706cf..c65184e01 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -15,8 +15,6 @@ import os import sys import pytorch_sphinx_theme -from m2r import MdInclude -from recommonmark.transform import AutoStructify from sphinx.builders.html import StandaloneHTMLBuilder sys.path.insert(0, os.path.abspath('..')) @@ -51,14 +49,12 @@ extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.napoleon', 'sphinx.ext.viewcode', - 'sphinx.ext.autosectionlabel', 'sphinx_markdown_tables', 'myst_parser', 'sphinx_copybutton', ] # yapf: disable autodoc_mock_imports = ['mmcv._ext', 'mmcv.utils.ext_loader', 'torchvision'] -autosectionlabel_prefix_document = True # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] @@ -286,16 +282,3 @@ StandaloneHTMLBuilder.supported_image_types = [ # Ignore >>> when copying code copybutton_prompt_text = r'>>> |\.\.\. ' copybutton_prompt_is_regexp = True - - -def setup(app): - app.add_config_value('no_underscore_emphasis', False, 'env') - app.add_config_value('m2r_parse_relative_links', False, 'env') - app.add_config_value('m2r_anonymous_references', False, 'env') - app.add_config_value('m2r_disable_inline_math', False, 'env') - app.add_directive('mdinclude', MdInclude) - app.add_config_value('recommonmark_config', { - 'auto_toc_tree_section': 'Contents', - 'enable_eval_rst': True, - }, True) - app.add_transform(AutoStructify) diff --git a/docs_zh_CN/conf.py b/docs_zh_CN/conf.py index e0c65d0ee..f9115ec2e 100644 --- a/docs_zh_CN/conf.py +++ b/docs_zh_CN/conf.py @@ -15,8 +15,6 @@ import os import sys import pytorch_sphinx_theme -from m2r import MdInclude -from recommonmark.transform import AutoStructify from sphinx.builders.html import StandaloneHTMLBuilder sys.path.insert(0, os.path.abspath('..')) @@ -288,16 +286,3 @@ StandaloneHTMLBuilder.supported_image_types = [ # Ignore >>> when copying code copybutton_prompt_text = r'>>> |\.\.\. ' copybutton_prompt_is_regexp = True - - -def setup(app): - app.add_config_value('no_underscore_emphasis', False, 'env') - app.add_config_value('m2r_parse_relative_links', False, 'env') - app.add_config_value('m2r_anonymous_references', False, 'env') - app.add_config_value('m2r_disable_inline_math', False, 'env') - app.add_directive('mdinclude', MdInclude) - app.add_config_value('recommonmark_config', { - 'auto_toc_tree_section': 'Contents', - 'enable_eval_rst': True, - }, True) - app.add_transform(AutoStructify) diff --git a/requirements/docs.txt b/requirements/docs.txt index 988b5ead2..6a5319af3 100644 --- a/requirements/docs.txt +++ b/requirements/docs.txt @@ -1,5 +1,4 @@ docutils==0.16.0 -m2r myst-parser opencv-python -e git+https://github.com/open-mmlab/pytorch_sphinx_theme.git#egg=pytorch_sphinx_theme diff --git a/setup.cfg b/setup.cfg index 32222e54d..74f5a8850 100644 --- a/setup.cfg +++ b/setup.cfg @@ -14,7 +14,7 @@ line_length = 79 multi_line_output = 0 known_standard_library = pkg_resources,setuptools,logging,os,warnings,abc known_first_party = mmcv -known_third_party = addict,cv2,m2r,numpy,onnx,onnxruntime,packaging,pytest,pytorch_sphinx_theme,recommonmark,scipy,sphinx,tensorrt,torch,torchvision,yaml,yapf +known_third_party = addict,cv2,numpy,onnx,onnxruntime,packaging,pytest,pytorch_sphinx_theme,scipy,sphinx,tensorrt,torch,torchvision,yaml,yapf no_lines_before = STDLIB,LOCALFOLDER default_section = THIRDPARTY