Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.7 for travis #864

Merged
merged 2 commits into from
Oct 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ python:
- 3.5
- 3.6

matrix:
include:
- python: 3.7
dist: xenial
sudo: true

before_install:
- pip install -U setuptools pip # seems travis comes with a too old setuptools for html5lib
- bash .travis.fuseki_install_optional.sh
Expand Down
2 changes: 1 addition & 1 deletion docs/developers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ If you make a pull-request to RDFLib on GitHub, travis will automatically test y
Compatibility
-------------

RDFLib>=5.0.0 tries to be compatible with python versions 2.7, 3.5, 3.6.
RDFLib>=5.0.0 tries to be compatible with python versions 2.7, 3.5, 3.6, 3.7.


Releasing
Expand Down
18 changes: 3 additions & 15 deletions rdflib/plugins/sparql/evaluate.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"""

import collections
import itertools

from rdflib import Variable, Graph, BNode, URIRef, Literal
from six import iteritems, itervalues
Expand Down Expand Up @@ -321,22 +322,9 @@ def evalOrderBy(ctx, part):


def evalSlice(ctx, slice):
# import pdb; pdb.set_trace()
res = evalPart(ctx, slice.p)
i = 0
while i < slice.start:
next(res)
i += 1
i = 0
for x in res:
i += 1
if slice.length is None:
yield x
else:
if i <= slice.length:
yield x
else:
break

return itertools.islice(res, slice.start, slice.start+slice.length if slice.length is not None else None)


def evalReduced(ctx, part):
Expand Down
3 changes: 2 additions & 1 deletion rdflib/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from __future__ import print_function

import os
import itertools
import shutil
import tempfile
import warnings
Expand Down Expand Up @@ -185,7 +186,7 @@ def _get_bindings(self):
return self._bindings

def _set_bindings(self, b):
if isinstance(b, types.GeneratorType):
if isinstance(b, (types.GeneratorType, itertools.islice)):
self._genbindings = b
self._bindings = []
else:
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def find_version(filename):
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"License :: OSI Approved :: BSD License",
"Topic :: Software Development :: Libraries :: Python Modules",
"Operating System :: OS Independent",
Expand Down