Skip to content

Commit bf869d9

Browse files
committed
Fix sphinx warnings (issue #45)
- Set autodoc_typehints = 'none' in conf.py (for the moment, type aliases expansion is huge, reconsider for the v3.0.0 after a refactoring of type hints)
1 parent c3a34af commit bf869d9

File tree

5 files changed

+20
-9
lines changed

5 files changed

+20
-9
lines changed

doc/conf.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,13 @@
4848
'sphinx.ext.doctest',
4949
]
5050

51-
# Option for autodoc: do not add module name as prefix to classes or functions.
52-
add_module_names = False
51+
# Options for autodoc
52+
add_module_names = False # do not add module name as prefix to classes or functions.
53+
autodoc_typehints = 'none' # do not add type annotations
54+
55+
nitpick_ignore = [
56+
('py:class', 'XMLSchemaProxy')
57+
]
5358

5459
# Add any paths that contain templates here, relative to this directory.
5560
templates_path = ['_templates']
@@ -68,7 +73,8 @@
6873
#
6974
# This is also used if you do content translation via gettext catalogs.
7075
# Usually you set "language" from the command line for these cases.
71-
language = None
76+
# language = None
77+
language = 'en' # required by Sphinx v5.0.0
7278

7379
# List of patterns, relative to source directory, that match files and
7480
# directories to ignore when looking for source files.

doc/xpath_api.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ XML Schema proxy
9090

9191
The XPath 2.0 parser can be interfaced with an XML Schema processor through a schema proxy.
9292
An :class:`XMLSchemaProxy` class is defined for interfacing schemas created with the *xmlschema* package.
93-
This class is based on an abstract class :class:`AbstractSchemaProxy`, that can be used for
93+
This class is based on an abstract class :class:`elementpath.AbstractSchemaProxy`, that can be used for
9494
implementing concrete interfaces to other types of XML Schema processors.
9595

9696
.. autoclass:: elementpath.AbstractSchemaProxy
@@ -110,7 +110,10 @@ implementing concrete interfaces to other types of XML Schema processors.
110110
XPath nodes
111111
===========
112112

113-
XPath nodes are processed using a set of classes derived from :class:`XPathNode`:
113+
XPath nodes are processed using a set of classes derived from
114+
:class:`elementpath.XPathNode`:
115+
116+
.. autoclass:: elementpath.XPathNode
114117

115118
.. autoclass:: elementpath.AttributeNode
116119
.. autoclass:: elementpath.TextNode
@@ -133,7 +136,7 @@ Exception classes
133136
.. autoexception:: elementpath.RegexError
134137

135138
There are also other exceptions, multiple derived from the base exception
136-
:class:`ElementPathError` and Python built-in exceptions:
139+
:class:`elementpath.ElementPathError` and Python built-in exceptions:
137140

138141
.. autoexception:: elementpath.ElementPathKeyError
139142
.. autoexception:: elementpath.ElementPathLocaleError

elementpath/xpath30/xpath30_parser.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ class XPath30Parser(XPath2Parser):
3030
arguments, but the *strict* option is ignored because XPath 3.0+ has braced
3131
URI literals and the expanded name syntax is not compatible.
3232
33-
:param args: the same positional arguments of class :class:`XPath2Parser`.
33+
:param args: the same positional arguments of class :class:`elementpath.XPath2Parser`.
3434
:param decimal_formats: a mapping with statically known decimal formats.
35-
:param kwargs: the same keyword arguments of class :class:`XPath2Parser`.
35+
:param kwargs: the same keyword arguments of class :class:`elementpath.XPath2Parser`.
3636
"""
3737
version = '3.0'
3838

elementpath/xpath_selectors.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
# @author Davide Brunato <[email protected]>
99
#
1010
from typing import TYPE_CHECKING, Any, Dict, Optional, Iterator, Union, Type
11+
import typing
1112

1213
from .namespaces import NamespacesType
1314
from .xpath_context import ContextRootType, XPathContext
@@ -17,7 +18,7 @@
1718
from .xpath1 import XPath1Parser
1819
from .xpath30 import XPath30Parser
1920

20-
ParserType = Union[Type[XPath1Parser], Type[XPath2Parser], Type[XPath30Parser]]
21+
ParserType = typing.Union[Type[XPath1Parser], Type[XPath2Parser], Type[XPath30Parser]]
2122
else:
2223
ParserType = XPath2Parser
2324

tox.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ commands =
2929
make -C doc html
3030
make -C doc latexpdf
3131
make -C doc doctest
32+
sphinx-build -n -T -b man doc build/sphinx/man
3233

3334
[flake8]
3435
max-line-length = 100

0 commit comments

Comments
 (0)