| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
This change removes the redundant inheritance from `object` (i.e. `class
Foo(object): pass`) that is no longer needed in Python 3 and is a relic from
Python 2.
|
|
|
|
|
|
|
| |
This change narrows import so that things are imported from the Python module
where they are defined instead of importing them from a module that re-exports
them, e.g. change import of `Graph` to import from the `rdflib.graph` module
instead of from the `rdflib` module. This helps avoid problems with circular
imports.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A bit of a roundabout reason why this matters now, but basically:
I want to add examples for securing RDFLib with `sys.addaudithook`
and `urllib.request.install_opener`. I also want to be sure examples
are actually valid, and runnable, so I was adding static analysis
and simple execution of examples to our CI.
During this, I noticed that examples use `initBindings` with
`Dict[str,...]`, which was not valid according to mypy, but then after
some investigation I realized the type hints in some places were too
strict.
So the main impetus for this is actually to relax the type hints in
`rdflib.graph`, but to ensure this is valid I'm adding a bunch of type
hints I had saved up to `rdflib.plugins.sparql`.
Even though this PR looks big, it has no runtime changes.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Here, adding type-hints to some of the SPARQL parser plugin code.
Includes a couple of small consequent changes:
1. Minor refactor of `prettify_parsetree()`, separating the public-facing callable from the internal code that does not need to be public-facing. That allows the public-facing callable to have more informative and restrictive type-hints for its arguments.
2. Added some test-coverage for `expandUnicodeEscapes()` - initially for my own understanding, but seems useful to leave it in place since I didn't see test-coverage for that function.
There should be no backwards-incompatible changes in this PR - at least, not intentionally.
---------
Co-authored-by: Iwan Aucamp <aucampia@gmail.com>
|
|
|
| |
`rdflib.plugins.sparql.parserutils.plist` has no good purpose.
|
|
|
|
|
|
|
|
|
| |
This adds typing to `rdflib/plugins/sparql/algebra.py`
and `rdflib/plugins/sparql/parserutils.py`.
This is mainly being done to help detect issues in the new PRs that were
recently opened that relate to SPARQL.
This patch contain no runtime changes.
|
|
|
|
|
|
|
| |
These will eventually come up once `flakeheaven` baseline expires.
The actual problems should be fixed in conjunction with tests.
Only fixes are related to unused imports.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch removes code from `rdflib/` that does not seem like it belongs
in `rdflib/`, most of it is related to doctest, some of it belongs in
`test/` and was moved to `test/test_misc/test_collection.py`, and yet
more of it seems to just be there for debugging purposes, though it
would possibly be better to put that in a separate place if it is needed
again or to debug using tests if possible.
Other changes:
- Removed an invocation of `rdflib.util.test` from `test_util.py`. This
seems like an attempt to invoke doctest however pytest takes care of
that so this is not needed.
|
|
|
|
| |
for more information, see https://pre-commit.ci
|
| |
|
|
|
|
|
|
| |
This works for both pyparsing 2 and 3.
Fixes #1370
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
opinions is mainly: no to long lines, but not at any cost.
notation3.py crashses autopep :D
Also rdflib/__init__.py gets completely broken
|
| |
|
| |
|
|
|
|
| |
helper method to actually look at parsetrees containing CompValues, dicts and lists
|
|
|
|
|
|
|
|
| |
This changes initBinding handling from adding values in the context
object, to actually changing the query algebra and inserting a values
clause in the right place.
This also adds a bunch of tests.
|
|
|