Skip to content

Commit 1cf2b8d

Browse files
committed
feat: update documentation workflow with micromamba setup and add environment-docs.yml
1 parent 8582f4e commit 1cf2b8d

4 files changed

Lines changed: 105 additions & 50 deletions

File tree

.github/workflows/docs.yml

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,27 +22,39 @@ jobs:
2222
runs-on: ubuntu-latest
2323
defaults:
2424
run:
25-
shell: bash
25+
shell: bash -el {0}
2626
steps:
2727
- name: Checkout
2828
uses: actions/checkout@v4
2929
with:
3030
fetch-depth: 0
31-
32-
- name: Set up Miniconda
33-
uses: conda-incubator/setup-miniconda@v3
31+
- name: Set up micromamba
32+
uses: mamba-org/setup-micromamba@v2
3433
with:
35-
activate-environment: docs
36-
auto-update-conda: true
37-
python-version: 3.11
38-
channels: conda-forge,defaults
34+
environment-file: environment-docs.yml
35+
cache-environment: true
36+
cache-downloads: true
37+
create-args: >-
38+
python=3.13
39+
init-shell: bash
40+
condarc: |
41+
channels:
42+
- conda-forge
43+
- cadwr-dms
44+
- nodefaults
45+
channel_priority: flexible
46+
47+
- name: Show environment details
48+
run: |
49+
micromamba info
50+
micromamba list
51+
python --version
52+
which python
53+
which sphinx-build || true
3954
40-
- name: Install docs dependencies
55+
- name: Verify docs tooling imports
4156
run: |
42-
conda install -y sphinx nbsphinx ipykernel jupyter nbconvert pandoc sphinx-rtd-theme \
43-
click networkx h5py pandas numba diskcache tabulate
44-
pip install -e .
45-
python -m pip list
57+
python -c "import importlib, sphinx, nbsphinx; print('sphinx', sphinx.__version__); print('nbsphinx', nbsphinx.__version__); [importlib.import_module(m) for m in ['pydsm','networkx','pandas','h5py']]; print('Imports OK')"
4658
4759
- name: Build HTML docs
4860
working-directory: docsrc

docsrc/conf.py

Lines changed: 35 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
#
2121
import os
2222
import sys
23-
sys.path.insert(0, os.path.abspath('..'))
23+
24+
sys.path.insert(0, os.path.abspath(".."))
2425

2526
import pydsm
2627

@@ -32,27 +33,30 @@
3233

3334
# Add any Sphinx extension module names here, as strings. They can be
3435
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
35-
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode',
36-
'nbsphinx',
37-
'sphinx.ext.mathjax',]
36+
extensions = [
37+
"sphinx.ext.autodoc",
38+
"sphinx.ext.viewcode",
39+
"nbsphinx",
40+
"sphinx.ext.mathjax",
41+
]
3842

39-
exclude_patterns = ['_build', '**.ipynb_checkpoints']
43+
exclude_patterns = ["_build", "**.ipynb_checkpoints"]
4044
# Add any paths that contain templates here, relative to this directory.
41-
templates_path = ['_templates']
45+
templates_path = ["_templates"]
4246

4347
# The suffix(es) of source filenames.
4448
# You can specify multiple suffix as a list of string:
4549
#
4650
# source_suffix = ['.rst', '.md']
47-
source_suffix = '.rst'
51+
source_suffix = ".rst"
4852

4953
# The master toctree document.
50-
master_doc = 'index'
54+
master_doc = "index"
5155

5256
# General information about the project.
53-
project = u'pydsm'
54-
copyright = u"2019, Nicky Sandhu"
55-
author = u"Nicky Sandhu"
57+
project = "pydsm"
58+
copyright = "2019, Nicky Sandhu"
59+
author = "Nicky Sandhu"
5660

5761
# The version info for the project you're documenting, acts as replacement
5862
# for |version| and |release|, also used in various other places throughout
@@ -73,10 +77,10 @@
7377
# List of patterns, relative to source directory, that match files and
7478
# directories to ignore when looking for source files.
7579
# This patterns also effect to html_static_path and html_extra_path
76-
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
80+
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
7781

7882
# The name of the Pygments (syntax highlighting) style to use.
79-
pygments_style = 'sphinx'
83+
pygments_style = "sphinx"
8084

8185
# If true, `todo` and `todoList` produce output, else they produce nothing.
8286
todo_include_todos = False
@@ -87,7 +91,11 @@
8791
# The theme to use for HTML and HTML Help pages. See the documentation for
8892
# a list of builtin themes.
8993
#
90-
html_theme = 'alabaster'
94+
html_theme = "sphinx_rtd_theme"
95+
html_theme_options = {
96+
"navigation_depth": 3,
97+
"collapse_navigation": False,
98+
}
9199

92100
# Theme options are theme-specific and customize the look and feel of a
93101
# theme further. For a list of options available for each theme, see the
@@ -98,13 +106,13 @@
98106
# Add any paths that contain custom static files (such as style sheets) here,
99107
# relative to this directory. They are copied after the builtin static files,
100108
# so a file named "default.css" will overwrite the builtin "default.css".
101-
html_static_path = ['_static']
109+
html_static_path = ["_static"]
102110

103111

104112
# -- Options for HTMLHelp output ---------------------------------------
105113

106114
# Output file base name for HTML help builder.
107-
htmlhelp_basename = 'pydsmdoc'
115+
htmlhelp_basename = "pydsmdoc"
108116

109117

110118
# -- Options for LaTeX output ------------------------------------------
@@ -113,15 +121,12 @@
113121
# The paper size ('letterpaper' or 'a4paper').
114122
#
115123
# 'papersize': 'letterpaper',
116-
117124
# The font size ('10pt', '11pt' or '12pt').
118125
#
119126
# 'pointsize': '10pt',
120-
121127
# Additional stuff for the LaTeX preamble.
122128
#
123129
# 'preamble': '',
124-
125130
# Latex figure (float) alignment
126131
#
127132
# 'figure_align': 'htbp',
@@ -131,21 +136,15 @@
131136
# (source start file, target name, title, author, documentclass
132137
# [howto, manual, or own class]).
133138
latex_documents = [
134-
(master_doc, 'pydsm.tex',
135-
u'pydsm Documentation',
136-
u'Nicky Sandhu', 'manual'),
139+
(master_doc, "pydsm.tex", "pydsm Documentation", "Nicky Sandhu", "manual"),
137140
]
138141

139142

140143
# -- Options for manual page output ------------------------------------
141144

142145
# One entry per manual page. List of tuples
143146
# (source start file, name, description, authors, manual section).
144-
man_pages = [
145-
(master_doc, 'pydsm',
146-
u'pydsm Documentation',
147-
[author], 1)
148-
]
147+
man_pages = [(master_doc, "pydsm", "pydsm Documentation", [author], 1)]
149148

150149

151150
# -- Options for Texinfo output ----------------------------------------
@@ -154,13 +153,13 @@
154153
# (source start file, target name, title, author,
155154
# dir menu entry, description, category)
156155
texinfo_documents = [
157-
(master_doc, 'pydsm',
158-
u'pydsm Documentation',
159-
author,
160-
'pydsm',
161-
'Python utlities for DSM2',
162-
'Miscellaneous'),
156+
(
157+
master_doc,
158+
"pydsm",
159+
"pydsm Documentation",
160+
author,
161+
"pydsm",
162+
"Python utlities for DSM2",
163+
"Miscellaneous",
164+
),
163165
]
164-
165-
166-

environment-docs.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: pydsm-docs
2+
channels:
3+
- conda-forge
4+
- cadwr-dms
5+
- nodefaults
6+
dependencies:
7+
# Core runtime (mirrors environment.yml)
8+
- python=3.13
9+
- pip
10+
- ipykernel
11+
- decorator
12+
- hdf5
13+
- h5py
14+
- numpy<2
15+
- pandas
16+
- xarray
17+
- pyarrow
18+
- geopandas
19+
- networkx
20+
- dask
21+
- diskcache
22+
- tabulate
23+
# Visualization stack
24+
- bokeh
25+
- matplotlib
26+
- holoviews
27+
- geoviews
28+
- hvplot
29+
- datashader
30+
- panel
31+
# Custom packages from channel(s)
32+
- pyhecdss
33+
- vtools3
34+
# Documentation specific additions
35+
- sphinx
36+
- nbsphinx
37+
- sphinx-rtd-theme
38+
- jupyter
39+
- nbconvert
40+
- pandoc
41+
# Optional speed / compilation helpers (leave commented for now)
42+
# - numba
43+
- pip:
44+
- .

environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ channels:
44
- cadwr-dms
55
- nodefaults
66
dependencies:
7-
- python=3.11
7+
- python=3.13
88
- pip
99
- ipykernel
1010
- decorator

0 commit comments

Comments
 (0)