Skip to content

Add support for new temporal packstream encoding (UTC) #748

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

Merged
merged 7 commits into from
Jul 7, 2022
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
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,26 @@
- ANSI colour codes for log output are now opt-in
- Prepend log format with log-level (if colours are disabled)
- Prepend log format with thread name and id
- Importing submodules from `neo4j.time` (`neo4j.time.xyz`) has been deprecated.
Everything needed should be imported from `neo4j.time` directly.
- `neo4j.spatial.hydrate_point` and `neo4j.spatial.dehydrate_point` have been
deprecated without replacement. They are internal functions.
- Importing `neo4j.packstream` has been deprecated. It's internal and should not
be used by client code.
- Importing `neo4j.routing` has been deprecated. It's internal and should not
be used by client code.
- Importing `neo4j.config` has been deprecated. It's internal and should not
be used by client code.
- `neoj4.Config`, `neoj4.PoolConfig`, `neoj4.SessionConfig`, and
`neoj4.WorkspaceConfig` have been deprecated without replacement. They are
internal classes.
- Importing `neo4j.meta` has been deprecated. It's internal and should not
be used by client code. `ExperimantalWarning` should be imported directly from
`neo4j`. `neo4j.meta.version` is exposed through `neo4j.__vesrion__`
- Importing `neo4j.data` has been deprecated. It's internal and should not
be used by client code. `Record` should be imported directly from `neo4j`
instead. `neo4j.data.DataHydrator` and `neo4j.data.DataDeydrator` have been
removed without replacement.


## Version 4.4
Expand Down
20 changes: 10 additions & 10 deletions bin/dist-functions
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@ DIST="${ROOT}/dist"

function get_package
{
python -c "from neo4j.meta import package; print(package)"
python -c "from neo4j._meta import package; print(package)"
}

function set_package
{
sed -i 's/^package = .*/package = "'$1'"/g' neo4j/meta.py
sed -i 's/^package = .*/package = "'$1'"/g' neo4j/_meta.py
}

function get_version
{
python -c "from neo4j.meta import version; print(version)"
python -c "from neo4j._meta import version; print(version)"
}

function set_version
{
sed -i 's/^version = .*/version = "'$1'"/g' neo4j/meta.py
sed -i 's/^version = .*/version = "'$1'"/g' neo4j/_meta.py
}

function check_file
Expand Down Expand Up @@ -49,8 +49,8 @@ function set_metadata_and_setup
ORIGINAL_VERSION=$(get_version)
echo "Source code originally configured for package ${ORIGINAL_PACKAGE}/${ORIGINAL_VERSION}"
echo "----------------------------------------"
grep "package\s\+=" neo4j/meta.py
grep "version\s\+=" neo4j/meta.py
grep "package\s\+=" neo4j/_meta.py
grep "version\s\+=" neo4j/_meta.py
echo "----------------------------------------"

function cleanup() {
Expand All @@ -59,8 +59,8 @@ function set_metadata_and_setup
set_version "${ORIGINAL_VERSION}"
echo "Source code reconfigured back to original package ${ORIGINAL_PACKAGE}/${ORIGINAL_VERSION}"
echo "----------------------------------------"
grep "package\s\+=" neo4j/meta.py
grep "version\s\+=" neo4j/meta.py
grep "package\s\+=" neo4j/_meta.py
grep "version\s\+=" neo4j/_meta.py
echo "----------------------------------------"
}
trap cleanup EXIT
Expand All @@ -70,8 +70,8 @@ function set_metadata_and_setup
set_version "${VERSION}"
echo "Source code reconfigured for package ${PACKAGE}/${VERSION}"
echo "----------------------------------------"
grep "package\s\+=" neo4j/meta.py
grep "version\s\+=" neo4j/meta.py
grep "package\s\+=" neo4j/_meta.py
grep "version\s\+=" neo4j/_meta.py
echo "----------------------------------------"

# Create source distribution
Expand Down
2 changes: 1 addition & 1 deletion bin/make-unasync
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
import collections
import errno
import os
from pathlib import Path
import re
import sys
import tokenize as std_tokenize
from pathlib import Path

import isort
import isort.files
Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
sys.path.insert(0, os.path.abspath(os.path.join("..", "..")))


from neo4j.meta import version as project_version
from neo4j import __version__ as project_version


# -- General configuration ------------------------------------------------
Expand Down
153 changes: 85 additions & 68 deletions neo4j/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,60 +16,7 @@
# limitations under the License.


__all__ = [
"__version__",
"Address",
"AsyncBoltDriver",
"AsyncDriver",
"AsyncGraphDatabase",
"AsyncManagedTransaction",
"AsyncNeo4jDriver",
"AsyncResult",
"AsyncSession",
"AsyncTransaction",
"Auth",
"AuthToken",
"basic_auth",
"bearer_auth",
"BoltDriver",
"Bookmark",
"Bookmarks",
"Config",
"custom_auth",
"DEFAULT_DATABASE",
"Driver",
"ExperimentalWarning",
"get_user_agent",
"GraphDatabase",
"IPv4Address",
"IPv6Address",
"kerberos_auth",
"ManagedTransaction",
"Neo4jDriver",
"PoolConfig",
"Query",
"READ_ACCESS",
"Record",
"Result",
"ResultSummary",
"ServerInfo",
"Session",
"SessionConfig",
"SummaryCounters",
"Transaction",
"TRUST_ALL_CERTIFICATES",
"TRUST_SYSTEM_CA_SIGNED_CERTIFICATES",
"TrustAll",
"TrustCustomCAs",
"TrustSystemCAs",
"unit_of_work",
"Version",
"WorkspaceConfig",
"WRITE_ACCESS",
]


from logging import getLogger
from logging import getLogger as _getLogger

from ._async.driver import (
AsyncBoltDriver,
Expand All @@ -84,9 +31,19 @@
AsyncTransaction,
)
from ._conf import (
Config as _Config,
PoolConfig as _PoolConfig,
SessionConfig as _SessionConfig,
TrustAll,
TrustCustomCAs,
TrustSystemCAs,
WorkspaceConfig as _WorkspaceConfig,
)
from ._data import Record
from ._meta import (
ExperimentalWarning,
get_user_agent,
version as __version__,
)
from ._sync.driver import (
BoltDriver,
Expand Down Expand Up @@ -125,19 +82,6 @@
Version,
WRITE_ACCESS,
)
from .conf import (
Config,
PoolConfig,
SessionConfig,
WorkspaceConfig,
)
from .data import Record
from .meta import (
experimental,
ExperimentalWarning,
get_user_agent,
version as __version__,
)
from .work import (
Query,
ResultSummary,
Expand All @@ -146,4 +90,77 @@
)


log = getLogger("neo4j")
__all__ = [
"__version__",
"Address",
"AsyncBoltDriver",
"AsyncDriver",
"AsyncGraphDatabase",
"AsyncManagedTransaction",
"AsyncNeo4jDriver",
"AsyncResult",
"AsyncSession",
"AsyncTransaction",
"Auth",
"AuthToken",
"basic_auth",
"bearer_auth",
"BoltDriver",
"Bookmark",
"Bookmarks",
"Config",
"custom_auth",
"DEFAULT_DATABASE",
"Driver",
"ExperimentalWarning",
"get_user_agent",
"GraphDatabase",
"IPv4Address",
"IPv6Address",
"kerberos_auth",
"ManagedTransaction",
"Neo4jDriver",
"PoolConfig",
"Query",
"READ_ACCESS",
"Record",
"Result",
"ResultSummary",
"ServerInfo",
"Session",
"SessionConfig",
"SummaryCounters",
"Transaction",
"TRUST_ALL_CERTIFICATES",
"TRUST_SYSTEM_CA_SIGNED_CERTIFICATES",
"TrustAll",
"TrustCustomCAs",
"TrustSystemCAs",
"unit_of_work",
"Version",
"WorkspaceConfig",
"WRITE_ACCESS",
]


_log = _getLogger("neo4j")


def __getattr__(name):
# TODO 6.0 - remove this
if name in (
"log", "Config", "PoolConfig", "SessionConfig", "WorkspaceConfig"
):
from ._meta import deprecation_warn
deprecation_warn(
"Importing {} from neo4j is deprecated without replacement. It's "
"internal and will be removed in a future version."
.format(name),
stack_level=2
)
return globals()[f"_{name}"]
raise AttributeError(f"module {__name__} has no attribute {name}")


def __dir__():
return __all__
26 changes: 11 additions & 15 deletions neo4j/_async/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,32 +16,27 @@
# limitations under the License.


import warnings

from .._async_compat.util import AsyncUtil
from .._conf import (
TrustAll,
TrustStore,
)
from ..addressing import Address
from ..api import (
READ_ACCESS,
TRUST_ALL_CERTIFICATES,
TRUST_SYSTEM_CA_SIGNED_CERTIFICATES,
)
from ..conf import (
Config,
PoolConfig,
SessionConfig,
TrustAll,
TrustStore,
WorkspaceConfig,
)
from ..meta import (
from .._meta import (
deprecation_warn,
experimental,
experimental_warn,
ExperimentalWarning,
unclosed_resource_warn,
)
from ..addressing import Address
from ..api import (
READ_ACCESS,
TRUST_ALL_CERTIFICATES,
TRUST_SYSTEM_CA_SIGNED_CERTIFICATES,
)


class AsyncGraphDatabase:
Expand Down Expand Up @@ -145,7 +140,8 @@ def driver(cls, uri, *, auth=None, **config):
"Creating a direct driver (`bolt://` scheme) with routing "
"context (URI parameters) is deprecated. They will be "
"ignored. This will raise an error in a future release. "
'Given URI "{}"'.format(uri)
'Given URI "{}"'.format(uri),
stack_level=2
)
# TODO: 6.0 - raise instead of warning
# raise ValueError(
Expand Down
Loading