Skip to content

Commit

Permalink
ci(rtd): modify conf.py (#983)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdhughes-usgs authored Aug 29, 2020
1 parent 7bec3ec commit c7a678e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 23 deletions.
30 changes: 12 additions & 18 deletions .docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,25 @@
import os
import sys
import shutil
from subprocess import Popen, PIPE

# add flopy root directory to the python path
sys.path.insert(0, os.path.abspath(".."))
from flopy import __version__
import pymake

# -- determine if running on readthedocs ------------------------------------
on_rtd = os.environ.get('READTHEDOCS') == 'True'

# -- import pymake if not running on readthedocs ----------------------------
if on_rtd:
pymake = None
else:
import pymake

# -- create source rst files ------------------------------------------------
cmd = "sphinx-apidoc -e -o source/ ../flopy/"
print(cmd)
os.system(cmd)

# -- get the MODFLOW executables --------------------------------------------
if not on_rtd:
ws = ".bin"
Expand All @@ -42,18 +51,8 @@
print(" ".join(cmd))
os.system(" ".join(cmd))

# -- Create the flopy rst files ---------------------------------------------
args = ("sphinx-apidoc", "-e", "-o", "source/", "../flopy/")
proc = Popen(args, stdout=PIPE, stderr=PIPE, cwd=".")
stdout, stderr = proc.communicate()
if stdout:
print(stdout.decode("utf-8"))
if stderr:
print("Errors:\n{}".format(stderr.decode("utf-8")))


# -- Project information -----------------------------------------------------
project = "flopy"
project = "flopy Documentation"
copyright = "2020, Bakker, Mark, Post, Vincent, Langevin, C. D., Hughes, J. D., White, J. T., Leaf, A. T., Paulinski, S. R., Larsen, J. D., Toews, M. W., Morway, E. D., Bellino, J. C., Starn, J. J., and Fienen, M. N."
author = "Bakker, Mark, Post, Vincent, Langevin, C. D., Hughes, J. D., White, J. T., Leaf, A. T., Paulinski, S. R., Larsen, J. D., Toews, M. W., Morway, E. D., Bellino, J. C., Starn, J. J., and Fienen, M. N."

Expand Down Expand Up @@ -85,11 +84,6 @@
"recommonmark",
]

# nbsphinx_execute_arguments = [
# "--InlineBackend.figure_formats={'svg', 'pdf'}",
# "--InlineBackend.rc={'figure.dpi': 200}",
# ]

# Settings for GitHub actions integration
if on_rtd:
extensions.append("rtds_action")
Expand Down
8 changes: 4 additions & 4 deletions .docs/main.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to the FloPy Documentation!
===================================
FloPy Documentation
===================

Return to the Github `FloPy <https://github.com/modflowpy/flopy>`_ website where the code resides.

Contents:

.. toctree::
:maxdepth: 2

introduction

Tutorial
Expand All @@ -33,7 +33,7 @@ Contents:

.. toctree::
:maxdepth: 2

code

Indices and tables
Expand Down
1 change: 0 additions & 1 deletion .docs/requirements.rtd.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@ ipython
ipykernel
rtds_action
git+https://github.com/pandas-dev/pydata-sphinx-theme.git@master
git+https://github.com/modflowpy/pymake.git@master

0 comments on commit c7a678e

Please sign in to comment.