From 1617cd835c18deb5fde3105f94576799d4eb3f81 Mon Sep 17 00:00:00 2001 From: Chris Mayo Date: Tue, 21 Jul 2020 19:19:28 +0100 Subject: [PATCH 01/12] Add missing files to .gitignore --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index d10849a01..fbe5379f8 100644 --- a/.gitignore +++ b/.gitignore @@ -16,9 +16,12 @@ libs *.pyd MANIFEST +doc/s5/lxml-ep2008.html src/lxml/includes/lxml-version.h src/lxml/*.html src/lxml/html/*.c +src/lxml/_elementpath.c +src/lxml/builder.c src/lxml/etree.c src/lxml/etree.h src/lxml/etree_api.h @@ -27,3 +30,4 @@ src/lxml/lxml.etree.h src/lxml/lxml.etree_api.h src/lxml/objectify.c src/lxml/lxml.objectify.c +src/lxml/sax.c From c4e6a3753b7b651fb437426ff12e7703f6391848 Mon Sep 17 00:00:00 2001 From: Chris Mayo Date: Tue, 21 Jul 2020 19:19:28 +0100 Subject: [PATCH 02/12] Use Sphinx autodoc to create the API reference instead of Epydoc Epydoc is Python 2 only and unmaintained. --- .gitignore | 1 + Makefile | 27 ++-- doc/api/Makefile | 23 +++ doc/api/conf.py | 47 ++++++ doc/api/index.rst | 19 +++ doc/api/lxml.html.rst | 80 ++++++++++ doc/api/lxml.isoschematron.rst | 10 ++ doc/api/lxml.rst | 79 +++++++++ doc/api/lxml.tests.rst | 282 +++++++++++++++++++++++++++++++++ 9 files changed, 552 insertions(+), 16 deletions(-) create mode 100644 doc/api/Makefile create mode 100644 doc/api/conf.py create mode 100644 doc/api/index.rst create mode 100644 doc/api/lxml.html.rst create mode 100644 doc/api/lxml.isoschematron.rst create mode 100644 doc/api/lxml.rst create mode 100644 doc/api/lxml.tests.rst diff --git a/.gitignore b/.gitignore index fbe5379f8..e37931b7f 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ wheelhouse wheels venvs venv +doc/api/_build doc/html libs *.egg-info diff --git a/Makefile b/Makefile index 7eb976cd0..81dfc03ad 100644 --- a/Makefile +++ b/Makefile @@ -106,14 +106,12 @@ ftest_inplace: inplace $(PYTHON) test.py -f $(TESTFLAGS) $(TESTOPTS) apihtml: inplace + rm -fr doc/api/_build rm -fr doc/html/api - @[ -x "`which epydoc`" ] \ - && (cd src && echo "Generating API docs ..." && \ - PYTHONPATH=. epydoc -v --docformat "restructuredtext en" \ - -o ../doc/html/api --exclude='[.]html[.]tests|[.]_' \ - --exclude-introspect='[.]usedoctest' \ - --name "lxml API" --url / lxml/) \ - || (echo "not generating epydoc API documentation") + @[ -x "`which sphinx-build`" ] \ + && (echo "Generating API docs ..." && \ + make -C doc/api html) \ + || (echo "not generating Sphinx autodoc API documentation") website: inplace PYTHONPATH=src:$(PYTHONPATH) $(PYTHON) doc/mkhtml.py doc/html . ${LXMLVERSION} @@ -124,15 +122,11 @@ s5: $(MAKE) -C doc/s5 slides apipdf: inplace - rm -fr doc/pdf - mkdir -p doc/pdf - @[ -x "`which epydoc`" ] \ - && (cd src && echo "Generating API docs ..." && \ - PYTHONPATH=. epydoc -v --latex --docformat "restructuredtext en" \ - -o ../doc/pdf --exclude='([.]html)?[.]tests|[.]_' \ - --exclude-introspect='html[.]clean|[.]usedoctest' \ - --name "lxml API" --url / lxml/) \ - || (echo "not generating epydoc API documentation") + rm -fr doc/api/_build + @[ -x "`which sphinx-build`" ] \ + && (echo "Generating API PDF docs ..." && \ + make -C doc/api latexpdf) \ + || (echo "not generating Sphinx autodoc API PDF documentation") pdf: apipdf $(PYTHON) doc/mklatex.py doc/pdf . ${LXMLVERSION} @@ -164,6 +158,7 @@ docclean: $(MAKE) -C doc/s5 clean rm -f doc/html/*.html rm -fr doc/html/api + rm -fr doc/api/_build rm -fr doc/pdf realclean: clean docclean diff --git a/doc/api/Makefile b/doc/api/Makefile new file mode 100644 index 000000000..c717f8b78 --- /dev/null +++ b/doc/api/Makefile @@ -0,0 +1,23 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line, and also +# from the environment for the first two. +SPHINXOPTS ?= +SPHINXBUILD ?= sphinx-build +SOURCEDIR = . +BUILDDIR = _build + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +html: + @$(SPHINXBUILD) -b html "$(SOURCEDIR)" -d "$(BUILDDIR)/doctrees" ../html/api $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/doc/api/conf.py b/doc/api/conf.py new file mode 100644 index 000000000..b88ca9375 --- /dev/null +++ b/doc/api/conf.py @@ -0,0 +1,47 @@ +import os +import sys +sys.path.insert(0, os.path.abspath('../../src')) +# For soupparser in lxml.html.ElementSoup module: +sys.path.insert(1, os.path.abspath('../../src/lxml/html')) + +from lxml import __version__ as lxml_version + +# -- Project information ----------------------------------------------------- + +project = 'lxml' +copyright = '2020, lxml dev team' +author = 'lxml dev team' +version = lxml_version + + +# -- General configuration --------------------------------------------------- + +extensions = [ + 'sphinx.ext.autodoc', + 'sphinx.ext.viewcode', + 'sphinx_rtd_theme', +] + +language = 'en' + +exclude_patterns = ['_build'] + + +# -- Options for HTML output ------------------------------------------------- + +html_theme = 'sphinx_rtd_theme' + +html_logo = '../html/python-xml.png' + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +#html_static_path = ['_static'] + + +# -- Extension configuration ------------------------------------------------- + +# -- Options for todo extension ---------------------------------------------- + +# If true, `todo` and `todoList` produce output, else they produce nothing. +#todo_include_todos = True diff --git a/doc/api/index.rst b/doc/api/index.rst new file mode 100644 index 000000000..8b4b933e8 --- /dev/null +++ b/doc/api/index.rst @@ -0,0 +1,19 @@ +lxml API Reference +================== + +.. toctree:: + :maxdepth: 4 + :caption: Contents: + + lxml + lxml.html + lxml.isoschematron + lxml.tests + + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff --git a/doc/api/lxml.html.rst b/doc/api/lxml.html.rst new file mode 100644 index 000000000..da44c0b64 --- /dev/null +++ b/doc/api/lxml.html.rst @@ -0,0 +1,80 @@ +lxml.html +================= + +lxml.html.ElementSoup module +---------------------------- + +.. automodule:: lxml.html.ElementSoup + :members: + :undoc-members: + :show-inheritance: + +lxml.html.builder module +------------------------ + +.. automodule:: lxml.html.builder + :members: + :undoc-members: + :show-inheritance: + +lxml.html.clean module +---------------------- + +.. automodule:: lxml.html.clean + :members: + :undoc-members: + :show-inheritance: + +lxml.html.defs module +--------------------- + +.. automodule:: lxml.html.defs + :members: + :undoc-members: + :show-inheritance: + +lxml.html.diff module +--------------------- + +.. automodule:: lxml.html.diff + :members: + :undoc-members: + :show-inheritance: + +lxml.html.formfill module +------------------------- + +.. automodule:: lxml.html.formfill + :members: + :undoc-members: + :show-inheritance: + +lxml.html.html5parser module +---------------------------- + +.. automodule:: lxml.html.html5parser + :members: + :undoc-members: + :show-inheritance: + +lxml.html.soupparser module +--------------------------- + +.. automodule:: lxml.html.soupparser + :members: + :undoc-members: + :show-inheritance: + +lxml.html.usedoctest module +--------------------------- + +.. module:: lxml.html.usedoctest + + +Module contents +--------------- + +.. automodule:: lxml.html + :members: + :undoc-members: + :show-inheritance: diff --git a/doc/api/lxml.isoschematron.rst b/doc/api/lxml.isoschematron.rst new file mode 100644 index 000000000..e6c7d37b9 --- /dev/null +++ b/doc/api/lxml.isoschematron.rst @@ -0,0 +1,10 @@ +lxml.isoschematron +========================== + +Module contents +--------------- + +.. automodule:: lxml.isoschematron + :members: + :undoc-members: + :show-inheritance: diff --git a/doc/api/lxml.rst b/doc/api/lxml.rst new file mode 100644 index 000000000..d32895dbe --- /dev/null +++ b/doc/api/lxml.rst @@ -0,0 +1,79 @@ +lxml +============ + +lxml.ElementInclude module +-------------------------- + +.. automodule:: lxml.ElementInclude + :members: + :undoc-members: + :show-inheritance: + +lxml.builder module +------------------- + +.. automodule:: lxml.builder + :members: + :undoc-members: + :show-inheritance: + +lxml.cssselect module +--------------------- + +.. automodule:: lxml.cssselect + :members: + :undoc-members: + :show-inheritance: + +lxml.doctestcompare module +-------------------------- + +.. automodule:: lxml.doctestcompare + :members: + :undoc-members: + :show-inheritance: + +lxml.etree module +----------------- + +.. automodule:: lxml.etree + :members: + :undoc-members: + :show-inheritance: + +lxml.objectify module +--------------------- + +.. automodule:: lxml.objectify + :members: + :undoc-members: + :show-inheritance: + +lxml.pyclasslookup module +------------------------- + +.. automodule:: lxml.pyclasslookup + :members: + :undoc-members: + :show-inheritance: + +lxml.sax module +--------------- + +.. automodule:: lxml.sax + :members: + :undoc-members: + :show-inheritance: + +lxml.usedoctest module +---------------------- + +.. module:: lxml.usedoctest + +Module contents +--------------- + +.. automodule:: lxml + :members: + :undoc-members: + :show-inheritance: diff --git a/doc/api/lxml.tests.rst b/doc/api/lxml.tests.rst new file mode 100644 index 000000000..bb4807e1f --- /dev/null +++ b/doc/api/lxml.tests.rst @@ -0,0 +1,282 @@ +lxml.tests +================== + +lxml.tests.common\_imports module +--------------------------------- + +.. automodule:: lxml.tests.common_imports + :members: + :exclude-members: etree + :undoc-members: + :show-inheritance: + +lxml.tests.dummy\_http\_server module +------------------------------------- + +.. automodule:: lxml.tests.dummy_http_server + :members: + :exclude-members: etree + :undoc-members: + :show-inheritance: + +lxml.tests.selftest module +-------------------------- + +.. automodule:: lxml.tests.selftest + :members: + :exclude-members: etree + :undoc-members: + :show-inheritance: + +lxml.tests.selftest2 module +--------------------------- + +.. automodule:: lxml.tests.selftest2 + :members: + :exclude-members: etree + :undoc-members: + :show-inheritance: + +lxml.tests.test\_builder module +------------------------------- + +.. automodule:: lxml.tests.test_builder + :members: + :exclude-members: etree + :undoc-members: + :show-inheritance: + +lxml.tests.test\_classlookup module +----------------------------------- + +.. automodule:: lxml.tests.test_classlookup + :members: + :exclude-members: etree + :undoc-members: + :show-inheritance: + +lxml.tests.test\_css module +--------------------------- + +.. automodule:: lxml.tests.test_css + :members: + :exclude-members: etree + :undoc-members: + :show-inheritance: + +lxml.tests.test\_doctestcompare module +-------------------------------------- + +.. automodule:: lxml.tests.test_doctestcompare + :members: + :exclude-members: etree + :undoc-members: + :show-inheritance: + +lxml.tests.test\_dtd module +--------------------------- + +.. automodule:: lxml.tests.test_dtd + :members: + :exclude-members: etree + :undoc-members: + :show-inheritance: + +lxml.tests.test\_elementpath module +----------------------------------- + +.. automodule:: lxml.tests.test_elementpath + :members: + :exclude-members: etree + :undoc-members: + :show-inheritance: + +lxml.tests.test\_elementtree module +----------------------------------- + +.. automodule:: lxml.tests.test_elementtree + :members: + :exclude-members: etree + :undoc-members: + :show-inheritance: + +lxml.tests.test\_errors module +------------------------------ + +.. automodule:: lxml.tests.test_errors + :members: + :exclude-members: etree + :undoc-members: + :show-inheritance: + +lxml.tests.test\_etree module +----------------------------- + +.. automodule:: lxml.tests.test_etree + :members: + :exclude-members: etree, ElementInclude + :undoc-members: + :show-inheritance: + +lxml.tests.test\_external\_document module +------------------------------------------ + +.. automodule:: lxml.tests.test_external_document + :members: + :exclude-members: etree + :undoc-members: + :show-inheritance: + +lxml.tests.test\_htmlparser module +---------------------------------- + +.. automodule:: lxml.tests.test_htmlparser + :members: + :exclude-members: etree + :undoc-members: + :show-inheritance: + +lxml.tests.test\_http\_io module +-------------------------------- + +.. automodule:: lxml.tests.test_http_io + :members: + :exclude-members: etree + :undoc-members: + :show-inheritance: + +lxml.tests.test\_incremental\_xmlfile module +-------------------------------------------- + +.. automodule:: lxml.tests.test_incremental_xmlfile + :members: + :exclude-members: etree + :undoc-members: + :show-inheritance: + +lxml.tests.test\_io module +-------------------------- + +.. automodule:: lxml.tests.test_io + :members: + :exclude-members: etree + :undoc-members: + :show-inheritance: + +lxml.tests.test\_isoschematron module +------------------------------------- + +.. automodule:: lxml.tests.test_isoschematron + :members: + :exclude-members: etree + :undoc-members: + :show-inheritance: + +lxml.tests.test\_nsclasses module +--------------------------------- + +.. automodule:: lxml.tests.test_nsclasses + :members: + :exclude-members: etree + :undoc-members: + :show-inheritance: + +lxml.tests.test\_objectify module +--------------------------------- + +.. automodule:: lxml.tests.test_objectify + :members: + :exclude-members: etree + :undoc-members: + :show-inheritance: + +lxml.tests.test\_pyclasslookup module +------------------------------------- + +.. automodule:: lxml.tests.test_pyclasslookup + :members: + :exclude-members: etree + :undoc-members: + :show-inheritance: + +lxml.tests.test\_relaxng module +------------------------------- + +.. automodule:: lxml.tests.test_relaxng + :members: + :exclude-members: etree + :undoc-members: + :show-inheritance: + +lxml.tests.test\_sax module +--------------------------- + +.. automodule:: lxml.tests.test_sax + :members: + :exclude-members: etree + :undoc-members: + :show-inheritance: + +lxml.tests.test\_schematron module +---------------------------------- + +.. automodule:: lxml.tests.test_schematron + :members: + :exclude-members: etree + :undoc-members: + :show-inheritance: + +lxml.tests.test\_threading module +--------------------------------- + +.. automodule:: lxml.tests.test_threading + :members: + :exclude-members: etree + :undoc-members: + :show-inheritance: + +lxml.tests.test\_unicode module +------------------------------- + +.. automodule:: lxml.tests.test_unicode + :members: + :exclude-members: etree + :undoc-members: + :show-inheritance: + +lxml.tests.test\_xmlschema module +--------------------------------- + +.. automodule:: lxml.tests.test_xmlschema + :members: + :exclude-members: etree + :undoc-members: + :show-inheritance: + +lxml.tests.test\_xpathevaluator module +-------------------------------------- + +.. automodule:: lxml.tests.test_xpathevaluator + :members: + :exclude-members: etree + :undoc-members: + :show-inheritance: + +lxml.tests.test\_xslt module +---------------------------- + +.. automodule:: lxml.tests.test_xslt + :members: + :exclude-members: etree + :undoc-members: + :show-inheritance: + + +Module contents +--------------- + +.. automodule:: lxml.tests + :members: + :exclude-members: etree + :undoc-members: + :show-inheritance: From 8f1498bd76789a3c94743947433298aac378a31e Mon Sep 17 00:00:00 2001 From: Chris Mayo Date: Tue, 21 Jul 2020 19:19:28 +0100 Subject: [PATCH 03/12] Remove duplicate open_in_browser from lxml.html.__all__ --- src/lxml/html/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lxml/html/__init__.py b/src/lxml/html/__init__.py index 30a2ed0ee..45421fccb 100644 --- a/src/lxml/html/__init__.py +++ b/src/lxml/html/__init__.py @@ -37,7 +37,7 @@ 'document_fromstring', 'fragment_fromstring', 'fragments_fromstring', 'fromstring', 'tostring', 'Element', 'defs', 'open_in_browser', 'submit_form', 'find_rel_links', 'find_class', 'make_links_absolute', - 'resolve_base_href', 'iterlinks', 'rewrite_links', 'open_in_browser', 'parse'] + 'resolve_base_href', 'iterlinks', 'rewrite_links', 'parse'] import copy From ce6d1b8ef1f86b2d2770e8a2413f8cb9b62977ec Mon Sep 17 00:00:00 2001 From: Chris Mayo Date: Tue, 21 Jul 2020 19:19:28 +0100 Subject: [PATCH 04/12] Make ETreeXMLSchemaTestCase docstring Sphinx autodoc friendly --- src/lxml/tests/test_xmlschema.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lxml/tests/test_xmlschema.py b/src/lxml/tests/test_xmlschema.py index 921ed800c..c5653c1e5 100644 --- a/src/lxml/tests/test_xmlschema.py +++ b/src/lxml/tests/test_xmlschema.py @@ -66,8 +66,10 @@ def test_xmlschema_error_log_path(self): for a _LogEntry object (or even a node for which to determine a path), but at least when this test was created schema validation errors always got a node and an XPath value. If that ever changes, - we can modify this test to something like: + we can modify this test to something like:: + self.assertTrue(error_path is None or tree_path == error_path) + That way, we can at least verify that if we did get a path value it wasn't bogus. """ From b1095c638b3f51b998ac8cb227f5552fb7853f8b Mon Sep 17 00:00:00 2001 From: Chris Mayo Date: Tue, 21 Jul 2020 19:19:28 +0100 Subject: [PATCH 05/12] Replace codespeak.net links in docstrings --- src/lxml/classlookup.pxi | 2 +- src/lxml/sax.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lxml/classlookup.pxi b/src/lxml/classlookup.pxi index 89302251d..137e111ab 100644 --- a/src/lxml/classlookup.pxi +++ b/src/lxml/classlookup.pxi @@ -504,7 +504,7 @@ cdef class PythonElementClassLookup(FallbackElementClassLookup): `lxml.etree` API (such as XPath, extended slicing or some iteration methods). - See http://codespeak.net/lxml/element_classes.html + See https://lxml.de/element_classes.html """ def __cinit__(self): self._lookup_function = _python_class_lookup diff --git a/src/lxml/sax.py b/src/lxml/sax.py index 299c235e8..02ee3bf39 100644 --- a/src/lxml/sax.py +++ b/src/lxml/sax.py @@ -9,7 +9,7 @@ Use the `ElementTreeProducer` class or the `saxify()` function to fire the SAX events of an ElementTree against a SAX ContentHandler. -See http://codespeak.net/lxml/sax.html +See https://lxml.de/sax.html """ from __future__ import absolute_import From 21df98bf1e75825701dc2bf83ddccca6484f46c5 Mon Sep 17 00:00:00 2001 From: Chris Mayo Date: Tue, 21 Jul 2020 19:19:28 +0100 Subject: [PATCH 06/12] Ensure all modules have some documentation --- doc/api/lxml.html.rst | 1 + doc/api/lxml.rst | 2 ++ src/lxml/html/defs.py | 8 +++++--- src/lxml/pyclasslookup.py | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/doc/api/lxml.html.rst b/doc/api/lxml.html.rst index da44c0b64..57305d7c2 100644 --- a/doc/api/lxml.html.rst +++ b/doc/api/lxml.html.rst @@ -70,6 +70,7 @@ lxml.html.usedoctest module .. module:: lxml.html.usedoctest +Doctest module for HTML comparison. Module contents --------------- diff --git a/doc/api/lxml.rst b/doc/api/lxml.rst index d32895dbe..0afb4f0ab 100644 --- a/doc/api/lxml.rst +++ b/doc/api/lxml.rst @@ -70,6 +70,8 @@ lxml.usedoctest module .. module:: lxml.usedoctest +Doctest module for XML comparison. + Module contents --------------- diff --git a/src/lxml/html/defs.py b/src/lxml/html/defs.py index b21a11341..1b3a75b36 100644 --- a/src/lxml/html/defs.py +++ b/src/lxml/html/defs.py @@ -2,9 +2,11 @@ # (probably in a test; this may not match the DTD exactly, but we # should document just how it differs). -# Data taken from http://www.w3.org/TR/html401/index/elements.html -# and http://www.w3.org/community/webed/wiki/HTML/New_HTML5_Elements -# for html5_tags. +""" +Data taken from https://www.w3.org/TR/html401/index/elements.html +and https://www.w3.org/community/webed/wiki/HTML/New_HTML5_Elements +for html5_tags. +""" empty_tags = frozenset([ 'area', 'base', 'basefont', 'br', 'col', 'frame', 'hr', diff --git a/src/lxml/pyclasslookup.py b/src/lxml/pyclasslookup.py index 9e1496dfb..b2062e530 100644 --- a/src/lxml/pyclasslookup.py +++ b/src/lxml/pyclasslookup.py @@ -1,3 +1,3 @@ -# dummy module for backwards compatibility +"""Dummy module for backwards compatibility.""" from lxml.etree import PythonElementClassLookup From 358efda42d5c0b498c7a914d7786fa9f06ea1085 Mon Sep 17 00:00:00 2001 From: scoder Date: Wed, 22 Jul 2020 08:55:14 +0200 Subject: [PATCH 07/12] Include private classes/methods in API documentation. --- doc/api/conf.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/api/conf.py b/doc/api/conf.py index b88ca9375..3bce4ec63 100644 --- a/doc/api/conf.py +++ b/doc/api/conf.py @@ -26,6 +26,10 @@ exclude_patterns = ['_build'] +autodoc_default_options = { + 'private-members': True, +} + # -- Options for HTML output ------------------------------------------------- From fe7bb19cf261376987514e3fe399450af5319a24 Mon Sep 17 00:00:00 2001 From: Chris Mayo Date: Wed, 22 Jul 2020 19:08:14 +0100 Subject: [PATCH 08/12] Include private members not included in __all__ in API documentation --- doc/api/conf.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/doc/api/conf.py b/doc/api/conf.py index 3bce4ec63..8d1b082a2 100644 --- a/doc/api/conf.py +++ b/doc/api/conf.py @@ -26,10 +26,6 @@ exclude_patterns = ['_build'] -autodoc_default_options = { - 'private-members': True, -} - # -- Options for HTML output ------------------------------------------------- @@ -45,6 +41,11 @@ # -- Extension configuration ------------------------------------------------- +autodoc_default_options = { + 'ignore-module-all': True, + 'private-members': True, +} + # -- Options for todo extension ---------------------------------------------- # If true, `todo` and `todoList` produce output, else they produce nothing. From 7c8557e12931c3a9c29464814dff5e1c1d6c2df2 Mon Sep 17 00:00:00 2001 From: Chris Mayo Date: Wed, 22 Jul 2020 19:08:14 +0100 Subject: [PATCH 09/12] Don't include tests in API documentation --- doc/api/index.rst | 1 - doc/api/lxml.tests.rst | 282 ----------------------------------------- 2 files changed, 283 deletions(-) delete mode 100644 doc/api/lxml.tests.rst diff --git a/doc/api/index.rst b/doc/api/index.rst index 8b4b933e8..8661e8cfe 100644 --- a/doc/api/index.rst +++ b/doc/api/index.rst @@ -8,7 +8,6 @@ lxml API Reference lxml lxml.html lxml.isoschematron - lxml.tests Indices and tables diff --git a/doc/api/lxml.tests.rst b/doc/api/lxml.tests.rst deleted file mode 100644 index bb4807e1f..000000000 --- a/doc/api/lxml.tests.rst +++ /dev/null @@ -1,282 +0,0 @@ -lxml.tests -================== - -lxml.tests.common\_imports module ---------------------------------- - -.. automodule:: lxml.tests.common_imports - :members: - :exclude-members: etree - :undoc-members: - :show-inheritance: - -lxml.tests.dummy\_http\_server module -------------------------------------- - -.. automodule:: lxml.tests.dummy_http_server - :members: - :exclude-members: etree - :undoc-members: - :show-inheritance: - -lxml.tests.selftest module --------------------------- - -.. automodule:: lxml.tests.selftest - :members: - :exclude-members: etree - :undoc-members: - :show-inheritance: - -lxml.tests.selftest2 module ---------------------------- - -.. automodule:: lxml.tests.selftest2 - :members: - :exclude-members: etree - :undoc-members: - :show-inheritance: - -lxml.tests.test\_builder module -------------------------------- - -.. automodule:: lxml.tests.test_builder - :members: - :exclude-members: etree - :undoc-members: - :show-inheritance: - -lxml.tests.test\_classlookup module ------------------------------------ - -.. automodule:: lxml.tests.test_classlookup - :members: - :exclude-members: etree - :undoc-members: - :show-inheritance: - -lxml.tests.test\_css module ---------------------------- - -.. automodule:: lxml.tests.test_css - :members: - :exclude-members: etree - :undoc-members: - :show-inheritance: - -lxml.tests.test\_doctestcompare module --------------------------------------- - -.. automodule:: lxml.tests.test_doctestcompare - :members: - :exclude-members: etree - :undoc-members: - :show-inheritance: - -lxml.tests.test\_dtd module ---------------------------- - -.. automodule:: lxml.tests.test_dtd - :members: - :exclude-members: etree - :undoc-members: - :show-inheritance: - -lxml.tests.test\_elementpath module ------------------------------------ - -.. automodule:: lxml.tests.test_elementpath - :members: - :exclude-members: etree - :undoc-members: - :show-inheritance: - -lxml.tests.test\_elementtree module ------------------------------------ - -.. automodule:: lxml.tests.test_elementtree - :members: - :exclude-members: etree - :undoc-members: - :show-inheritance: - -lxml.tests.test\_errors module ------------------------------- - -.. automodule:: lxml.tests.test_errors - :members: - :exclude-members: etree - :undoc-members: - :show-inheritance: - -lxml.tests.test\_etree module ------------------------------ - -.. automodule:: lxml.tests.test_etree - :members: - :exclude-members: etree, ElementInclude - :undoc-members: - :show-inheritance: - -lxml.tests.test\_external\_document module ------------------------------------------- - -.. automodule:: lxml.tests.test_external_document - :members: - :exclude-members: etree - :undoc-members: - :show-inheritance: - -lxml.tests.test\_htmlparser module ----------------------------------- - -.. automodule:: lxml.tests.test_htmlparser - :members: - :exclude-members: etree - :undoc-members: - :show-inheritance: - -lxml.tests.test\_http\_io module --------------------------------- - -.. automodule:: lxml.tests.test_http_io - :members: - :exclude-members: etree - :undoc-members: - :show-inheritance: - -lxml.tests.test\_incremental\_xmlfile module --------------------------------------------- - -.. automodule:: lxml.tests.test_incremental_xmlfile - :members: - :exclude-members: etree - :undoc-members: - :show-inheritance: - -lxml.tests.test\_io module --------------------------- - -.. automodule:: lxml.tests.test_io - :members: - :exclude-members: etree - :undoc-members: - :show-inheritance: - -lxml.tests.test\_isoschematron module -------------------------------------- - -.. automodule:: lxml.tests.test_isoschematron - :members: - :exclude-members: etree - :undoc-members: - :show-inheritance: - -lxml.tests.test\_nsclasses module ---------------------------------- - -.. automodule:: lxml.tests.test_nsclasses - :members: - :exclude-members: etree - :undoc-members: - :show-inheritance: - -lxml.tests.test\_objectify module ---------------------------------- - -.. automodule:: lxml.tests.test_objectify - :members: - :exclude-members: etree - :undoc-members: - :show-inheritance: - -lxml.tests.test\_pyclasslookup module -------------------------------------- - -.. automodule:: lxml.tests.test_pyclasslookup - :members: - :exclude-members: etree - :undoc-members: - :show-inheritance: - -lxml.tests.test\_relaxng module -------------------------------- - -.. automodule:: lxml.tests.test_relaxng - :members: - :exclude-members: etree - :undoc-members: - :show-inheritance: - -lxml.tests.test\_sax module ---------------------------- - -.. automodule:: lxml.tests.test_sax - :members: - :exclude-members: etree - :undoc-members: - :show-inheritance: - -lxml.tests.test\_schematron module ----------------------------------- - -.. automodule:: lxml.tests.test_schematron - :members: - :exclude-members: etree - :undoc-members: - :show-inheritance: - -lxml.tests.test\_threading module ---------------------------------- - -.. automodule:: lxml.tests.test_threading - :members: - :exclude-members: etree - :undoc-members: - :show-inheritance: - -lxml.tests.test\_unicode module -------------------------------- - -.. automodule:: lxml.tests.test_unicode - :members: - :exclude-members: etree - :undoc-members: - :show-inheritance: - -lxml.tests.test\_xmlschema module ---------------------------------- - -.. automodule:: lxml.tests.test_xmlschema - :members: - :exclude-members: etree - :undoc-members: - :show-inheritance: - -lxml.tests.test\_xpathevaluator module --------------------------------------- - -.. automodule:: lxml.tests.test_xpathevaluator - :members: - :exclude-members: etree - :undoc-members: - :show-inheritance: - -lxml.tests.test\_xslt module ----------------------------- - -.. automodule:: lxml.tests.test_xslt - :members: - :exclude-members: etree - :undoc-members: - :show-inheritance: - - -Module contents ---------------- - -.. automodule:: lxml.tests - :members: - :exclude-members: etree - :undoc-members: - :show-inheritance: From e3d1177196a203c087e5501e65bb445c61cfd132 Mon Sep 17 00:00:00 2001 From: Chris Mayo Date: Wed, 22 Jul 2020 19:08:14 +0100 Subject: [PATCH 10/12] Build html documentation in Travis --- .travis.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.travis.yml b/.travis.yml index 54f3da3ec..d9e5aa7c1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -46,6 +46,11 @@ matrix: - python: 3.8 env: STATIC_DEPS=true arch: arm64 + - python: 3.8 + env: + - STATIC_DEPS=false + - EXTRA_DEPS="docutils pygments sphinx sphinx-rtd-theme" + script: make html allow_failures: - python: pypy - python: pypy3 From 37369e2a590a16c540f6d423963f16c8450fba10 Mon Sep 17 00:00:00 2001 From: Chris Mayo Date: Wed, 22 Jul 2020 19:34:18 +0100 Subject: [PATCH 11/12] Revert src/lxml/pyclasslookup.py docstring Partial revert of: 21df98bf ("Ensure all modules have some documentation", 2020-07-21) --- src/lxml/pyclasslookup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lxml/pyclasslookup.py b/src/lxml/pyclasslookup.py index b2062e530..9e1496dfb 100644 --- a/src/lxml/pyclasslookup.py +++ b/src/lxml/pyclasslookup.py @@ -1,3 +1,3 @@ -"""Dummy module for backwards compatibility.""" +# dummy module for backwards compatibility from lxml.etree import PythonElementClassLookup From 774af8b4fc2598c7eca0767474c7edaf85835957 Mon Sep 17 00:00:00 2001 From: Chris Mayo Date: Wed, 22 Jul 2020 19:34:18 +0100 Subject: [PATCH 12/12] Remove lxml.pyclasslookup from API documentation --- doc/api/lxml.rst | 8 -------- 1 file changed, 8 deletions(-) diff --git a/doc/api/lxml.rst b/doc/api/lxml.rst index 0afb4f0ab..e4a75e18f 100644 --- a/doc/api/lxml.rst +++ b/doc/api/lxml.rst @@ -49,14 +49,6 @@ lxml.objectify module :undoc-members: :show-inheritance: -lxml.pyclasslookup module -------------------------- - -.. automodule:: lxml.pyclasslookup - :members: - :undoc-members: - :show-inheritance: - lxml.sax module ---------------