diff --git a/.readthedocs.yml b/.readthedocs.yml index 73ea4cb7..5d508503 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -1,5 +1,7 @@ version: 2 +formats: all + python: version: 3.7 install: diff --git a/docs/conf.py b/docs/conf.py index c615c8f5..dc4a6f15 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -23,7 +23,11 @@ copyright = '2020-2030, OpenMMLab' author = 'OpenMMLab' # The full version, including alpha/beta/rc tags -release = '0.1.0' +version_file = '../mmocr/version.py' +with open(version_file, 'r') as f: + exec(compile(f.read(), version_file, 'exec')) +__version__ = locals()['__version__'] +release = __version__ # -- General configuration --------------------------------------------------- @@ -38,29 +42,7 @@ extensions = [ 'sphinx_markdown_tables', ] -autodoc_mock_imports = [ - 'torch', - 'torchvision', - 'mmcv', - 'mmocr.version', - 'mmdet', - 'imgaug', - 'kwarray', - 'lmdb', - 'matplotlib', - 'Polygon', - 'cv2', - 'numpy', - 'pyclipper', - 'pycocotools', - 'pytest', - 'rapidfuzz', - 'scipy', - 'shapely', - 'skimage', - 'titlecase', - 'PIL', -] +autodoc_mock_imports = ['mmcv._ext'] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] diff --git a/docs_zh_CN/conf.py b/docs_zh_CN/conf.py index 9c3ad1e0..0ca65846 100644 --- a/docs_zh_CN/conf.py +++ b/docs_zh_CN/conf.py @@ -23,7 +23,11 @@ copyright = '2020-2030, OpenMMLab' author = 'OpenMMLab' # The full version, including alpha/beta/rc tags -release = '0.1.0' +version_file = '../mmocr/version.py' +with open(version_file, 'r') as f: + exec(compile(f.read(), version_file, 'exec')) +__version__ = locals()['__version__'] +release = __version__ # -- General configuration --------------------------------------------------- @@ -38,29 +42,7 @@ extensions = [ 'sphinx_markdown_tables', ] -autodoc_mock_imports = [ - 'torch', - 'torchvision', - 'mmcv', - 'mmocr.version', - 'mmdet', - 'imgaug', - 'kwarray', - 'lmdb', - 'matplotlib', - 'Polygon', - 'cv2', - 'numpy', - 'pyclipper', - 'pycocotools', - 'pytest', - 'rapidfuzz', - 'scipy', - 'shapely', - 'skimage', - 'titlecase', - 'PIL', -] +autodoc_mock_imports = ['mmcv._ext'] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] diff --git a/requirements/readthedocs.txt b/requirements/readthedocs.txt index c97493a9..f887b648 100644 --- a/requirements/readthedocs.txt +++ b/requirements/readthedocs.txt @@ -4,6 +4,7 @@ lanms-proper lmdb matplotlib mmcv +mmdet Polygon3 pyclipper rapidfuzz