diff options
| author | Iwan Aucamp <aucampia@gmail.com> | 2022-07-30 23:18:30 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-30 23:18:30 +0200 |
| commit | 283bef2922b713d3d6483f13395c02a1c0713fcf (patch) | |
| tree | 746492d946d2b0eef61d87fa96dfdd9228b698d7 /docs | |
| parent | 1d5f3e7bd2d0be1db95e8f19c791a9bd06037bd9 (diff) | |
| download | rdflib-283bef2922b713d3d6483f13395c02a1c0713fcf.tar.gz | |
feat: add type hints for `rdflib.store` and `rdflib.plugins.stores` (#2057)
Add type hints and aliases for `rdflib.store` and
`rdflib.plugins.stores` and also add a couple of more type hints and
aliases to `rdflib.graph`.
This PR contains no runtime changes.
Other changes:
- Changed some imports to be more specific (e.g. `import from
rdflib.graph` instead of `import from rdflib`). This is to reduce
the probability of circular imports.
- Ignore `E231` (missing whitespace after ',') in flake8 as black is
managing the whitespaces and seems to be bumping heads with flake8
with spaces after `,` sometimes.
- Install `berkeleydb-stubs` when doing extensive testing with tox.
- Added `devtools/diffrtpy.py` which is a script that can be used with
`git difftool` to generate compact diffs for python code. This should
make it a lot easier to review PRs that change type hints to verify
that they don't have a runtime impact.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/conf.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/docs/conf.py b/docs/conf.py index 044a175f..3c9965a2 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -267,12 +267,16 @@ nitpick_ignore = [ # sphinx-autodoc-typehints has some issues with TypeVars. # https://github.com/tox-dev/sphinx-autodoc-typehints/issues/39 ("py:class", "rdflib.plugin.PluginT"), + # sphinx-autodoc-typehints does not like generic parmaeters in inheritance it seems + ("py:class", "Identifier"), # These are related to pyparsing. ("py:class", "Diagnostics"), ("py:class", "ParseAction"), ("py:class", "ParseFailAction"), ("py:class", "pyparsing.core.TokenConverter"), ("py:class", "pyparsing.results.ParseResults"), + # These are related to BerkeleyDB + ("py:class", "db.DBEnv"), ] if sys.version_info < (3, 9): @@ -283,6 +287,8 @@ if sys.version_info < (3, 9): ("py:class", "_ObjectType"), ("py:class", "_PredicateType"), ("py:class", "_SubjectType"), + ("py:class", "_ContextType"), + ("py:class", "_ContextIdentifierType"), ("py:class", "TextIO"), ] ) |
