From 3ba1c207a9bdc4eb2d3b63992b7944b43ea8c254 Mon Sep 17 00:00:00 2001 From: comrumino Date: Thu, 12 Oct 2023 19:25:47 -0500 Subject: [PATCH] Added nitpick to docs/Makefile and other docs improvemnts --- .../workflows/{sphinx-build.yml => sphinx-test.yml} | 0 docs/Makefile | 12 ++++++------ docs/conf.py | 2 +- docs/docs/advanced-debugging.rst | 4 ++-- docs/docs/howto.rst | 10 +++++----- 5 files changed, 14 insertions(+), 14 deletions(-) rename .github/workflows/{sphinx-build.yml => sphinx-test.yml} (100%) diff --git a/.github/workflows/sphinx-build.yml b/.github/workflows/sphinx-test.yml similarity index 100% rename from .github/workflows/sphinx-build.yml rename to .github/workflows/sphinx-test.yml diff --git a/docs/Makefile b/docs/Makefile index dffabd26..7a2a76de 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -10,9 +10,9 @@ BUILDDIR = _build # Internal variables. PAPEROPT_a4 = -D latex_paper_size=a4 PAPEROPT_letter = -D latex_paper_size=letter -ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . +ALLSPHINXOPTS = -n -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . -.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest +.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest nitpick help: @echo "Please use \`make ' where is one of" @@ -124,6 +124,10 @@ linkcheck: @echo "Link check complete; look for any errors in the above output " \ "or in $(BUILDDIR)/linkcheck/output.txt." +nitpick: + $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) -E -W --keep-going $(BUILDDIR)/html + @echo "Nit-picky build test and treating warnings as errors." + doctest: $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest @echo "Testing of doctests in the sources finished, look at the " \ @@ -131,7 +135,3 @@ doctest: upload: html rsync -r -v $(BUILDDIR)/html/ gangesmaster,rpyc@web.sourceforge.net:htdocs/ - - - - diff --git a/docs/conf.py b/docs/conf.py index 4a88bbef..8c72ade7 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -28,7 +28,7 @@ # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. -extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode'] +extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode', 'sphinx.ext.doctest'] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] diff --git a/docs/docs/advanced-debugging.rst b/docs/docs/advanced-debugging.rst index 92af7711..80747f12 100644 --- a/docs/docs/advanced-debugging.rst +++ b/docs/docs/advanced-debugging.rst @@ -31,8 +31,8 @@ Unit tests can be ran using your desired Python version as well. .. code-block:: bash - PYENV_VERSION=3.9-dev pyenv exec python -m unittest discover -s ./tests -k test_affinity - PYENV_VERSION=3.8-dev pyenv exec python -m unittest discover -s ./tests + PYENV_VERSION=3.9-dev pyenv exec python -m unittest discover -v -k test_affinity + PYENV_VERSION=3.8-dev pyenv exec python -m unittest discover Testing Supported Python Versions via Docker -------------------------------------------- diff --git a/docs/docs/howto.rst b/docs/docs/howto.rst index 65d5e7ca..d143a06e 100644 --- a/docs/docs/howto.rst +++ b/docs/docs/howto.rst @@ -13,23 +13,23 @@ you can use the following receipt:: >>> import rpyc >>> c = rpyc.classic.connect("localhost") - >>> c.execute("print 'hi there'") # this will print on the host + >>> c.execute("print('hi there')") # this will print on the host >>> import sys >>> c.modules.sys.stdout = sys.stdout - >>> c.execute("print 'hi here'") # now this will be redirected here + >>> c.execute("print('hi here')") # now this will be redirected here hi here Also note that if you are using classic mode RPyC, you can use the `context manager `_ ``rpyc.classic.redirected_stdio``:: - >>> c.execute("print 'hi there'") # printed on the server + >>> c.execute("print('hi there')") # printed on the server >>> >>> with rpyc.classic.redirected_stdio(c): - ... c.execute("print 'hi here'") # printed on the client + ... c.execute("print('hi here')") # printed on the client ... hi here - >>> c.execute("print 'hi there again'") # printed on the server + >>> c.execute("print('hi there again')") # printed on the server >>> .. figure:: _static/howto-redirected.png