Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into restore-geosparql-d…
Browse files Browse the repository at this point in the history
…efined-namespace
  • Loading branch information
Graham Higgins committed Dec 28, 2021
2 parents 701e721 + 26ad286 commit bf451c3
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 24 deletions.
10 changes: 4 additions & 6 deletions .drone.yml
Expand Up @@ -24,6 +24,7 @@ steps:
- apt-get update && apt-get install -y openjdk-11-jdk-headless
- pip install --default-timeout 60 -r requirements.txt
- pip install --default-timeout 60 -r requirements.dev.txt
- pip install --default-timeout 60 -r requirements.dev-extra.txt
- pip install --default-timeout 60 coveralls && export HAS_COVERALLS=1
- python setup.py install
- black --config black.toml --check ./rdflib || true
Expand All @@ -44,13 +45,12 @@ steps:
- name: test
image: python:3.8
commands:
- apt-get update && apt-get install -y openjdk-11-jdk-headless
- pip install --default-timeout 60 -r requirements.txt
- pip install --default-timeout 60 -r requirements.dev.txt
- python setup.py install
- black --config black.toml --check ./rdflib || true
- flake8 --exit-zero rdflib
- ./with-fuseki.sh pytest -ra
- pytest -ra

---
kind: pipeline
Expand All @@ -64,13 +64,12 @@ steps:
- name: test
image: python:3.9
commands:
- apt-get update && apt-get install -y openjdk-11-jdk-headless
- pip install --default-timeout 60 -r requirements.txt
- pip install --default-timeout 60 -r requirements.dev.txt
- python setup.py install
- black --config black.toml --check ./rdflib || true
- flake8 --exit-zero rdflib
- ./with-fuseki.sh pytest -ra
- pytest -ra

---
kind: pipeline
Expand All @@ -84,10 +83,9 @@ steps:
- name: test
image: python:3.10
commands:
- apt-get update && apt-get install -y openjdk-11-jdk-headless
- pip install --default-timeout 60 -r requirements.txt
- pip install --default-timeout 60 -r requirements.dev.txt
- python setup.py install
- black --config black.toml --check ./rdflib | true
- flake8 --exit-zero rdflib
- ./with-fuseki.sh pytest -ra
- pytest -ra
34 changes: 22 additions & 12 deletions .github/workflows/validate.yaml
Expand Up @@ -16,17 +16,23 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9"]
python-version: ["3.7", "3.8", "3.9", "3.10"]
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- {
python-version: "3.7",
os: ubuntu-latest,
extensive-tests: true,
}
steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- uses: actions/setup-java@v2
if: ${{ matrix.extensive-tests }}
with:
distribution: "temurin"
java-version: "17"
Expand Down Expand Up @@ -55,8 +61,13 @@ jobs:
- name: Install dependencies
shell: bash
run: |
# bash .travis.fuseki_install_optional.sh
pip install --default-timeout 60 -r requirements.txt
pip install --default-timeout 60 -r requirements.dev.txt
python setup.py install
- name: Install extra dev dependencies
if: ${{ matrix.extensive-tests }}
shell: bash
run: |
if [ "${{ matrix.os }}" == "ubuntu-latest" ]
then
sudo apt-get install -y libdb-dev
Expand All @@ -65,18 +76,17 @@ jobs:
brew install berkeley-db@4
export BERKELEYDB_DIR=$(brew --prefix berkeley-db@4)
fi
pip install --default-timeout 60 -r requirements.dev.txt
pip install networkx
python setup.py install
pip install --default-timeout 60 -r requirements.dev-extra.txt
- name: Validate
shell: bash
run: |
test_harness=()
if "${{ matrix.extensive-tests || false }}" && [ "${{ matrix.os }}" != "windows-latest" ]
then
1>&2 echo "Running with fuseki"
test_harness+="./with-fuseki.sh"
fi
black --config black.toml --check ./rdflib || true
flake8 --exit-zero rdflib
mypy --show-error-context --show-error-codes
if [ "${{ matrix.os }}" == "windows-latest" ]
then
pytest -ra --cov
else
./with-fuseki.sh pytest -ra --cov
fi
"${test_harness[@]}" pytest -ra --cov
15 changes: 13 additions & 2 deletions docs/developers.rst
Expand Up @@ -44,17 +44,28 @@ Running tests

To run RDFLib's test suite with `pytest <https://docs.pytest.org/en/latest/>`_:

.. code-block:: bash
.. code-block:: console
$ pip install -r requirements.txt -r requirements.dev.txt
$ pytest
Specific tests can be run by file name. For example:

.. code-block:: bash
.. code-block:: console
$ pytest test/test_graph.py
For more extensive tests, including tests for the `berkleydb
<https://www.oracle.com/database/technologies/related/berkeleydb.html>`_
backend, install the requirements from ``requirements.dev-extra.txt`` before
executing the tests.

.. code-block:: console
$ pip install -r requirements.txt -r requirements.dev.txt
$ pip install -r requirements.dev-extra.txt
$ pytest
Writing tests
~~~~~~~~~~~~~

Expand Down
6 changes: 3 additions & 3 deletions rdflib/plugins/parsers/notation3.py
Expand Up @@ -1362,7 +1362,7 @@ def qname(self, argstr, i, res):
if c not in escapeChars:
raise BadSyntax(
self._thisDoc,
self.line,
self.lines,
argstr,
i,
"illegal escape " + c,
Expand All @@ -1374,7 +1374,7 @@ def qname(self, argstr, i, res):
):
raise BadSyntax(
self._thisDoc,
self.line,
self.lines,
argstr,
i,
"illegal hex escape " + c,
Expand All @@ -1386,7 +1386,7 @@ def qname(self, argstr, i, res):

if lastslash:
raise BadSyntax(
self._thisDoc, self.line, argstr, i, "qname cannot end with \\"
self._thisDoc, self.lines, argstr, i, "qname cannot end with \\"
)

if argstr[i - 1] == ".":
Expand Down
2 changes: 2 additions & 0 deletions requirements.dev-extra.txt
@@ -0,0 +1,2 @@
berkeleydb
networkx
1 change: 0 additions & 1 deletion requirements.dev.txt
@@ -1,4 +1,3 @@
berkeleydb; platform_system != "Windows"
black==21.9b0
coverage
doctest-ignore-unicode==0.1.2
Expand Down

0 comments on commit bf451c3

Please sign in to comment.