From ec81d23c88f1086bf70c8963a23a2cc61ce5e91f Mon Sep 17 00:00:00 2001 From: Marius Conjeaud Date: Mon, 21 Aug 2023 09:23:36 +0200 Subject: [PATCH 1/5] Move neo4j debug watcher into tests --- neomodel/util.py | 2 -- test/test_connection.py | 7 +++++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/neomodel/util.py b/neomodel/util.py index acdb193a..d711834d 100644 --- a/neomodel/util.py +++ b/neomodel/util.py @@ -9,7 +9,6 @@ from neo4j import DEFAULT_DATABASE, GraphDatabase, basic_auth from neo4j.api import Bookmarks -from neo4j.debug import watch from neo4j.exceptions import ClientError, ServiceUnavailable, SessionExpired from neo4j.graph import Node, Relationship @@ -23,7 +22,6 @@ ) logger = logging.getLogger(__name__) -watch("neo4j") # make sure the connection url has been set prior to executing the wrapped function diff --git a/test/test_connection.py b/test/test_connection.py index 2c7061fe..702a4122 100644 --- a/test/test_connection.py +++ b/test/test_connection.py @@ -1,6 +1,7 @@ import os import pytest +from neo4j.debug import watch from neomodel import config, db @@ -16,6 +17,12 @@ def setup_teardown(): db.set_connection(INITIAL_URL) +@pytest.fixture(autouse=True, scope="session") +def neo4j_logging(): + with watch("neo4j"): + yield + + @pytest.mark.parametrize("protocol", ["neo4j+s", "neo4j+ssc", "bolt+s", "bolt+ssc"]) def test_connect_to_aura(protocol): cypher_return = "hello world" From 04dc70bbf4fd01322148c82f5a06ffc16dd890be Mon Sep 17 00:00:00 2001 From: Marius Conjeaud Date: Mon, 21 Aug 2023 14:17:43 +0200 Subject: [PATCH 2/5] Bump neo4j driver --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 103c3b0f..8fbca288 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,7 +33,7 @@ classifiers = [ "Topic :: Database", ] dependencies = [ - "neo4j==5.10.0", + "neo4j==5.11.0", "pytz>=2021.1", "neobolt==1.7.17", "six==1.16.0", From a939e4cef21cff88d46f21f06055cd60f2c11ac7 Mon Sep 17 00:00:00 2001 From: Marius Conjeaud Date: Mon, 21 Aug 2023 14:48:32 +0200 Subject: [PATCH 3/5] Update changelog --- Changelog | 1 + 1 file changed, 1 insertion(+) diff --git a/Changelog b/Changelog index f1cc7ec7..f53f994b 100644 --- a/Changelog +++ b/Changelog @@ -1,5 +1,6 @@ Version 5.1.1 2023-08 * Add impersonation +* Bumped neo4j-driver to 5.11.0 * Improve code quality and tooling Version 5.1.0 2023-07 From 11dbd2c57663e47e405bad0cd67a1902f583aea3 Mon Sep 17 00:00:00 2001 From: Marius Conjeaud Date: Mon, 21 Aug 2023 14:48:58 +0200 Subject: [PATCH 4/5] Add cache to Integration tests workflow --- .github/workflows/integration-tests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 071d691e..8532c799 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -21,9 +21,10 @@ jobs: steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} + cache: 'pip' - name: Creating Neo4j Container run: | chmod +x ./docker-scripts/docker-neo4j.sh From bd7a2454b523c5e7a167c61cc7212a73e6224904 Mon Sep 17 00:00:00 2001 From: Marius Conjeaud Date: Tue, 22 Aug 2023 13:54:01 +0200 Subject: [PATCH 5/5] Add user agent with neomodel version tag --- doc/source/conf.py | 3 ++- doc/source/configuration.rst | 2 +- neomodel/__init__.py | 1 - neomodel/_version.py | 1 + neomodel/config.py | 4 +++- 5 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 neomodel/_version.py diff --git a/doc/source/conf.py b/doc/source/conf.py index 672ef163..41e50bbf 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -7,7 +7,8 @@ import alabaster -from neomodel import __author__, __package__, __version__ +from neomodel import __author__, __package__ +from neomodel._version import __version__ # # neomodel documentation build configuration file, created by diff --git a/doc/source/configuration.rst b/doc/source/configuration.rst index 0cc9b8dc..854af8a8 100644 --- a/doc/source/configuration.rst +++ b/doc/source/configuration.rst @@ -22,7 +22,7 @@ Adjust driver configuration:: config.MAX_TRANSACTION_RETRY_TIME = 30.0 # default config.RESOLVER = None # default config.TRUST = neo4j.TRUST_SYSTEM_CA_SIGNED_CERTIFICATES # default - config.USER_AGENT = None # default + config.USER_AGENT = neomodel/vNeo4j.Major.minor # default Setting the database name, for neo4j >= 4:: diff --git a/neomodel/__init__.py b/neomodel/__init__.py index a110cf35..8e176510 100644 --- a/neomodel/__init__.py +++ b/neomodel/__init__.py @@ -38,4 +38,3 @@ __email__ = "robin.ge@gmail.com" __license__ = "MIT" __package__ = "neomodel" -__version__ = "5.1.1" diff --git a/neomodel/_version.py b/neomodel/_version.py new file mode 100644 index 00000000..a9c316e2 --- /dev/null +++ b/neomodel/_version.py @@ -0,0 +1 @@ +__version__ = "5.1.1" diff --git a/neomodel/config.py b/neomodel/config.py index 44858141..1f6df10b 100644 --- a/neomodel/config.py +++ b/neomodel/config.py @@ -1,5 +1,7 @@ import neo4j +from ._version import __version__ + AUTO_INSTALL_LABELS = False DATABASE_URL = "bolt://neo4j:foobarbaz@localhost:7687" FORCE_TIMEZONE = False @@ -13,4 +15,4 @@ MAX_TRANSACTION_RETRY_TIME = 30.0 RESOLVER = None TRUSTED_CERTIFICATES = neo4j.TrustSystemCAs() -USER_AGENT = None +USER_AGENT = f"neomodel/v{__version__}"