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

Use pangeo_sphinx_book_theme and mock imports #62

Merged
merged 9 commits into from
May 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -52,7 +51,8 @@ coverage.xml
*.log

# Sphinx documentation
docs/_build/
doc/_build/
doc/generated/

# PyBuilder
target/
Expand Down
1 change: 0 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ repos:
rev: v2.6.2
hooks:
- id: prettier
language_version: system
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should either remove the requirement to have a system nodejs installation for pre-commit to work or add a contributing guide (xref #32) that includes a pre-commit explainer.


- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.942
Expand Down
1 change: 1 addition & 0 deletions doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ help:

clean:
rm -rf $(BUILDDIR)/*
rm -rf generated/*

html:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
Expand Down
13 changes: 3 additions & 10 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

# type: ignore

import os
import sys

import sphinx_autosummary_accessors
Expand Down Expand Up @@ -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')
Expand Down Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion doc/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ channels:
- conda-forge
- nodefaults
dependencies:
- python=3.7
- python=3.8
- dask
- docrep
- ipython
Expand All @@ -17,3 +17,5 @@ dependencies:
- sphinx-copybutton
- xarray
- pip
- pip:
- pangeo-sphinx-book-theme