Skip to content

Commit

Permalink
feat: Add type hints to rdflib.graph
Browse files Browse the repository at this point in the history
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 <#1850>.
  • Loading branch information
aucampia committed Aug 14, 2022
1 parent a39d143 commit 87fc03a
Show file tree
Hide file tree
Showing 11 changed files with 680 additions and 356 deletions.
19 changes: 15 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ def find_version(filename):
("py:class", "importlib.metadata.EntryPoint"),
("py:class", "xml.dom.minidom.Document"),
("py:class", "xml.dom.minidom.DocumentFragment"),
("py:class", "isodate.duration.Duration"),
# sphinx-autodoc-typehints has some issues with TypeVars.
# https://github.com/tox-dev/sphinx-autodoc-typehints/issues/39
("py:class", "rdflib.plugin.PluginT"),
Expand All @@ -282,13 +283,23 @@ def find_version(filename):
if sys.version_info < (3, 9):
nitpick_ignore.extend(
[
("py:class", "_TriplePatternType"),
("py:class", "_TripleType"),
("py:class", "_ContextIdentifierType"),
("py:class", "_ContextType"),
("py:class", "_GraphT"),
("py:class", "_NamespaceSetString"),
("py:class", "_ObjectType"),
("py:class", "_PredicateType"),
("py:class", "_QuadSelectorType"),
("py:class", "_SubjectType"),
("py:class", "_ContextType"),
("py:class", "_ContextIdentifierType"),
("py:class", "_TripleOrPathTripleType"),
("py:class", "_TripleOrQuadPathPatternType"),
("py:class", "_TripleOrQuadPatternType"),
("py:class", "_TriplePathPatternType"),
("py:class", "_TriplePathType"),
("py:class", "_TriplePatternType"),
("py:class", "_TripleSelectorType"),
("py:class", "_TripleType"),
("py:class", "_TripleOrTriplePathType"),
("py:class", "TextIO"),
]
)
Expand Down

0 comments on commit 87fc03a

Please sign in to comment.