Skip to content

Commit

Permalink
Backport PR #305: Fix docs build job in tox (#306)
Browse files Browse the repository at this point in the history
  • Loading branch information
meeseeksmachine authored Sep 11, 2024
1 parent f3f3d3e commit 9215a82
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ jobs:
envs: |
- linux: build_docs-gallery
python-version: '3.12'
libraries: |
apt:
- graphviz
publish:
# Build wheels when pushing to any branch except main
Expand Down
7 changes: 3 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import configparser
import datetime
import os
import pathlib

from sphinx_gallery.sorting import ExplicitOrder

Expand Down Expand Up @@ -138,10 +137,10 @@
ON_GHA = os.environ.get('CI') == 'true'

# On Read the Docs and CI, download the database and build a minimal HDF5 version
if ON_RTD or ON_GHA:
if (ON_RTD or ON_GHA):
from fiasco.util import build_hdf5_dbase, download_dbase, get_test_file_list
from fiasco.util.setup_db import CHIANTI_URL, LATEST_VERSION
FIASCO_HOME = pathlib.Path.home() / '.fiasco'
from fiasco.util.util import FIASCO_HOME, FIASCO_RC
FIASCO_HOME.mkdir(exist_ok=True, parents=True)
ascii_dbase_root = FIASCO_HOME / 'chianti_dbase'
hdf5_dbase_root = FIASCO_HOME / 'chianti_dbase.h5'
Expand All @@ -151,7 +150,7 @@
hdf5_dbase_root,
files=get_test_file_list(),
)
with (FIASCO_HOME / 'fiascorc').open('w') as f:
with FIASCO_RC.open(mode='w') as f:
c = configparser.ConfigParser()
c.add_section('database')
c.set('database', 'ascii_dbase_root', str(ascii_dbase_root))
Expand Down
1 change: 1 addition & 0 deletions docs/nitpick-exceptions
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ py:class time-like
py:obj function
py:obj iterable
# Units
py:class Unit
py:class Unit('1 / cm3')
py:class Unit('erg')
py:class Unit('Angstrom')
Expand Down
3 changes: 2 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ commands =
{toxinidir}/docs \
{posargs}

[testenv:build_docs]
[testenv:build_docs{,-gallery}]
pass_env = CI
changedir = docs
description = invoke sphinx-build to build the HTML docs
extras = docs
Expand Down

0 comments on commit 9215a82

Please sign in to comment.