Skip to content
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
4 changes: 2 additions & 2 deletions neo4j/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,15 @@
])


from collections import deque, namedtuple, Mapping
from collections import deque, namedtuple
from functools import reduce
from operator import xor as xor_operator
from random import random
from time import sleep
from warnings import warn


from .compat import perf_counter, urlparse, xstr
from .compat import perf_counter, urlparse, xstr, Mapping
from .config import *
from .meta import version as __version__

Expand Down
8 changes: 8 additions & 0 deletions neo4j/compat/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,14 @@ def perf_counter():
return nanoTime() / 1000000000


# Using or importing the ABCs from 'collections' instead of from
# 'collections.abc' is deprecated, and in 3.8 it will stop working
try:
from collections.abc import Mapping
except ImportError:
from collections import Mapping


# The location of urlparse varies between Python 2 and 3
try:
from urllib.parse import urlparse, parse_qs
Expand Down
4 changes: 1 addition & 3 deletions neo4j/types/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@
"""


from collections import Mapping

from neo4j.compat import xstr, deprecated
from neo4j.compat import xstr, deprecated, Mapping


__all__ = [
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
neobolt<2,>=1.7
neobolt<2,>=1.7.2
neotime<2,>=1.7.1
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
from neo4j.meta import package, version

install_requires = [
"neobolt<2,>=1.7",
"neobolt<2,>=1.7.2",
"neotime<2,>=1.7.1",
]
classifiers = [
Expand Down
2 changes: 1 addition & 1 deletion test/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
boltkit>=1.0.39
boltkit
coverage
mock
pytest
Expand Down
2 changes: 1 addition & 1 deletion test/stub/scripts/broken_router.script
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
!: AUTO INIT
!: AUTO RESET

C: RUN "CALL dbms.cluster.routing.getServers" {}
C: RUN "CALL dbms.cluster.routing.getRoutingTable({context})" {"context": {}}
PULL_ALL
S: FAILURE {"code": "Neo.DatabaseError.General.UnknownError", "message": "An unknown error occurred."}
IGNORED
Expand Down
2 changes: 1 addition & 1 deletion test/stub/scripts/non_router.script
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
!: AUTO INIT
!: AUTO RESET

C: RUN "CALL dbms.cluster.routing.getServers" {}
C: RUN "CALL dbms.cluster.routing.getRoutingTable({context})" {"context": {}}
PULL_ALL
S: FAILURE {"code": "Neo.ClientError.Procedure.ProcedureNotFound", "message": "Not a router"}
IGNORED
Expand Down
6 changes: 3 additions & 3 deletions test/stub/scripts/return_1_four_times.script
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ S: SUCCESS {"fields": ["x"]}
RECORD [1]
SUCCESS {}

C: RUN "RETURN $x" {"x": 1}
C: RUN "" {"x": 1}
PULL_ALL
S: SUCCESS {"fields": ["x"]}
RECORD [1]
SUCCESS {}

C: RUN "RETURN $x" {"x": 1}
C: RUN "" {"x": 1}
PULL_ALL
S: SUCCESS {"fields": ["x"]}
RECORD [1]
SUCCESS {}

C: RUN "RETURN $x" {"x": 1}
C: RUN "" {"x": 1}
PULL_ALL
S: SUCCESS {"fields": ["x"]}
RECORD [1]
Expand Down
2 changes: 1 addition & 1 deletion test/stub/scripts/return_1_in_tx_twice.script
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ C: RUN "BEGIN" {"bookmark": "bookmark:1", "bookmarks": ["bookmark:1"]}
S: SUCCESS {"fields": []}
SUCCESS {}

C: RUN "RETURN 1" {}
C: RUN "" {}
PULL_ALL
S: SUCCESS {"fields": ["1"]}
RECORD [1]
Expand Down
2 changes: 1 addition & 1 deletion test/stub/scripts/return_1_twice.script
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ S: SUCCESS {"fields": ["x"]}
RECORD [1]
SUCCESS {}

C: RUN "RETURN $x" {"x": 1}
C: RUN "" {"x": 1}
PULL_ALL
S: SUCCESS {"fields": ["x"]}
RECORD [1]
Expand Down
2 changes: 1 addition & 1 deletion test/stub/scripts/return_1_twice_in_tx.script
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ S: SUCCESS {"fields": ["x"]}
RECORD [1]
SUCCESS {}

C: RUN "RETURN $x" {"x": 1}
C: RUN "" {"x": 1}
PULL_ALL
S: SUCCESS {"fields": ["x"]}
RECORD [1]
Expand Down
2 changes: 1 addition & 1 deletion test/stub/scripts/router.script
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
!: AUTO INIT
!: AUTO RESET

C: RUN "CALL dbms.cluster.routing.getServers" {}
C: RUN "CALL dbms.cluster.routing.getRoutingTable({context})" {"context": {}}
PULL_ALL
S: SUCCESS {"fields": ["ttl", "servers"]}
RECORD [300, [{"role":"ROUTE","addresses":["127.0.0.1:9001","127.0.0.1:9002","127.0.0.1:9003"]},{"role":"READ","addresses":["127.0.0.1:9004","127.0.0.1:9005"]},{"role":"WRITE","addresses":["127.0.0.1:9006"]}]]
Expand Down
2 changes: 1 addition & 1 deletion test/stub/scripts/router_no_readers.script
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
!: AUTO INIT
!: AUTO RESET

C: RUN "CALL dbms.cluster.routing.getServers" {}
C: RUN "CALL dbms.cluster.routing.getRoutingTable({context})" {"context": {}}
PULL_ALL
S: SUCCESS {"fields": ["ttl", "servers"]}
RECORD [300, [{"role":"ROUTE","addresses":["127.0.0.1:9001","127.0.0.1:9002","127.0.0.1:9003"]},{"role":"READ","addresses":[]},{"role":"WRITE","addresses":["127.0.0.1:9006"]}]]
Expand Down
2 changes: 1 addition & 1 deletion test/stub/scripts/router_no_routers.script
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
!: AUTO INIT
!: AUTO RESET

C: RUN "CALL dbms.cluster.routing.getServers" {}
C: RUN "CALL dbms.cluster.routing.getRoutingTable({context})" {"context": {}}
PULL_ALL
S: SUCCESS {"fields": ["ttl", "servers"]}
RECORD [300, [{"role":"ROUTE","addresses":[]},{"role":"READ","addresses":["127.0.0.1:9004","127.0.0.1:9005"]},{"role":"WRITE","addresses":["127.0.0.1:9006"]}]]
Expand Down
2 changes: 1 addition & 1 deletion test/stub/scripts/router_no_writers.script
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
!: AUTO INIT
!: AUTO RESET

C: RUN "CALL dbms.cluster.routing.getServers" {}
C: RUN "CALL dbms.cluster.routing.getRoutingTable({context})" {"context": {}}
PULL_ALL
S: SUCCESS {"fields": ["ttl", "servers"]}
RECORD [300, [{"role":"ROUTE","addresses":["127.0.0.1:9001","127.0.0.1:9002","127.0.0.1:9003"]},{"role":"READ","addresses":["127.0.0.1:9004","127.0.0.1:9005"]},{"role":"WRITE","addresses":[]}]]
Expand Down
2 changes: 1 addition & 1 deletion test/stub/scripts/router_with_multiple_servers.script
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
!: AUTO INIT
!: AUTO RESET

C: RUN "CALL dbms.cluster.routing.getServers" {}
C: RUN "CALL dbms.cluster.routing.getRoutingTable({context})" {"context": {}}
PULL_ALL
S: SUCCESS {"fields": ["ttl", "servers"]}
RECORD [300, [{"role":"ROUTE","addresses":["127.0.0.1:9001","127.0.0.1:9002"]},{"role":"READ","addresses":["127.0.0.1:9001","127.0.0.1:9003"]},{"role":"WRITE","addresses":["127.0.0.1:9004"]}]]
Expand Down
2 changes: 1 addition & 1 deletion test/stub/scripts/router_with_multiple_writers.script
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
!: AUTO INIT
!: AUTO RESET

C: RUN "CALL dbms.cluster.routing.getServers" {}
C: RUN "CALL dbms.cluster.routing.getRoutingTable({context})" {"context": {}}
PULL_ALL
S: SUCCESS {"fields": ["ttl", "servers"]}
RECORD [300, [{"role":"ROUTE","addresses":["127.0.0.1:9001","127.0.0.1:9002","127.0.0.1:9003"]},{"role":"READ","addresses":["127.0.0.1:9004","127.0.0.1:9005"]},{"role":"WRITE","addresses":["127.0.0.1:9006","127.0.0.1:9007"]}]]
Expand Down
2 changes: 1 addition & 1 deletion test/stub/scripts/rude_router.script
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
!: AUTO INIT
!: AUTO RESET

C: RUN "CALL dbms.cluster.routing.getServers" {}
C: RUN "CALL dbms.cluster.routing.getRoutingTable({context})" {"context": {}}
PULL_ALL
S: <EXIT>

2 changes: 1 addition & 1 deletion test/stub/scripts/silent_router.script
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
!: AUTO INIT
!: AUTO RESET

C: RUN "CALL dbms.cluster.routing.getServers" {}
C: RUN "CALL dbms.cluster.routing.getRoutingTable({context})" {"context": {}}
PULL_ALL
S: SUCCESS {"fields": ["ttl", "servers"]}
SUCCESS {}
4 changes: 1 addition & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ envlist =
py36

[testenv]
deps =
-r{toxinidir}/requirements.txt
-r{toxinidir}/test/requirements.txt
passenv =
NEO4J_SERVER_PACKAGE
NEO4J_USER
Expand All @@ -20,6 +17,7 @@ passenv =
JAVA_HOME
commands =
python setup.py develop
pip install --upgrade -r {toxinidir}/test/requirements.txt
coverage erase
coverage run -m pytest -v {posargs} test/unit test/stub test/integration #test/performance
coverage report