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
47 changes: 20 additions & 27 deletions .github/workflows/Documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,51 +8,44 @@ on:
tags: '*'
pull_request:

# sphinx-build doc _build
permissions:
contents: write
contents: write

jobs:
docs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
lfs: 'true'
lfs: true
fetch-depth: 0
- uses: actions/setup-python@v3

- name: Install dependencies
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"

- name: Fetch all branches and tags
run: |
# pip install -r docs/requirements.txt
pip install -e .[docs]
git fetch origin '+refs/heads/*:refs/remotes/origin/*' --tags --force

- name: Sphinx Build Develop
- name: Install dependencies
run: |
git checkout develop
git fetch --all
git pull --all
cd ${{ github.workspace }}/docs
# make html
sphinx-multiversion source build/html
python -m pip install --upgrade pip
python -m pip install -e ".[docs]"
python --version
python -m pip show sphinx sphinx-multiversion

- name: Sphinx Build Main
- name: Build docs
run: |
git checkout main
cd ${{ github.workspace }}/docs
cd docs
sphinx-multiversion source build/html

# - name: Make symlinks
# run: |
# ln -sf ${{ github.workspace }}/build/html/main ${{ github.workspace }}/build/html/stable
# ln -sf ${{ github.workspace }}/build/html/develop ${{ github.workspace }}/build/html/dev

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.event_name == 'push' && ((github.ref == 'refs/heads/main') || (github.ref == 'refs/heads/develop'))}}
if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop') }}
with:
publish_branch: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
# publish_dir: docs/build/
publish_dir: docs/build/html/
# publish_dir: _build/
# force_orphan: true
publish_dir: docs/build/html/
3 changes: 1 addition & 2 deletions .github/workflows/Test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,13 @@ jobs:
strategy:
matrix:
# Test on current Python LTS versions
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
os:
- ubuntu-latest
# - macOS-latest
# - windows-latest
arch:
- x64
- x86

steps:
- uses: actions/checkout@v3
Expand Down
52 changes: 14 additions & 38 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@
'sphinx.ext.intersphinx',
'sphinx.ext.napoleon',
"sphinx_multiversion",
# 'sphinx.ext.autosectionlabel',
# 'sphinx_autopackagesummary',
]

autosummary_generate_overwrite = True
Expand All @@ -54,8 +52,6 @@
# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

# html_theme = 'alabaster'
# html_theme = 'sphinx_rtd_theme'
html_theme = 'furo'

html_static_path = ['_static']
Expand All @@ -72,47 +68,27 @@
],
}

# html_css_files = [
# 'css/rtd.css',
# ]

# -- Options for EPUB output
epub_show_urls = 'footnote'


# Whitelist pattern for tags (set to None to ignore all tags)
# smv_tag_whitelist = r'^.*$'
# smv_tag_whitelist = r'v*'
# Ignore tags for now
smv_tag_whitelist = None
# smv_tag_pattern = r'^v\d*\.\d*\.\d*$'
# smv_tag_pattern = r'^.*(?!alpha)$'

# Whitelist pattern for branches (set to None to ignore all branches)
# smv_branch_whitelist = r'^.*$
# smv_branch_whitelist = None
# smv_branch_whitelist = r'^(main|develop)$'
# smv_branch_whitelist = r'^self-host-docs$'
smv_branch_whitelist = r'^(main|develop)$'

# Whitelist pattern for remotes (set to None to use local branches only)
smv_remote_whitelist = None

# Pattern for released versions
# smv_released_pattern = r'^v.*$'
# smv_released_pattern = r'v\d*\.\d*\.\d*'

# Build docs for main and develop, whether sphinx-multiversion sees them
# as local branches or as remote branches.
smv_branch_whitelist = r'^(origin/)?(main|develop)$'

# Allow origin/main and origin/develop.
smv_remote_whitelist = r'^origin$'

# No tags are being built, so this does not matter much right now.
smv_released_pattern = r'^tags/.*$'

# Format for versioned output directories inside the build directory
# Use simple output directories: main, develop.
smv_outputdir_format = '{ref.name}'

# Determines whether remote or local git branches/tags are preferred if their output dirs conflict
smv_prefer_remote_refs = False

# # Skip param objects because of their weird rendering in docs
# def maybe_skip_member(app, what, name, obj, skip, options):
# # print app, what, name, obj, skip, options
# # if name == ""
# return True
# Prefer remote refs in CI, since GitHub Actions reliably has origin/main
# and origin/develop after fetching.
smv_prefer_remote_refs = True

# def setup(app):
# app.connect('autodoc-skip-member', maybe_skip_member)
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ test = [
"flake8",
]
docs = [
"sphinx",
"sphinx<9",
"furo",
"sphinx-multiversion",
]
Expand Down
Loading