Skip to content

Commit

Permalink
Merge ad1b317 into bf27f81
Browse files Browse the repository at this point in the history
  • Loading branch information
obackhouse authored Apr 12, 2024
2 parents bf27f81 + ad1b317 commit 6926b98
Show file tree
Hide file tree
Showing 7 changed files with 110 additions and 3 deletions.
15 changes: 12 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,16 @@ jobs:
python -m black . --diff --check --verbose
python -m isort . --diff --check-only --verbose
python -m flake8 momentGW/ --verbose
- name: Run unit tests
#- name: Run unit tests
# run: |
# python -m pip install pytest pytest-cov
# pytest --cov momentGW/
- name: Build documentation
run: |
python -m pip install pytest pytest-cov
pytest --cov momentGW/
cd docs
make html
- name: Deploy documentation
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/_build/html
13 changes: 13 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SOURCEDIR = .
BUILDDIR = _build

html:
sphinx-apidoc -o api/ ../momentGW --force --separate
sphinx-build -M html . _build

clean:
rm -rf _build api

.PHONY: html
8 changes: 8 additions & 0 deletions docs/api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
API Documentation
=================

.. toctree::
:maxdepth: 2
:caption: Contents:

api/modules
22 changes: 22 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# docs/conf.py

import os
import sys

sys.path.insert(0, os.path.abspath("../"))

project = "momentGW"
copyright = "2024, Oliver J. Backhouse"
author = "Oliver J. Backhouse"

extensions = [
"sphinx_mdinclude",
"sphinx.ext.mathjax",
"sphinx.ext.autodoc",
"numpydoc",
]

source_suffix = [".rst", ".md"]
master_doc = "index"

html_theme = "alabaster"
17 changes: 17 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Welcome to momentGW's documentation!
====================================

.. toctree::
:maxdepth: 2
:caption: Contents:

.. mdinclude::
../README.md


Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
35 changes: 35 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=.
set BUILDDIR=_build

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.https://www.sphinx-doc.org/
exit /b 1
)

if "%1" == "" goto help

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ dev = [
"pytest>=6.2.4",
"pytest-cov>=4.0.0",
"pytest-env>=1.1.0",
"sphinx>=4.0.0",
"sphinx-mdinclude>=0.5.0",
"numpydoc>=1.1.0",
]
mpi = [
"mpi4py>=3.1.0",
Expand Down

0 comments on commit 6926b98

Please sign in to comment.