Skip to content

Commit e0a4e37

Browse files
committed
Clean up docs & bump meta data for 6.0
1 parent ff67c2a commit e0a4e37

File tree

30 files changed

+242
-242
lines changed

30 files changed

+242
-242
lines changed

README.rst

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,10 @@ Neo4j Bolt Driver for Python
44

55
This repository contains the official Neo4j driver for Python.
66

7-
Starting with 5.0, the Neo4j Drivers will be moving to a monthly release
8-
cadence. A minor version will be released on the last Friday of each month so
9-
as to maintain versioning consistency with the core product (Neo4j DBMS) which
10-
has also moved to a monthly cadence.
7+
Driver upgrades within a major version will never contain breaking API changes.
118

12-
As a policy, patch versions will not be released except on rare occasions. Bug
13-
fixes and updates will go into the latest minor version and users should
14-
upgrade to that. Driver upgrades within a major version will never contain
15-
breaking API changes.
16-
17-
See also: https://neo4j.com/developer/kb/neo4j-supported-versions/
9+
For version compatibility with Neo4j server, please refer to:
10+
https://neo4j.com/developer/kb/neo4j-supported-versions/
1811

1912
+ Python 3.13 supported.
2013
+ Python 3.12 supported.

docs/source/api.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,13 @@ Each supported scheme maps to a particular :class:`neo4j.Driver` subclass that i
8282
+------------------------+---------------------------------------------------------------------------------------------------------------------------------------+
8383
| URI Scheme | Driver Object and Setting |
8484
+========================+=======================================================================================================================================+
85-
| bolt | :ref:`bolt-driver-ref` with no encryption. |
85+
| bolt | :ref:`bolt-driver-ref` with no encryption or with custom encryption configuration, see :ref:`driver-configuration-ref`. |
8686
+------------------------+---------------------------------------------------------------------------------------------------------------------------------------+
8787
| bolt+ssc | :ref:`bolt-driver-ref` with encryption (accepts self signed certificates). |
8888
+------------------------+---------------------------------------------------------------------------------------------------------------------------------------+
8989
| bolt+s | :ref:`bolt-driver-ref` with encryption (accepts only certificates signed by a certificate authority), full certificate checks. |
9090
+------------------------+---------------------------------------------------------------------------------------------------------------------------------------+
91-
| neo4j | :ref:`neo4j-driver-ref` with no encryption. |
91+
| neo4j | :ref:`neo4j-driver-ref` with no encryption or with custom encryption configuration, see :ref:`driver-configuration-ref`. |
9292
+------------------------+---------------------------------------------------------------------------------------------------------------------------------------+
9393
| neo4j+ssc | :ref:`neo4j-driver-ref` with encryption (accepts self signed certificates). |
9494
+------------------------+---------------------------------------------------------------------------------------------------------------------------------------+
@@ -799,9 +799,8 @@ For example:
799799
self.driver.close()
800800
801801
Connection details held by the :class:`neo4j.Driver` are immutable.
802-
Therefore if, for example, a password is changed, a replacement :class:`neo4j.Driver` object must be created.
803-
More than one :class:`.Driver` may be required if connections to multiple remotes, or connections as multiple users, are required,
804-
unless when using impersonation (:ref:`impersonated-user-ref`).
802+
Therefore if, for example, the server URI is changed, a replacement :class:`neo4j.Driver` object must be created.
803+
More than one :class:`.Driver` may be required if connections to multiple remotes.
805804

806805
:class:`neo4j.Driver` objects are thread-safe but cannot be shared across processes.
807806
Therefore, ``multithreading`` should generally be preferred over ``multiprocessing`` for parallel database access.
@@ -959,7 +958,8 @@ more information.
959958
:class:`neo4j.Bookmarks` object instead.
960959

961960
.. versionchanged:: 6.0
962-
Only accepts :class:`neo4j.Bookmarks` objects or :data:`None`.
961+
No longer accepts an iterable of strings.
962+
Pass a :class:`neo4j.Bookmarks` objects or :data:`None` instead.
963963

964964

965965
.. _database-ref:
@@ -980,7 +980,7 @@ Name of the database to query.
980980
straightforward way and potentially simplifies driver logic as well as
981981
reduces network communication resulting in better performance.
982982

983-
Usage of Cypher clauses like `USE` is not a replacement for this option.
983+
Usage of Cypher clauses like ``USE`` is not a replacement for this option.
984984
The driver does not parse any Cypher.
985985

986986
When no explicit name is set, the driver behavior depends on the connection
@@ -1378,7 +1378,7 @@ Example:
13781378
13791379
.. _managed-transactions-ref:
13801380

1381-
Managed Transactions (`transaction functions`)
1381+
Managed Transactions (*transaction functions*)
13821382
==============================================
13831383
Transaction functions are the most powerful form of transaction, providing access mode override and retry capabilities.
13841384

@@ -2001,7 +2001,7 @@ Server-side errors
20012001

20022002
.. autoexception:: neo4j.exceptions.Neo4jError()
20032003
:show-inheritance:
2004-
:members: message, code, is_retriable, is_retryable
2004+
:members: message, code, is_retryable
20052005

20062006
.. autoexception:: neo4j.exceptions.ClientError()
20072007
:show-inheritance:

docs/source/async_api.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -837,7 +837,7 @@ Example:
837837
.. _async-managed-transactions-ref:
838838

839839

840-
Managed Transactions (`transaction functions`)
840+
Managed Transactions (*transaction functions*)
841841
==============================================
842842
Transaction functions are the most powerful form of transaction, providing access mode override and retry capabilities.
843843

docs/source/index.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ Bolt protocol versions supported:
1010
.. # [bolt-version-bump] search tag when changing bolt version support
1111
1212
* Bolt 5.0 - 5.8
13-
* Bolt 4.4
1413

1514
See https://7687.org/bolt-compatibility/ for what Neo4j DBMS versions support which Bolt versions.
1615
See https://neo4j.com/developer/kb/neo4j-supported-versions/ for a driver-server compatibility matrix.

requirements-dev.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ unasync==0.5.0
1010
pre-commit>=4.2.0
1111
isort>=6.0.1
1212
mypy>=1.15.0
13-
typing-extensions>=4.13.2
13+
#typing-extensions>=4.13.2
1414
types-pytz>=2025.2.0.20250326
1515
ruff>=0.11.6
1616

src/neo4j/_async/config.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ class AsyncPoolConfig(Config):
6868
trusted_certificates = TrustSystemCAs()
6969
# Specify how to determine the authenticity of encryption certificates
7070
# provided by the Neo4j instance on connection.
71-
# * `neo4j.TrustSystemCAs()`: Use system trust store. (default)
72-
# * `neo4j.TrustAll()`: Trust any certificate.
73-
# * `neo4j.TrustCustomCAs("<path>", ...)`:
71+
# * ``neo4j.TrustSystemCAs()``: Use system trust store. (default)
72+
# * ``neo4j.TrustAll()``: Trust any certificate.
73+
# * ``neo4j.TrustCustomCAs("<path>", ...)``:
7474
# Trust the specified certificate(s).
7575

7676
#: Certificate to use for mTLS as 2nd authentication factor.
@@ -79,7 +79,7 @@ class AsyncPoolConfig(Config):
7979
#: Custom SSL context to use for wrapping sockets
8080
ssl_context = None
8181
# Use any custom SSL context to wrap sockets.
82-
# Overwrites `trusted_certificates` and `encrypted`.
82+
# Overwrites ``trusted_certificates`` and ``encrypted``.
8383
# The use of this option is strongly discouraged.
8484

8585
#: User Agent (Python Driver Specific)

src/neo4j/_async/driver.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -312,18 +312,18 @@ def bookmark_manager(
312312
driver = neo4j.AsyncGraphDatabase.driver(...)
313313
bookmark_manager = neo4j.AsyncGraphDatabase.bookmark_manager(...)
314314
315-
async with driver.session(
316-
bookmark_manager=bookmark_manager
317-
) as session1:
318-
async with driver.session(
315+
async with (
316+
driver.session(bookmark_manager=bookmark_manager) as session1,
317+
driver.session(
319318
bookmark_manager=bookmark_manager,
320-
access_mode=neo4j.READ_ACCESS
321-
) as session2:
322-
result1 = await session1.run("<WRITE_QUERY>")
323-
await result1.consume()
324-
# READ_QUERY is guaranteed to see what WRITE_QUERY wrote.
325-
result2 = await session2.run("<READ_QUERY>")
326-
await result2.consume()
319+
default_access_mode=neo4j.READ_ACCESS,
320+
) as session2,
321+
):
322+
result1 = await session1.run("<WRITE_QUERY>")
323+
await result1.consume()
324+
# READ_QUERY is guaranteed to see what WRITE_QUERY wrote.
325+
result2 = await session2.run("<READ_QUERY>")
326+
await result2.consume()
327327
328328
This is a very contrived example, and in this particular case, having
329329
both queries in the same session has the exact same effect and might

src/neo4j/_async/io/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
"""
1818
Low-level functionality required for speaking Bolt.
1919
20-
It is not intended to be used directly by driver users. Instead, the `session`
21-
module provides the main user-facing abstractions.
20+
It is not intended to be used directly by driver users. Instead, the
21+
``session`` module provides the main user-facing abstractions.
2222
"""
2323

2424
__all__ = [

src/neo4j/_async/io/_pool.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -965,7 +965,7 @@ async def update_routing_table(
965965
:param acquisition_timeout: connection acquisition timeout
966966
:param database_callback: A callback function that will be called with
967967
the database name as only argument when a new routing table has
968-
been acquired. This database name might different from `database`
968+
been acquired. This database name might different from ``database``
969969
if that was None and the underlying protocol supports reporting
970970
back the actual database.
971971
@@ -1064,7 +1064,8 @@ async def ensure_routing_table_is_fresh(
10641064
10651065
This method is thread-safe.
10661066
1067-
:returns: `True` if an update was required, `False` otherwise.
1067+
:returns:
1068+
:data:`True` if an update was required, :data:`False` otherwise.
10681069
"""
10691070
async with self.refresh_lock:
10701071
for database_ in list(self.routing_tables.keys()):

src/neo4j/_async/work/result.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ async def _attach(self):
432432

433433
async def _buffer(self, n=None):
434434
"""
435-
Try to fill `self._record_buffer` with n records.
435+
Try to fill ``self._record_buffer`` with n records.
436436
437437
Might end up with more records in the buffer if the fetch size makes it
438438
overshoot.
@@ -586,9 +586,10 @@ async def single(self, strict: bool = False) -> Record | None:
586586
emit a warning and return the first record.
587587
588588
:param strict:
589-
If :data:`True`, raise a :exc:`.ResultNotSingleError` instead of
590-
returning :data:`None` if there is more than one record or warning
591-
if there is more than 1 record.
589+
If :data:`False`, return :data:`None` if there is no record and
590+
emit a warning if there is more than 1 record.
591+
If :data:`True`, raise a :exc:`.ResultNotSingleError` if there is
592+
not exactly one record.
592593
:data:`False` by default.
593594
:type strict: bool
594595
@@ -814,7 +815,7 @@ async def to_df(
814815
r"""
815816
Convert (the rest of) the result to a pandas DataFrame.
816817
817-
This method is only available if the `pandas` library is installed.
818+
This method is only available if the ``pandas`` library is installed.
818819
819820
::
820821
@@ -894,7 +895,7 @@ async def to_df(
894895
If :data:`False`, columns of the above types will be left as driver
895896
types (dtype ``object``).
896897
897-
:raises ImportError: if `pandas` library is not available.
898+
:raises ImportError: if the ``pandas`` library is not available.
898899
:raises ResultConsumedError: if the transaction from which this result
899900
was obtained has been closed or the Result has been explicitly
900901
consumed.

src/neo4j/_async/work/session.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ class AsyncSession(AsyncWorkspace):
7575
Therefore, a session should generally be short-lived, and must not
7676
span multiple threads/asynchronous Tasks.
7777
78-
In general, sessions will be created and destroyed within a `with`
78+
In general, sessions will be created and destroyed within a ``with``
7979
context. For example::
8080
8181
async with driver.session(database="neo4j") as session:
@@ -606,7 +606,7 @@ async def execute_read(
606606
This transaction will automatically be committed when the function
607607
returns, unless an exception is thrown during query execution or by
608608
the user code. Note, that this function performs retries and that the
609-
supplied `transaction_function` might get invoked more than once.
609+
supplied ``transaction_function`` might get invoked more than once.
610610
Therefore, it needs to be idempotent (i.e., have the same effect,
611611
regardless if called once or many times).
612612
@@ -646,12 +646,12 @@ async def get_two_tx(tx):
646646
:class:`.AsyncManagedTransaction`.
647647
:type transaction_function:
648648
typing.Callable[[AsyncManagedTransaction, P], typing.Awaitable[R]]
649-
:param args: additional arguments for the `transaction_function`
649+
:param args: additional arguments for the ``transaction_function``
650650
:type args: P
651-
:param kwargs: key word arguments for the `transaction_function`
651+
:param kwargs: key word arguments for the ``transaction_function``
652652
:type kwargs: P
653653
654-
:returns: whatever the given `transaction_function` returns
654+
:returns: whatever the given ``transaction_function`` returns
655655
:rtype: R
656656
657657
:raises SessionError: if the session has been closed.
@@ -685,7 +685,7 @@ async def execute_write(
685685
This transaction will automatically be committed when the function
686686
returns unless, an exception is thrown during query execution or by
687687
the user code. Note, that this function performs retries and that the
688-
supplied `transaction_function` might get invoked more than once.
688+
supplied ``transaction_function`` might get invoked more than once.
689689
Therefore, it needs to be idempotent (i.e., have the same effect,
690690
regardless if called once or many times).
691691
@@ -707,9 +707,9 @@ async def create_node_tx(tx, name):
707707
:class:`.AsyncManagedTransaction`.
708708
:type transaction_function:
709709
typing.Callable[[AsyncManagedTransaction, P], typing.Awaitable[R]]
710-
:param args: additional arguments for the `transaction_function`
710+
:param args: additional arguments for the ``transaction_function``
711711
:type args: P
712-
:param kwargs: key word arguments for the `transaction_function`
712+
:param kwargs: key word arguments for the ``transaction_function``
713713
:type kwargs: P
714714
715715
:returns: a result as returned by the given unit of work

src/neo4j/_async/work/transaction.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ async def run(
147147
Cypher is typically expressed as a query template plus a
148148
set of named parameters. In Python, parameters may be expressed
149149
through a dictionary of parameters, through individual parameter
150-
arguments, or as a mixture of both. For example, the `run`
151-
queries below are all equivalent::
150+
arguments, or as a mixture of both. For example, the ``run``
151+
calls below are all equivalent::
152152
153153
query = "CREATE (a:Person { name: $name, age: $age })"
154154
result = await tx.run(query, {"name": "Alice", "age": 33})

src/neo4j/_async_compat/network/_util.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ async def resolve_address(address, family=0, resolver=None):
8888
8989
:param address: the Address to resolve
9090
:param family: optional address family to filter resolved
91-
addresses by (e.g. `socket.AF_INET6`)
91+
addresses by (e.g. ``socket.AF_INET6``)
9292
:param resolver: optional customer resolver function to be
9393
called before regular DNS resolution
9494
"""
@@ -170,7 +170,7 @@ def resolve_address(address, family=0, resolver=None):
170170
171171
:param address: the Address to resolve
172172
:param family: optional address family to filter resolved
173-
addresses by (e.g. `socket.AF_INET6`)
173+
addresses by (e.g. ``socket.AF_INET6``)
174174
:param resolver: optional customer resolver function to be
175175
called before regular DNS resolution
176176
"""

src/neo4j/_auth_management.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ class AuthManager(metaclass=abc.ABCMeta):
117117
Furthermore, the manager is expected to be thread-safe.
118118
119119
The token returned must always belong to the same identity.
120-
Switching identities using the `AuthManager` is undefined behavior.
120+
Switching identities using the ``AuthManager`` is undefined behavior.
121121
You may use :ref:`session-level authentication<session-auth-ref>`
122122
for such use-cases.
123123
@@ -128,7 +128,7 @@ class AuthManager(metaclass=abc.ABCMeta):
128128
.. versionchanged:: 5.12
129129
``on_auth_expired`` was removed from the interface and replaced by
130130
:meth:`handle_security_exception`. The new method is called when the
131-
server returns any `Neo.ClientError.Security.*` error. Its signature
131+
server returns any ``Neo.ClientError.Security.*`` error. Its signature
132132
differs in that it additionally receives the error returned by the
133133
server and returns a boolean indicating whether the error was handled.
134134
@@ -147,9 +147,10 @@ def get_auth(self) -> _TAuth:
147147
148148
The method must only ever return auth information belonging to the
149149
same identity.
150-
Switching identities using the `AuthManager` is undefined behavior.
151-
You may use :ref:`session-level authentication<session-auth-ref>`
152-
for such use-cases.
150+
Switching identities using the ``AuthManager`` is undefined
151+
behavior. You may use
152+
:ref:`session-level authentication<session-auth-ref>` for such
153+
use-cases.
153154
"""
154155
...
155156

@@ -161,7 +162,7 @@ def handle_security_exception(
161162
Handle the server indicating authentication failure.
162163
163164
The driver will call this method when the server returns any
164-
`Neo.ClientError.Security.*` error. The error will then be processed
165+
``Neo.ClientError.Security.*`` error. The error will then be processed
165166
further as usual.
166167
167168
:param auth:

0 commit comments

Comments
 (0)