From 7f093419c1534baecf1c5c38a8f4ba8400ad5ab1 Mon Sep 17 00:00:00 2001 From: Benjamin Alan Weaver Date: Mon, 30 Mar 2026 14:05:41 -0700 Subject: [PATCH 1/5] update ubuntu version --- .readthedocs.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 2639867..ebca6f8 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -7,9 +7,9 @@ version: 2 # Set the version of Python and other tools you might need build: - os: ubuntu-20.04 + os: ubuntu-lts-latest tools: - python: "3.9" + python: "3.13" # Build documentation in the docs/ directory with Sphinx sphinx: From a7117ac27cfb3c749aa3dafee5c2417c5cd97286 Mon Sep 17 00:00:00 2001 From: Benjamin Alan Weaver Date: Mon, 30 Mar 2026 17:15:29 -0700 Subject: [PATCH 2/5] Fix some Sphinx build warnings --- .gitignore | 1 + doc/Makefile | 2 +- doc/conf.py | 20 +++++++++++++++----- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 9c15391..6403165 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .DS_Store quasarnp.egg-info *__pycache__ +doc/_build/ diff --git a/doc/Makefile b/doc/Makefile index d4bb2cb..b50c24d 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -3,7 +3,7 @@ # You can set these variables from the command line, and also # from the environment for the first two. -SPHINXOPTS ?= +SPHINXOPTS ?= -W SPHINXBUILD ?= sphinx-build SOURCEDIR = . BUILDDIR = _build diff --git a/doc/conf.py b/doc/conf.py index fabe7ba..cb413d7 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -14,6 +14,7 @@ import re import sys sys.path.insert(0, os.path.abspath('..')) +from importlib import import_module # -- Project information ----------------------------------------------------- @@ -23,8 +24,9 @@ author = 'Dylan Green' # The full version, including alpha/beta/rc tags -line = open('../quasarnp/_version.py').readline().strip() -m = re.match("__version__\s*=\s*'(.*)'", line) +with open('../quasarnp/_version.py') as VER: + line = VER.readline().strip() +m = re.match(r"__version__\s*=\s*'(.*)'", line) release = m.groups()[0] @@ -34,7 +36,7 @@ # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ - 'sphinx.ext.napoleon', + 'sphinx.ext.napoleon', 'sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 'sphinx.ext.todo', @@ -46,7 +48,6 @@ intersphinx_mapping = { 'python': ('https://docs.python.org/3/', None), 'numpy': ('https://numpy.org/doc/stable/', None), - 'scipy': ('https://docs.scipy.org/doc/scipy/reference/', None), 'h5py': ('https://docs.h5py.org/en/latest/', None) } # Add any paths that contain templates here, relative to this directory. @@ -57,6 +58,15 @@ # This pattern also affects html_static_path and html_extra_path. exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] +# This value contains a list of modules to be mocked up. This is useful when +# some external dependencies are not met at build time and break the +# building process. +autodoc_mock_imports = [] +for missing in ('fitsio', 'numpy'): + try: + foo = import_module(missing) + except ImportError: + autodoc_mock_imports.append(missing) # -- Options for HTML output ------------------------------------------------- @@ -68,4 +78,4 @@ # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] \ No newline at end of file +# html_static_path = ['_static'] From 0b5f3f8f8ab505548e5d71025e8c350637e4da54 Mon Sep 17 00:00:00 2001 From: Benjamin Alan Weaver Date: Mon, 30 Mar 2026 17:17:25 -0700 Subject: [PATCH 3/5] add a Sphinx build test --- .github/workflows/ci.yml | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6e6a4cb..f0965e8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,9 +37,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v5 - with: - fetch-depth: 0 + uses: actions/checkout@v6 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v6 with: @@ -67,9 +65,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v5 - with: - fetch-depth: 0 + uses: actions/checkout@v6 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v6 with: @@ -86,4 +82,27 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: coveralls --service=github + docs: + name: Doc test + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: + - ubuntu-latest + python-version: + - '3.13' + + steps: + - name: Checkout code + uses: actions/checkout@v6 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v6 + with: + python-version: ${{ matrix.python-version }} + - name: Install Python dependencies + run: | + python -m pip install --upgrade pip setuptools wheel Sphinx + - name: Test the documentation + run: sphinx-build -W --keep-going -b html doc doc/_build/html From ef28c0c5464ce8cf9cd37a031b5a089dde8ec370 Mon Sep 17 00:00:00 2001 From: Benjamin Alan Weaver Date: Mon, 30 Mar 2026 17:33:10 -0700 Subject: [PATCH 4/5] Add h5py to missing list --- doc/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/conf.py b/doc/conf.py index cb413d7..6b7c675 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -62,7 +62,7 @@ # some external dependencies are not met at build time and break the # building process. autodoc_mock_imports = [] -for missing in ('fitsio', 'numpy'): +for missing in ('fitsio', 'h5py', 'numpy'): try: foo = import_module(missing) except ImportError: From e0a3c46e42dd5cc86d6c7cf7f1ab568534528ef6 Mon Sep 17 00:00:00 2001 From: Benjamin Alan Weaver Date: Mon, 30 Mar 2026 17:50:30 -0700 Subject: [PATCH 5/5] install numpy to support quasarnp.utils --- .github/workflows/ci.yml | 1 + .readthedocs.yaml | 3 +++ doc/rtd-requirements.txt | 1 + 3 files changed, 5 insertions(+) create mode 100644 doc/rtd-requirements.txt diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f0965e8..2ae2c11 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -103,6 +103,7 @@ jobs: - name: Install Python dependencies run: | python -m pip install --upgrade pip setuptools wheel Sphinx + python -m pip install numpy - name: Test the documentation run: sphinx-build -W --keep-going -b html doc doc/_build/html diff --git a/.readthedocs.yaml b/.readthedocs.yaml index ebca6f8..36d1d17 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -20,3 +20,6 @@ sphinx: # - pdf # Optionally declare the Python requirements required to build your docs +python: + install: + - requirements: doc/rtd-requirements.txt diff --git a/doc/rtd-requirements.txt b/doc/rtd-requirements.txt new file mode 100644 index 0000000..24ce15a --- /dev/null +++ b/doc/rtd-requirements.txt @@ -0,0 +1 @@ +numpy