diff --git a/.gitignore b/.gitignore index 8b0c855..157dfe7 100644 --- a/.gitignore +++ b/.gitignore @@ -22,7 +22,6 @@ var/ *.egg-info/ .installed.cfg *.egg -doc/_build/ # PyInstaller # Usually these files are written by a python script from a template @@ -52,7 +51,8 @@ coverage.xml *.log # Sphinx documentation -docs/_build/ +doc/_build/ +doc/generated/ # PyBuilder target/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 588402f..e5b6178 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -36,7 +36,6 @@ repos: rev: v2.6.2 hooks: - id: prettier - language_version: system - repo: https://github.com/pre-commit/mirrors-mypy rev: v0.942 diff --git a/doc/Makefile b/doc/Makefile index d2491be..00f3549 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -48,6 +48,7 @@ help: clean: rm -rf $(BUILDDIR)/* + rm -rf generated/* html: $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html diff --git a/doc/conf.py b/doc/conf.py index ef5de36..3e87f3b 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -14,7 +14,6 @@ # type: ignore -import os import sys import sphinx_autosummary_accessors @@ -71,6 +70,8 @@ def setup(app): app.connect('autodoc-skip-member', skip) +autodoc_mock_imports = ['torch'] + # link to github issues extlinks = { 'issue': ('https://github.com/pangeo-data/xbatcher/issues/%s', 'GH') @@ -146,18 +147,10 @@ def setup(app): # -- Options for HTML output ---------------------------------------------- -on_rtd = os.environ.get('READTHEDOCS', None) == 'True' - -if not on_rtd: # only import and set the theme if we're building docs locally - import sphinx_rtd_theme - - html_theme = 'sphinx_rtd_theme' - html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] - # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # tml_theme = 'default' -html_theme = 'sphinx_rtd_theme' +html_theme = 'pangeo_sphinx_book_theme' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the diff --git a/doc/environment.yml b/doc/environment.yml index 73115d1..0dbeb97 100644 --- a/doc/environment.yml +++ b/doc/environment.yml @@ -3,7 +3,7 @@ channels: - conda-forge - nodefaults dependencies: - - python=3.7 + - python=3.8 - dask - docrep - ipython @@ -17,3 +17,5 @@ dependencies: - sphinx-copybutton - xarray - pip + - pip: + - pangeo-sphinx-book-theme