| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Eliminate some occurrences of the following flake8 errors in tests:
* E265 block comment should start with '# '
* E266 too many leading '#' for block comment
* E402 module level import not at top of file
* E712 comparison to False should be 'if cond is False:' or 'if not cond:'
* E712 comparison to True should be 'if cond is True:' or 'if cond:'
* E722 do not use bare 'except'
* F401 ... imported but unused
* F403 ... used; unable to detect undefined names
* F405 ... may be undefined, or defined from star imports: ...
* F541 f-string is missing placeholders
* F841 local variable 'result' is assigned to but never used
* N806 variable 'TEST_DIR' in function should be lowercase
This is pursuant to eliminating
[flakeheaven](https://github.com/flakeheaven/flakeheaven), as it no longer
supports the latest version of flake8
[[ref](https://github.com/flakeheaven/flakeheaven/issues/132)].
|
| |
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
The namespaces bound by default by `rdflib.graph.Graph` and
`rdflib.namespace.NamespaceManager` was reduced in version 6.2.0 of RDFLib,
however, this also would cause code that worked with 6.1.1 to break, so this
constituted a breaking change. This change restores the previous behaviour,
binding the same namespaces as was bound in 6.1.1.
To bind a reduced set of namespaces, the `bind_namespaces` parameter of
`rdflib.graph.Graph` or `rdflib.namespace.NamespaceManager` can be used.
- Closes <https://github.com/RDFLib/rdflib/issues/2103>.
|
| |
|
|
|
|
|
|
|
|
| |
`Context.to_dict` is used in JSON-LD serialization, but it was not implemented.
This change adds the method.
- Closes <https://github.com/RDFLib/rdflib/issues/2138>.
---------
Co-authored-by: Marc-Antoine Parent <maparent@acm.org>
|
| |
|
|
| |
This changes the test the code to avoid deprecation warnings that
occur. Mostly related to changes in python threading and pytest.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* build(deps-dev): bump mypy from 0.991 to 1.0.1
Bumps [mypy](https://github.com/python/mypy) from 0.991 to 1.0.1.
- [Release notes](https://github.com/python/mypy/releases)
- [Commits](https://github.com/python/mypy/compare/v0.991...v1.0.1)
---
updated-dependencies:
- dependency-name: mypy
dependency-type: direct:development
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com>
* fix type errors
---------
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Iwan Aucamp <aucampia@gmail.com>
|
| |
|
|
|
|
| |
New mypy version is reporting new errors.
In the long run we need to switch to poetry so we can better control
this.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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 <https://github.com/RDFLib/rdflib/pull/1850>.
This PR does not change runtime behaviour.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(#2065)
Change `{Graph,Result}.serialize` to only handle string destinations as URIs if
the schema is `file` and to treat it as operating system paths in all
other cases.
This is for the following reasons:
- `Result.serialize` was treating URI paths as OS paths which only works
for some cases, for special charachters and percentage encoding it
does not work.
- Many valid Unix and Windows paths parse using `urlparse` and have no netloc, e.g. `C:\some\path`
and `some:/path`, however they should be treated as paths and not as URIs.
- `Graph` and `Result` should behave consistently.
Some caveats in this change:
- non-file URIs will now be treated as OS paths which may result in
slightly confusing error messages, such as
`FileNotFoundError: [Errno 2] No such file or directory: 'http://example.com/'`
if http://example.com/ is passed.
- some valid file URIs (e.g. `file:/path/to/file` from https://datatracker.ietf.org/doc/html/rfc8089)
are also valid Posix paths but will be treated as file-URIs instead of
Posix paths. For `Graph.serialize` this ambiguity can be avoided by
using `pathlib.Path`, but for `Result.serialize` there is currently no
way to avoid it, though I will work on https://github.com/RDFLib/rdflib/issues/1834
soon and in that provide a way to avoid the ambiguity there also.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
sonarcloud detected a bug: “Remove 1 unexpected arguments; 'join' expects 1 positional arguments.” in xmlwriter:
```py
return ":".join(pre, uri[len(ns) :])
```
Added containing brackets apparently omitted by original author.
```py
return ":".join([pre, uri[len(ns) :]])
```
Added test for surety, took the opportunity of adding two tests to take coverage of `xmlwriter` to 100%.
|
| |
|
|
| |
for more information, see https://pre-commit.ci
|
| |
|
|
| |
for more information, see https://pre-commit.ci
|
| |
|
|
|
|
|
|
|
|
| |
This patch removes unused imports in test code. This is mainly to remove
the potential snag for flake8/flakeheaven.
The actual cleanup was done with `pycln --all test`.
Also:
- Remove superflous `pass` statements.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch fixes two issues with the N3 serializer:
- The N3 serializer incorrectly considered a subject as already
serialized if it has been serialized inside a quoted graph.
- The N3 serializer does not consider that the predicate of
a triple can also be a graph.
Other changes included in this patch:
- Changed `test.testutils.GraphHelper` to support nested/quoted graphs.
- Moved the tests from `test/test_n3_formula.py` into
`test/test_serializers/test_serializer_n3.py`.
- Include positive syntax tests from the N3 test suite that is smaller
than 1024KB and that is not using new N3 syntax into round trip tests.
This is mainly to check that there is no regressions after the changes
made.
Fixes:
- https://github.com/RDFLib/rdflib/issues/1807
- https://github.com/RDFLib/rdflib/issues/1701
|
| |
|
|
| |
This is to verify that all serialization options work for all graphs.
|
| |
|
|
|
|
|
| |
This patch moves all test utility modules into `test/utils/` and the
tests for these modules into `test/utils/test/`.
This is to make test utilities more organized and in preparation for
adding more test utilities related to test suites.
|
| |
|
|
|
|
| |
This patch converts `test_serializer.py` to fairly idiomatic pytest in
prepration for parameterized tests that I want to add to cover more
cases.
|
| |\ |
|
| | |
| |
| |
| | |
for more information, see https://pre-commit.ci
|
| |/ |
|
| |
|
|
| |
for more information, see https://pre-commit.ci
|
| | |
|
| | |
|
| |
|
|
| |
Preparatory work for dataset-rework, eases review
|
| |
|