Skip to content
Open
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
32 changes: 26 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand All @@ -86,4 +82,28 @@ 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
python -m pip install numpy
- name: Test the documentation
run: sphinx-build -W --keep-going -b html doc doc/_build/html

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.DS_Store
quasarnp.egg-info
*__pycache__
doc/_build/
7 changes: 5 additions & 2 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -20,3 +20,6 @@ sphinx:
# - pdf

# Optionally declare the Python requirements required to build your docs
python:
install:
- requirements: doc/rtd-requirements.txt
2 changes: 1 addition & 1 deletion doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 15 additions & 5 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import re
import sys
sys.path.insert(0, os.path.abspath('..'))
from importlib import import_module


# -- Project information -----------------------------------------------------
Expand All @@ -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]


Expand All @@ -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',
Expand All @@ -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.
Expand All @@ -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', 'h5py', 'numpy'):
try:
foo = import_module(missing)
except ImportError:
autodoc_mock_imports.append(missing)

# -- Options for HTML output -------------------------------------------------

Expand All @@ -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']
# html_static_path = ['_static']
1 change: 1 addition & 0 deletions doc/rtd-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
numpy