summaryrefslogtreecommitdiff
path: root/rdflib/plugins/parsers/notation3.py
Commit message (Collapse)AuthorAgeFilesLines
* fix: eliminate bare `except:` (#2350)Iwan Aucamp2023-04-121-2/+2
| | | | | | | | | | | Replace bare `except:` with `except Exception`, there are some cases where it can be narrowed further, but this is already an improvement over the current situation. This is somewhat 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)]. But it also is just the right thing to do as bare exceptions can cause problems.
* refactor: eliminate inheritance from object (#2339)Iwan Aucamp2023-04-101-2/+2
| | | | | 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.
* build(deps-dev): bump black from 22.12.0 to 23.1.0 (#2248)dependabot[bot]2023-03-111-3/+0
|
* feat: add parser type hints (#2232)Iwan Aucamp2023-03-051-93/+174
| | | | | | | | | | | | | Add type hints to: - `rdflib/parser.py` - `rdflib/plugins/parser/*.py` - some JSON-LD utils - `rdflib/exceptions.py`. This is mainly because the work I'm doing to fix <https://github.com/RDFLib/rdflib/issues/1844> is touching some of this parser stuff and the type hints are useful to avoid mistakes. No runtime changes are included in this PR.
* docs: fix sphinx nitpicky issues (#2036)Iwan Aucamp2022-07-181-0/+3
| | | | | | | | | | | | | Enable nitpicky mode for Sphinx and fix all warnings and errors that occur when running with nitpicky enabled. Other changes: - Add a tox environment for building docs (-docs). This is so we can test building docs on various versions of python as there seems to be some differences in warnings between different versions. This tox environment is enabled for linux CI builds. - Change readthedocs to use python 3.9 as earlier versions do not handle `@typing.overload` with type aliases. - Fixes https://github.com/RDFLib/rdflib/issues/1878
* Remove testing and debug code from rdflibIwan Aucamp2022-04-191-31/+0
| | | | | | | | | | | | | | 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.
* Add isort (#1689)eggplants2022-02-211-10/+8
| | | | | | | | | | | | | | | | | | | | | | | | * add: isort configure file * fix: isort $ isort . * add: isort to dev deps * add: isort to CI * fix: move .isort.cfg into setup.cfg * fix: re-formatted * fix: isort target path * Use pre-commit to check isort pre-commit CI can auto fix this, and this way we can idenpendently evaluate the formatting of the code from the validity of the code. Co-authored-by: Iwan Aucamp <aucampia@gmail.com>
* Add typing for parsersIwan Aucamp2021-12-291-84/+116
| | | | This changeset include no runtime changes in rdflib.
* Merge branch 'RDFLib:master' into fix-issue1216-join-errorGraham Higgins2021-12-281-3/+3
|\
| * Fix `self.line` typos in call to BadSyntax.Graham Higgins2021-12-241-3/+3
| | | | | | | | Fix for issue #821 Invalid URI crashes without BadSyntax error
* | Revert error-raising change, enable Exception to be raised.Graham Higgins2021-12-271-1/+1
|/
* style fixes onlynicholascar2021-12-161-2/+1
|
* more Flak8 improvementsnicholascar2021-12-111-10/+1
|
* backing all filesnicholascar2021-12-071-19/+19
|
* Flak8 improvementsnicholascar2021-12-071-25/+21
|
* blacked parsers & serializersnicholascar2021-12-071-18/+18
|
* Flake8 style improvementsnicholascar2021-12-071-18/+18
|
* Migrate from nosetest to pytestIwan Aucamp2021-10-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch replace all uses of nose with pytest. It also includes a pytest plugin for creating EARL reports for tests with a `rdf_test_uri` parameter. Some caveats: - HTML report directory is now htmlcov instead of coverage - There is some warning related to the EARL reporting plugin which I can't quite figure out: ``` .venv/lib64/python3.7/site-packages/_pytest/config/__init__.py:676 /home/iwana/sw/d/github.com/iafork/rdflib/.venv/lib64/python3.7/site-packages/_pytest/config/__init__.py:676: PytestAssertRewriteWarning: Module already imported so cannot be rewritten: test.earl self.import_plugin(import_spec) ``` This is not causing any problems as far as I can tell, but still annoying. - python setup.py test won't work anymore, I can make it work but this is not advised by pytest: https://github.com/pytest-dev/pytest-runner/#deprecation-notice - run_test.py is still there but it's not really referenced anymore from anywhere and the options it accepts are completely different as it's options were based on nose. I would say it should be removed entirely but for now it is basically just a wrapper around pytest that basically does nothing. - Removed references to test attributes as currently they are not being used anywhere anyway, I guess we can add them back if there is some use for them later. - A lot of tests are still marked to skip when really they should be marked with xfail. This is also affecting the RDFT test manifests and result in reports saying tests are skipped when really we know they will fail and they are only skipped for this reason. But there is no change here from before, and pytest makes it easier to dynamically do expected failures. Special thanks to Wes Turner for his advice and inputs on this process.
* Fix typos discovered by codespellChristian Clauss2021-10-141-11/+11
|
* Fix mypy type errors and add mypy to .drone.ymlIwan Aucamp2021-09-101-1/+1
| | | | | | | | | | | | | | | | | | | | | Fixes #1311 Add `mypy` to .drone.yml and fix type errors that come up. Not type checking examples or tests. Other changes: - fix return value for `Graph.serialize` (refs #1394) - remove default value for `rdflib.plugins.sparql.algebra.translateAlgebra` (refs #1322) - add .dockerignore to reduce context size and make docker quicker to run. - add .flake8 config to ignore line length as black is managing formatting. - add mypy to docker-compose, makefile and tox.ini - fix the way csv2rdf is invoked to ensure that the right code gets executed.
* blacked everything6.0.0Nicholas Car2021-07-201-13/+10
|
* fix docc build warningsNicholas Car2021-07-151-0/+1
|
* Speedup tok.Remi Chateauneu2021-03-031-6/+5
|
* Use set instead of string or list for set of charsNatanael Arndt2021-03-011-12/+12
|
* Use lists instead of strings for set of charsNatanael Arndt2021-03-011-14/+15
|
* Cleaner code.Remi Chateauneu2021-03-011-1/+1
|
* Speedup.Remi Chateauneu2021-02-281-125/+139
|
* docs: fix simple typo, yeild -> yieldTim Gates2020-12-311-1/+1
| | | | | | There is a small typo in rdflib/plugins/parsers/notation3.py. Should read `yield` rather than `yeild`.
* Fix n3 parser exceptions import (fixes all failing N3 tests)Ashley Sommer2020-09-181-1/+1
|
* Change assert tests in the N3 parser constructor, to instead be if-raise ↵Ashley Sommer2020-09-181-6/+16
| | | | | | statements with meaningful error messages Re-blacked notation3.py
* Merge pull request #1142 from Tpt/#1141Ashley Sommer2020-09-181-2/+3
|\ | | | | N3 parser: do not create formulas if the Turtle mode is activated
| * Makes sure that N3 parser generates unique blank node IDs when there is no ↵Tpt2020-08-141-1/+2
| | | | | | | | formula support
| * N3 parser: do not create formulas if the Turtle mode is activatedTpt2020-08-141-1/+1
| | | | | | | | Closes #1141
* | re-run blackAshley Sommer2020-08-271-1/+1
| |
* | Merge remote-tracking branch 'origin/master' into t0b3_masterAshley Sommer2020-08-271-48/+54
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | # Conflicts: # rdflib/namespace.py # rdflib/parser.py # rdflib/plugins/memory.py # rdflib/plugins/parsers/ntriples.py # test/test_iomemory.py
| * \ Merge pull request #1145 from ashleysommer/fix_1144Nicholas Car2020-08-231-2/+5
| |\ \ | | | | | | | | Make parsers CharacterStream aware
| | * | Merged two Ntriples parser filesAshley Sommer2020-08-191-2/+5
| | |/ | | | | | | | | | | | | | | | | | | Changed name of NTriplesParser to W3CNTriplesParser, it is the legacy parser Populate CharacterStream attr on several types of rdflib InputSource, to provide unicode text stream, in addition to ByteStream Add support to N3, Trig, NTriples, NQuads parsers to use the CharacterStream instead of the ByteStream where possible Reduces many useless string->bytes->string conversions in parsers.
| * | More Black formatting changesAshley Sommer2020-08-191-46/+49
| |/
* | 2to3 whole sourcebaset0b32020-06-221-5/+2
|/ | | | Signed-off-by: t0b3 <thomas.bettler@gmail.com>
* changes for flake8Nicholas Car2020-05-171-68/+49
|
* blacked all python filesNicholas Car2020-05-161-413/+458
|
* removal of all uses of package sixNicholas Car2020-05-161-23/+14
|
* RF: Simplify exponent regex by separating mantissa from exponentChris Markiewicz2020-04-171-3/+1
|
* Update rdflib/plugins/parsers/notation3.pyNatanael Arndt2020-04-171-2/+2
| | | Co-Authored-By: Chris Markiewicz <effigies@gmail.com>
* Fix exponent syntax with leading dot.Natanael Arndt2020-04-171-1/+1
|
* Yet another...hsolbrig2018-01-041-5/+3
| | | | | Apologies - haven't been able to run all of the tests in pycharm, so I'm kind of depending on travis to figure this out
* Another correctionhsolbrig2018-01-041-3/+6
| | | | Apologies for being so sloppy...
* Correction - return the first of the list, not the lasthsolbrig2018-01-041-2/+2
|
* Change notation3 list realization to non-recursive function.hsolbrig2018-01-041-7/+14
| | | | Fixes issue #804
* Adds escaped single quote to literal parserhsolbrig2017-04-191-2/+2
|