Skip to content

Commit 87fc03a

Browse files
committed
feat: Add type hints to rdflib.graph
More or less complete type hints for the rdflib.graph module. Other changes: - Improved/simplified type hints in `rdflib.store` and store plugins. - Add type ignores for various type errors that occur with the type hints. This is split-off from <RDFLib#1850>.
1 parent a39d143 commit 87fc03a

File tree

11 files changed

+680
-356
lines changed

11 files changed

+680
-356
lines changed

docs/conf.py

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ def find_version(filename):
264264
("py:class", "importlib.metadata.EntryPoint"),
265265
("py:class", "xml.dom.minidom.Document"),
266266
("py:class", "xml.dom.minidom.DocumentFragment"),
267+
("py:class", "isodate.duration.Duration"),
267268
# sphinx-autodoc-typehints has some issues with TypeVars.
268269
# https://github.com/tox-dev/sphinx-autodoc-typehints/issues/39
269270
("py:class", "rdflib.plugin.PluginT"),
@@ -282,13 +283,23 @@ def find_version(filename):
282283
if sys.version_info < (3, 9):
283284
nitpick_ignore.extend(
284285
[
285-
("py:class", "_TriplePatternType"),
286-
("py:class", "_TripleType"),
286+
("py:class", "_ContextIdentifierType"),
287+
("py:class", "_ContextType"),
288+
("py:class", "_GraphT"),
289+
("py:class", "_NamespaceSetString"),
287290
("py:class", "_ObjectType"),
288291
("py:class", "_PredicateType"),
292+
("py:class", "_QuadSelectorType"),
289293
("py:class", "_SubjectType"),
290-
("py:class", "_ContextType"),
291-
("py:class", "_ContextIdentifierType"),
294+
("py:class", "_TripleOrPathTripleType"),
295+
("py:class", "_TripleOrQuadPathPatternType"),
296+
("py:class", "_TripleOrQuadPatternType"),
297+
("py:class", "_TriplePathPatternType"),
298+
("py:class", "_TriplePathType"),
299+
("py:class", "_TriplePatternType"),
300+
("py:class", "_TripleSelectorType"),
301+
("py:class", "_TripleType"),
302+
("py:class", "_TripleOrTriplePathType"),
292303
("py:class", "TextIO"),
293304
]
294305
)

0 commit comments

Comments
 (0)