From e8b508b7171b096b9f584d77e69e3ad738aed1ac Mon Sep 17 00:00:00 2001 From: Timothy Hodson <34148978+thodson-usgs@users.noreply.github.com> Date: Wed, 1 May 2024 11:51:28 -0500 Subject: [PATCH] Add python3 kernel for doc build (#138) * Add python3 kernel for doc build * Remove Waterwatch from doc * Package for Python 3.12 --- .github/workflows/python-package.yml | 4 +++- .github/workflows/sphinx-docs.yml | 1 + docs/source/conf.py | 15 ++++++++------- docs/source/reference/index.rst | 3 +-- docs/source/reference/waterwatch.rst | 8 -------- docs/source/userguide/dataportals.rst | 4 +--- pyproject.toml | 5 ++++- 7 files changed, 18 insertions(+), 22 deletions(-) delete mode 100644 docs/source/reference/waterwatch.rst diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index d3b6399..a50e5fc 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -5,7 +5,9 @@ name: Python package on: push: + branches: ['master'] pull_request: + branches: ['master'] jobs: build: @@ -14,7 +16,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest] - python-version: [3.8, 3.9, '3.10', 3.11] + python-version: [3.8, 3.9, '3.10', 3.11, 3.12] steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/sphinx-docs.yml b/.github/workflows/sphinx-docs.yml index 8292e76..ebf2cc7 100644 --- a/.github/workflows/sphinx-docs.yml +++ b/.github/workflows/sphinx-docs.yml @@ -19,6 +19,7 @@ jobs: run: | python -m pip install --upgrade pip pip install .[doc] + ipython kernel install --name "python3" --user sudo apt update -y && sudo apt install -y latexmk texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended dvipng pandoc (cd docs && make docs) (cd docs && make html) diff --git a/docs/source/conf.py b/docs/source/conf.py index 942b450..30bf69b 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. @@ -32,7 +30,7 @@ 'sphinx.ext.viewcode', 'sphinx.ext.githubpages', 'nbsphinx', - 'nbsphinx_link' + 'nbsphinx_link', ] # Add any paths that contain templates here, relative to this directory. @@ -85,7 +83,7 @@ autodoc_default_options = { 'members': True, 'inherited-members': False, - 'private-members': True + 'private-members': True, } # doctest @@ -108,8 +106,8 @@ # documentation. html_theme_options = { - "logo_only": False, - "display_version": True, + 'logo_only': False, + 'display_version': True, } # Add any paths that contain custom static files (such as style sheets) here, @@ -124,5 +122,8 @@ r'https://streamstats.usgs.gov/streamstatsservices/#/', r'https://www.waterqualitydata.us/public_srsnames/', r'https://waterqualitydata.us', - r'https://github.com/USGS-python/dataretrieval/tree/master/demos/hydroshare' + r'https://github.com/USGS-python/dataretrieval/tree/master/demos/hydroshare', ] + +# Some notebooks have warnings, which nbsphinx should ignore +nbsphinx_allow_errors = True diff --git a/docs/source/reference/index.rst b/docs/source/reference/index.rst index 19ae4af..4a0d14f 100644 --- a/docs/source/reference/index.rst +++ b/docs/source/reference/index.rst @@ -11,5 +11,4 @@ API reference nwis streamstats utils - waterwatch - wqp \ No newline at end of file + wqp diff --git a/docs/source/reference/waterwatch.rst b/docs/source/reference/waterwatch.rst deleted file mode 100644 index b009c03..0000000 --- a/docs/source/reference/waterwatch.rst +++ /dev/null @@ -1,8 +0,0 @@ -.. _waterwatch - -dataretrieval.waterwatch ------------------------- - -.. automodule:: dataretrieval.waterwatch - :members: - :special-members: \ No newline at end of file diff --git a/docs/source/userguide/dataportals.rst b/docs/source/userguide/dataportals.rst index d2cbf50..f39a764 100644 --- a/docs/source/userguide/dataportals.rst +++ b/docs/source/userguide/dataportals.rst @@ -21,7 +21,5 @@ provided below. +-----------------------------------+---------------------------------------------------------------+ | Water Quality Portal | https://waterqualitydata.us | +-----------------------------------+---------------------------------------------------------------+ -| WaterWatch | https://waterwatch.usgs.gov | -+-----------------------------------+---------------------------------------------------------------+ | Water Services | https://waterservices.usgs.gov | -+-----------------------------------+---------------------------------------------------------------+ \ No newline at end of file ++-----------------------------------+---------------------------------------------------------------+ diff --git a/pyproject.toml b/pyproject.toml index a281b41..433e703 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,9 +34,12 @@ test = [ ] doc = [ "sphinx", - "sphinx_rtd_theme", + "sphinx-rtd-theme", "nbsphinx", "nbsphinx_link", + "ipython", + "ipykernel", + "matplotlib", ] nldi = [ 'geopandas>=0.10'