Skip to content

[FEATURE] Enable Sphinx Documentation Prototype #76

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Nov 26, 2024
Merged
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
25 changes: 22 additions & 3 deletions .flake8.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
[flake8]
ignore = W191,W391,E117
select = C,E,F,W,B,B950
# Ignore specific warnings and errors according to CEP-8 style
extend-ignore =
W191, # Indentation contains tabs
W391, # Blank line at end of file
E117, # Over-indented
D208, # Docstring is over-indented
D203, # 1 blank line required before class docstring - CEP-7
D212, # Multi-line docstring summary should start at the first line - CEP-7
# Ignore long lines as specified in CEP-8
max-line-length = 100
exclude =
extend-exclude =
# No need to traverse our git directory
.git,
# There's no value in checking cache directories
Expand All @@ -10,6 +19,16 @@ exclude =
docs,
# There's no value in checking tox directories
.tox,
# This contains our built documentation
# This contains our built stuff
build
# Nothing to find in node_modules, ignore them
node_modules,
# This contains our built package for PyPi
dist,
# There's no value in checking git directories
.git,
# There's no value in checking virtual directories
venv,
# There's no value in checking xcode directories
*.xc**
max-complexity = 10
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
License - MIT
# License - MIT

Copyright (c) 2017-2024 Mr. Walls

Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ PHONY: must_be_root cleanup

build:
$(QUIET)$(ECHO) "No need to build. Try make -f Makefile install"
$(QUIET)$(MAKE) -s -C ./docs/ -f Makefile text 2>/dev/null || true
$(QUIET)$(MAKE) -s -C ./docs/ -f Makefile html 2>/dev/null || true

init:
$(QUIET)$(ECHO) "$@: Done."
Expand Down Expand Up @@ -103,7 +103,7 @@ test-pytest: cleanup test-reports
$(QUIET)$(ECHO) "$@: Done."

test-style: cleanup
$(QUIET)flake8 --ignore=W191,W391 --max-line-length=100 --verbose --count --config=.flake8.ini
$(QUIET)python3 -m flake8 --ignore=W191,W391 --max-line-length=100 --verbose --count --config=.flake8.ini --show-source || DO_FAIL="exit 2" ;
$(QUIET)tests/check_spelling 2>/dev/null || true
$(QUIET)$(ECHO) "$@: Done."

Expand Down Expand Up @@ -136,7 +136,7 @@ cleanup:

clean: cleanup
$(QUIET)rm -f test-results/junit.xml 2>/dev/null || true
$(QUIET)$(MAKE) -s -C ./docs/ -f Makefile clean 2>/dev/null || true
$(QUIET)$(MAKE) -s -C ./docs/ -f Makefile clean || true
$(QUIET)$(ECHO) "$@: Done."

must_be_root:
Expand Down
22 changes: 14 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
# About
# Python Repo Template

## About
This repo is basically my template for new repos/projects

# CI Template:
## CI Template

By default this template will assume that the GHA Service and Circle-CI Service are used for CI/CD

# Status
## Status

### master:
### master
[![CI](https://github.com/reactive-firewall/python-repo/actions/workflows/Tests.yml/badge.svg?branch=master)](https://github.com/reactive-firewall/python-repo/actions/workflows/Tests.yml)
[![CircleCI](https://circleci.com/gh/reactive-firewall/python-repo/tree/master.svg?style=svg)](https://circleci.com/gh/reactive-firewall/python-repo/tree/master)
[![status](https://travis-ci.org/reactive-firewall/python-repo.svg?branch=master)](https://travis-ci.org/reactive-firewall/python-repo)
Expand All @@ -24,7 +26,7 @@ By default this template will assume that the GHA Service and Circle-CI Service
![Size](https://img.shields.io/github/languages/code-size/reactive-firewall/python-repo.svg)
![commits-since](https://img.shields.io/github/commits-since/reactive-firewall/python-repo/stable.svg?maxAge=9000)

### Stable:
### Stable
[![CI](https://github.com/reactive-firewall/python-repo/actions/workflows/Tests.yml/badge.svg?branch=stable&event=pull_request)](https://github.com/reactive-firewall/python-repo/actions/workflows/Tests.yml)
[![CircleCI](https://circleci.com/gh/reactive-firewall/python-repo/tree/stable.svg?style=svg)](https://circleci.com/gh/reactive-firewall/python-repo/tree/stable)
[![status](https://travis-ci.org/reactive-firewall/python-repo.svg?branch=stable)](https://travis-ci.org/reactive-firewall/python-repo)
Expand All @@ -34,7 +36,7 @@ By default this template will assume that the GHA Service and Circle-CI Service
[![Coverage Status](https://coveralls.io/repos/github/reactive-firewall/python-repo/badge.svg?branch=stable)](https://coveralls.io/github/reactive-firewall/python-repo?branch=stable)
[![codebeat badge](https://codebeat.co/badges/87520e4a-6d24-4e98-a61e-6e9efc58f783)](https://codebeat.co/projects/github-com-reactive-firewall-python-repo-stable)

# How do I use this to create a new project repo?
### How do I use this to create a new project repo?

(assuming new project is already forked on github to `MY-NEW-REPO`)

Expand All @@ -44,7 +46,7 @@ git clone https://github.com/reactive-firewall/MY-NEW-REPO.git MY-NEW-REPO
# cd ./MY-NEW-REPO
```

# Dev Testing Template:
### Dev Testing Template

In a rush? Then use this:

Expand All @@ -70,7 +72,11 @@ make test-tox ; # runs the tox tests
make clean ; # cleans up for next test
```

# Next steps:
### Documentation

For more details read the project [documentation](./docs/index).

### Next steps

Like automation? Then integrate away, this template can take it!
(hint: @coderabbitai, @travis-ci, @houndci-bot, @pyup-bot, @circleci, @codecov-io, @lemurheavy, @coverallsapp, @codeclimate)
Expand Down
56 changes: 35 additions & 21 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,22 @@
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXOPTS = -c ../docs/ -v
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = _build
SRCDIR = .
# change this to the directory you store python code in
PROJECT_DOC_SRC_DIR = "pythonrepo"

# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) $(SRCDIR)
# the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) $(SRCDIR)

.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
.PHONY: help init clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext

help:
@echo "Please use \`make <target>' where <target> is one of"
Expand All @@ -38,41 +41,52 @@ help:
@echo " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)"

init:
@ln -sf ../"$(PROJECT_DOC_SRC_DIR)" $(SRCDIR)/"$(PROJECT_DOC_SRC_DIR)"
@ln -sf ../tests $(SRCDIR)/tests 2>/dev/null || true
@ln -sf ../README.md $(SRCDIR)/README.md
@ln -sf ../LICENSE.md $(SRCDIR)/LICENSE.md

clean:
@-rm -rf $(BUILDDIR)/* 2>/dev/null || true
@-rm -rfRd $(SRCDIR)/apidocs/* 2>/dev/null || true
@-unlink $(SRCDIR)/README.md 2>/dev/null || true
@-unlink $(SRCDIR)/tests 2>/dev/null || true
@-unlink $(SRCDIR)/LICENSE.md 2>/dev/null || true
@-unlink $(SRCDIR)/"$(PROJECT_DOC_SRC_DIR)" 2>/dev/null || true

html:
html: init
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."

dirhtml:
dirhtml: init
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."

singlehtml:
singlehtml: init
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
@echo
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."

pickle:
pickle: init
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
@echo
@echo "Build finished; now you can process the pickle files."

json:
json: init
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
@echo
@echo "Build finished; now you can process the JSON files."

htmlhelp:
htmlhelp: init
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
@echo
@echo "Build finished; now you can run HTML Help Workshop with the" \
".hhp project file in $(BUILDDIR)/htmlhelp."

qthelp:
qthelp: init
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
Expand All @@ -81,7 +95,7 @@ qthelp:
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/sample.qhc"

devhelp:
devhelp: init
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
@echo
@echo "Build finished."
Expand All @@ -90,12 +104,12 @@ devhelp:
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/sample"
@echo "# devhelp"

epub:
epub: init
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
@echo
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."

latex:
latex: init
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
Expand All @@ -108,35 +122,35 @@ latexpdf:
$(MAKE) -C $(BUILDDIR)/latex all-pdf
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."

text:
text: init
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
@echo
@echo "Build finished. The text files are in $(BUILDDIR)/text."

man:
man: init
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
@echo
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."

texinfo:
texinfo: init
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
@echo "Run \`make' in that directory to run these through makeinfo" \
"(use \`make info' here to do that automatically)."

info:
info: init
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo "Running Texinfo files through makeinfo..."
make -C $(BUILDDIR)/texinfo info
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."

gettext:
gettext: init
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
@echo
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."

changes:
changes: init
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
@echo
@echo "The overview file is in $(BUILDDIR)/changes."
Expand All @@ -147,7 +161,7 @@ linkcheck:
@echo "Link check complete; look for any errors in the above output " \
"or in $(BUILDDIR)/linkcheck/output.txt."

doctest:
doctest: init
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(BUILDDIR)/doctest/output.txt."
Loading
Loading