File tree Expand file tree Collapse file tree 11 files changed +117
-4
lines changed
Expand file tree Collapse file tree 11 files changed +117
-4
lines changed Original file line number Diff line number Diff line change 1+ name : Github Pages
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+
8+ jobs :
9+ deploy :
10+ runs-on : ubuntu-22.04
11+ steps :
12+ - uses : actions/checkout@v3
13+
14+ - name : Setup Python
15+ uses : actions/setup-python@v4
16+ with :
17+ python-version : " 3.10"
18+
19+ - name : Install dependencies
20+ run : |
21+ python -m pip install ".[docs]"
22+ - name : Build docs
23+ run : make doc
24+
25+ - name : Deploy
26+ uses : peaceiris/actions-gh-pages@v3
27+ with :
28+ github_token : ${{ secrets.GITHUB_TOKEN }}
29+ publish_dir : ./docs/_build/html
Original file line number Diff line number Diff line change 5454 path : htmlcov
5555 if-no-files-found : error
5656
57+ - name : Build documentation
58+ run : |
59+ make doc
60+
61+ - name : Upload documentation
62+ uses : actions/upload-artifact@v3
63+ with :
64+ name : documentation
65+ path : docs/_build/html
66+ if-no-files-found : error
67+
68+
5769 test-code :
5870 # This code depends on the result of check-code
5971 needs : check-code
Original file line number Diff line number Diff line change 1+ doc : # Generate Sphinx HTML documentation, including API docs
2+ cp README.md docs/README.md
3+ jupyter book build docs
4+
5+ clean-pytest : # Remove output from pytest
6+ rm -rf .pytest_cache
7+ rm -rf test/__pycache__
8+
9+ clean-coverage : # Remove output from coverage
10+ rm -rf .covarge htmlcov
11+
12+ clean-mypackage : # Remove output from installing package
13+ rm -rf mypackage.egg-info mypackage/__pycache__
14+
15+ clean-mypy : # Remove output from mypy
16+ rm -rf .mypy_cache
17+
18+ clean : clean-mypy clean-mypackage clean-coverage clean-pytest
Original file line number Diff line number Diff line change 1+ # Book settings
2+ # Learn more at https://jupyterbook.org/customize/config.html
3+
4+ title : MyPackage - The reproducible template for Simula Research Laboratory
5+ author : Jørgen S. Dokken
6+ logo : " logo.png"
7+ copyright : " 2022"
8+
9+ # Force re-execution of notebooks on each build.
10+ # See https://jupyterbook.org/content/execute.html
11+ execute :
12+ execute_notebooks : force
13+
14+
15+ # Information about where the book exists on the web
16+ repository :
17+ url : https://github.com/jorgensd/reproducibility # Online location of your book
18+ path_to_book : docs # Optional path to your book, relative to the repository root
19+ branch : main # Which branch of the repository should be used when creating links (optional)
20+
21+
22+ sphinx :
23+ extra_extensions :
24+ - ' sphinx.ext.autodoc'
25+ - ' sphinx.ext.napoleon'
26+ - ' sphinx.ext.viewcode'
27+
28+
29+ # Add GitHub buttons to your book
30+ # See https://jupyterbook.org/customize/config.html#add-a-link-to-your-repository
31+ html :
32+ use_issues_button : true
33+ use_repository_button : true
34+
35+
36+ parse :
37+ myst_enable_extensions :
38+ - amsmath
39+ - dollarmath
40+ - linkify
Original file line number Diff line number Diff line change 1+ format : jb-book
2+ root : README
3+
4+ chapters :
5+ - file : " api"
Original file line number Diff line number Diff line change 1+ API Reference
2+ =============
3+
4+ .. automodule :: mypackage
5+ :members:
Original file line number Diff line number Diff line change 44# This file is part of my_package
55# SPDX-License-Identifier: MIT
66
7- from .functions import addition
7+ from .functions import addition , print_add
88
9- __all__ = ["addition" ]
9+ __all__ = ["addition" , "print_add" ]
Original file line number Diff line number Diff line change 55# This file is part of mypackage
66# SPDX-License-Identifier: MIT
77
8+ __all__ = ["addition" , "print_add" ]
9+
10+
811def addition (a : int , b : int ) -> int :
912 """ Computes a+b """
1013 return a + b
1114
1215
1316def print_add (a : int , b : int ) -> int :
17+ """ Computes and prints a + b"""
1418 c = a + b
1519 print (c )
1620 return c
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ test = [
2626]
2727
2828docs = [
29- " Sphinx " ,
29+ " sphinx " ,
3030 " jupyter-book" ,
3131 " pandoc"
3232]
You can’t perform that action at this time.
0 commit comments