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

ci: fix readthedocs #1136

Merged
merged 1 commit into from
Jan 17, 2023
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
17 changes: 4 additions & 13 deletions .build_rtd_docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from subprocess import Popen, PIPE

sys.path.insert(0, os.path.abspath(os.path.join("..", "doc")))
sys.path.insert(0, os.path.abspath(os.path.join("..", "distribution")))

# -- determine if running on readthedocs ------------------------------------
on_rtd = os.environ.get("READTHEDOCS") == "True"
Expand All @@ -35,18 +36,8 @@

# -- Update the modflow 6 version -------------------------------------------
print("Update the modflow6 version")
pth = os.path.join("..", "distribution")
args = (
"python",
"update_version.py",
)
# run the command
proc = Popen(args, stdout=PIPE, stderr=PIPE, cwd=pth)
stdout, stderr = proc.communicate()
if stdout:
print(stdout.decode("utf-8"))
if stderr:
print("Errors:\n{}".format(stderr.decode("utf-8")))
from update_version import update_version
update_version()

# -- import version from doc/version.py -------------------------------------
from version import __version__
Expand Down Expand Up @@ -92,7 +83,7 @@
# -- Project information -----------------------------------------------------

project = "MODFLOW 6 Program Documentation"
copyright = "2020, MODFLOW Development Team"
copyright = "2023, MODFLOW Development Team"
author = "MODFLOW Development Team"

# -- Project version ---------------------------------------------------------
Expand Down
5 changes: 3 additions & 2 deletions .build_rtd_docs/requirements.rtd.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ nbsphinx_link
ipython
ipykernel
rtds_action
myst_parser
myst-parser
sphinx_rtd_theme
pytest
filelock
filelock
modflow-devtools
4 changes: 2 additions & 2 deletions .doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
# -- Project information -----------------------------------------------------

project = "MODFLOW 6 Program Documentation"
copyright = "2020, MODFLOW Development Team"
copyright = "2023, MODFLOW Development Team"
author = "MODFLOW Development Team"

# -- General configuration ---------------------------------------------------
Expand All @@ -70,7 +70,7 @@
"sphinx.ext.viewcode",
"IPython.sphinxext.ipython_console_highlighting", # lowercase didn't work
"sphinx.ext.autosectionlabel",
"recommonmark",
"myst_parser",
"sphinx_markdown_tables",
]

Expand Down
2 changes: 1 addition & 1 deletion .doc/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ ipython
ipykernel
rtds_action
sphinx_rtd_theme
recommonmark
myst-parser
28 changes: 10 additions & 18 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ jobs:
shell: bash -l {0}
env:
GCC_V: 12
working-directory: .build_rtd_docs
distribution-directory: distribution

steps:
- name: Checkout modflow6
Expand Down Expand Up @@ -52,12 +50,10 @@ jobs:

- name: Install additional packages for Sphinx using pip
working-directory: modflow6/.build_rtd_docs
run: |
pip install -r requirements.rtd.txt
run: pip install -r requirements.rtd.txt

- name: Print python package versions
run: |
pip list
run: pip list

- name: Install TeX Live
run: |
Expand All @@ -66,13 +62,11 @@ jobs:

- name: Install USGS LaTeX style files and Univers font
working-directory: usgslatex/usgsLaTeX
run: |
sudo ./install.sh --all-users
run: sudo ./install.sh --all-users

- name: Test building files from dfn's for LaTeX
working-directory: modflow6/autotest
run: |
pytest -v build_mfio_tex.py
run: pytest -v build_mfio_tex.py

- name: Setup GNU Fortran ${{ env.GCC_V }}
uses: awvwgk/setup-fortran@main
Expand Down Expand Up @@ -103,21 +97,19 @@ jobs:

- name: Run benchmarks
working-directory: modflow6/distribution
run: python benchmark.py
env:
GITHUB_TOKEN: ${{ github.token }}
run: python benchmark.py

- name: Run sphinx
working-directory: modflow6/.build_rtd_docs
run: |
make html
run: make html

- name: Show results
- name: Show benchmarks
working-directory: modflow6/distribution
run: |
cat run-time-comparison.md
run: cat run-time-comparison.md

- name: Upload comparison
- name: Upload benchmarks
uses: actions/upload-artifact@v3
with:
name: run-time-comparison
Expand All @@ -128,9 +120,9 @@ jobs:
with:
name: rtd-files-for-${{ github.sha }}
path: |
modflow6/.build_rtd_docs/
modflow6/.build_rtd_docs/index.rst
modflow6/.build_rtd_docs/mf6io.rst
# run-time-comparison is moved to _mf6run by conf.py
modflow6/.build_rtd_docs/_mf6run/
modflow6/.build_rtd_docs/_mf6io/
modflow6/.build_rtd_docs/_static/
Expand Down