Skip to content

Commit 7582a20

Browse files
committed
Remove neo4j-driver package alias
1 parent cb4cf6d commit 7582a20

File tree

8 files changed

+37
-155
lines changed

8 files changed

+37
-155
lines changed

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
See also https://github.com/neo4j/neo4j-python-driver/wiki for a full changelog.
44

55
## NEXT RELEASE
6-
- No breaking or major changes.
6+
- Remove deprecated package alias `neo4j-driver`. Use `pip install neo4j` instead.
77

88

99
## Version 5.28

bin/check-dist

+10-11
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,16 @@ then
1313
exit 1
1414
else
1515
source "${ROOT}/bin/dist-functions"
16-
for PACKAGE in "neo4j-driver" "neo4j"; do
17-
NORMALIZED_PACKAGE="$(normalize_dist_name "$PACKAGE")"
18-
if ! (check_file "${DIST}/${NORMALIZED_PACKAGE}-${VERSION}.tar.gz" \
19-
|| check_file "${DIST}/${PACKAGE}-${VERSION}.tar.gz"); then
20-
STATUS=1
21-
fi
22-
if ! (check_file "${DIST}/${NORMALIZED_PACKAGE}-${VERSION}-py3-none-any.whl" \
23-
|| check_file "${DIST}/${PACKAGE}-${VERSION}-py3-none-any.whl"); then
24-
STATUS=1
25-
fi
26-
done
16+
PACKAGE="neo4j"
17+
NORMALIZED_PACKAGE="$(normalize_dist_name "$PACKAGE")"
18+
if ! (check_file "${DIST}/${NORMALIZED_PACKAGE}-${VERSION}.tar.gz" \
19+
|| check_file "${DIST}/${PACKAGE}-${VERSION}.tar.gz"); then
20+
STATUS=1
21+
fi
22+
if ! (check_file "${DIST}/${NORMALIZED_PACKAGE}-${VERSION}-py3-none-any.whl" \
23+
|| check_file "${DIST}/${PACKAGE}-${VERSION}-py3-none-any.whl"); then
24+
STATUS=1
25+
fi
2726
fi
2827

2928
exit ${STATUS}

bin/dist-functions

+4-22
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,6 @@ function set_version
2929
sed -i 's/^version = .*/version = "'$1'"/g' "${SRC}/neo4j/_meta.py"
3030
}
3131

32-
function get_deprecated {
33-
cd "${SRC}"
34-
python -c "from neo4j._meta import deprecated_package; print(deprecated_package)"
35-
cd - > /dev/null
36-
}
37-
38-
function set_deprecated {
39-
sed -i 's/^deprecated_package = .*/deprecated_package = '$1'/g' "${SRC}/neo4j/_meta.py"
40-
}
41-
4232
# distribution normalization according to PEP 625 https://peps.python.org/pep-0625/
4333
function normalize_dist_name
4434
{
@@ -62,45 +52,38 @@ function check_file
6252
function set_metadata_and_setup
6353
{
6454
PACKAGE="$1"; shift
65-
DEPRECATED="$1"; shift
6655
VERSION="$1"; shift
6756

6857
cd "${ROOT}"
6958

7059
# Capture original package metadata
7160
ORIGINAL_PACKAGE=$(get_package)
7261
ORIGINAL_VERSION=$(get_version)
73-
ORIGINAL_DEPRECATED=$(get_deprecated)
74-
echo "Source code originally configured for package ${ORIGINAL_PACKAGE}/${ORIGINAL_VERSION}/deprecated=${ORIGINAL_DEPRECATED}"
62+
echo "Source code originally configured for package ${ORIGINAL_PACKAGE}/${ORIGINAL_VERSION}"
7563
echo "----------------------------------------"
7664
grep "package\s\+=" "${SRC}/neo4j/_meta.py"
7765
grep "version\s\+=" "${SRC}/neo4j/_meta.py"
78-
grep "deprecated_package\s\+=" "${SRC}/neo4j/_meta.py"
7966
echo "----------------------------------------"
8067

8168
function cleanup() {
8269
# Reset to original package metadata
8370
set_package "${ORIGINAL_PACKAGE}"
8471
set_version "${ORIGINAL_VERSION}"
85-
set_deprecated "${ORIGINAL_DEPRECATED}"
86-
echo "Source code reconfigured back to original package ${ORIGINAL_PACKAGE}/${ORIGINAL_VERSION}/deprecated=${ORIGINAL_DEPRECATED}"
72+
echo "Source code reconfigured back to original package ${ORIGINAL_PACKAGE}/${ORIGINAL_VERSION}"
8773
echo "----------------------------------------"
8874
grep "package\s\+=" "${SRC}/neo4j/_meta.py"
8975
grep "version\s\+=" "${SRC}/neo4j/_meta.py"
90-
grep "deprecated_package\s\+=" "${SRC}/neo4j/_meta.py"
9176
echo "----------------------------------------"
9277
}
9378
trap cleanup EXIT
9479

9580
# Temporarily override package metadata
9681
set_package "${PACKAGE}"
9782
set_version "${VERSION}"
98-
set_deprecated "${DEPRECATED}"
99-
echo "Source code reconfigured for package ${PACKAGE}/${VERSION}/deprecated=${DEPRECATED}"
83+
echo "Source code reconfigured for package ${PACKAGE}/${VERSION}"
10084
echo "----------------------------------------"
10185
grep "package\s\+=" "${SRC}/neo4j/_meta.py"
10286
grep "version\s\+=" "${SRC}/neo4j/_meta.py"
103-
grep "deprecated_package\s\+=" "${SRC}/neo4j/_meta.py"
10487
echo "----------------------------------------"
10588

10689
# Create source distribution
@@ -121,6 +104,5 @@ function setup
121104
{
122105
ARGS="$*"
123106
rm -rf ${DIST} 2> /dev/null
124-
set_metadata_and_setup "neo4j-driver" "True" ${ARGS} # Legacy package; can be removed in 2.0
125-
set_metadata_and_setup "neo4j" "False" ${ARGS}
107+
set_metadata_and_setup "neo4j" ${ARGS}
126108
}

bin/release

+20-21
Original file line numberDiff line numberDiff line change
@@ -20,28 +20,27 @@ then
2020
fi
2121

2222
source "${ROOT}/bin/dist-functions"
23-
for PACKAGE in "neo4j-driver" "neo4j"; do
24-
NORMALIZED_PACKAGE="$(normalize_dist_name "$PACKAGE")"
23+
PACKAGE="neo4j"
24+
NORMALIZED_PACKAGE="$(normalize_dist_name "$PACKAGE")"
2525

26-
if check_file "${DIST}/${NORMALIZED_PACKAGE}-${VERSION}.tar.gz"
27-
then
28-
TWINE_ARGS="${TWINE_ARGS} ${DIST}/${NORMALIZED_PACKAGE}-${VERSION}.tar.gz"
29-
elif check_file "${DIST}/${PACKAGE}-${VERSION}.tar.gz"; then
30-
TWINE_ARGS="${TWINE_ARGS} ${DIST}/${PACKAGE}-${VERSION}.tar.gz"
31-
else
32-
echo "Source distribution file for ${PACKAGE} not found"
33-
exit 1
34-
fi
26+
if check_file "${DIST}/${NORMALIZED_PACKAGE}-${VERSION}.tar.gz"
27+
then
28+
TWINE_ARGS="${TWINE_ARGS} ${DIST}/${NORMALIZED_PACKAGE}-${VERSION}.tar.gz"
29+
elif check_file "${DIST}/${PACKAGE}-${VERSION}.tar.gz"; then
30+
TWINE_ARGS="${TWINE_ARGS} ${DIST}/${PACKAGE}-${VERSION}.tar.gz"
31+
else
32+
echo "Source distribution file for ${PACKAGE} not found"
33+
exit 1
34+
fi
3535

36-
if check_file "${DIST}/${NORMALIZED_PACKAGE}-${VERSION}-py3-none-any.whl"
37-
then
38-
TWINE_ARGS="${TWINE_ARGS} ${DIST}/${NORMALIZED_PACKAGE}-${VERSION}-py3-none-any.whl"
39-
elif check_file "${DIST}/${PACKAGE}-${VERSION}-py3-none-any.whl"; then
40-
TWINE_ARGS="${TWINE_ARGS} ${DIST}/${PACKAGE}-${VERSION}-py3-none-any.whl"
41-
else
42-
echo "Wheel distribution file for ${PACKAGE} not found"
43-
exit 1
44-
fi
45-
done
36+
if check_file "${DIST}/${NORMALIZED_PACKAGE}-${VERSION}-py3-none-any.whl"
37+
then
38+
TWINE_ARGS="${TWINE_ARGS} ${DIST}/${NORMALIZED_PACKAGE}-${VERSION}-py3-none-any.whl"
39+
elif check_file "${DIST}/${PACKAGE}-${VERSION}-py3-none-any.whl"; then
40+
TWINE_ARGS="${TWINE_ARGS} ${DIST}/${PACKAGE}-${VERSION}-py3-none-any.whl"
41+
else
42+
echo "Wheel distribution file for ${PACKAGE} not found"
43+
exit 1
44+
fi
4645

4746
twine upload ${TWINE_ARGS}

pyproject.toml

+2-5
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@
1717
name = "neo4j"
1818
description = "Neo4j Bolt driver for Python"
1919
license = {text = "Apache License, Version 2.0"}
20-
#TODO: 6.0 - static readme
21-
#readme = "README.rst"
20+
readme = "README.rst"
2221
authors = [
2322
{name = "Neo4j, Inc.", email = "drivers@neo4j.com"},
2423
]
@@ -42,7 +41,7 @@ classifiers = [
4241
"Topic :: Software Development",
4342
"Typing :: Typed",
4443
]
45-
dynamic = ["version", "readme"]
44+
dynamic = ["version"]
4645

4746
[project.urls]
4847
Homepage = "https://neo4j.com/"
@@ -68,8 +67,6 @@ requires = [
6867
"setuptools == 68.0.0; python_version <= '3.7'", # dropped support for Python 3.7 in 68.1.0
6968
"setuptools == 75.3.0; python_version == '3.8'", # dropped support for Python 3.8 in 75.4.0
7069
"setuptools == 75.6.0; python_version >= '3.9'",
71-
# TODO: 6.0 - can be removed once `setup.py` is simplified
72-
"tomlkit == 0.12.5", # dropped support (at least CI testing) for Python 3.7 in 0.13.0
7370
]
7471
build-backend = "setuptools.build_meta"
7572

setup.py

-84
This file was deleted.

src/neo4j/__init__.py

-10
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
)
4848
from ._data import Record
4949
from ._meta import (
50-
deprecated_package as _deprecated_package,
5150
deprecation_warn as _deprecation_warn,
5251
ExperimentalWarning,
5352
get_user_agent,
@@ -227,12 +226,3 @@ def __getattr__(name) -> _t.Any:
227226

228227
def __dir__() -> _t.List[str]:
229228
return __all__
230-
231-
232-
if _deprecated_package:
233-
_deprecation_warn(
234-
"The neo4j driver was installed under the package name `noe4j-driver` "
235-
"which is deprecated and will stop receiving updates starting with "
236-
"version 6.0.0. Please install `neo4j` instead (which is an alias, "
237-
"i.e., a drop-in replacement). See https://pypi.org/project/neo4j/ ."
238-
)

src/neo4j/_meta.py

-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
# Can be automatically overridden in builds
3535
package = "neo4j"
3636
version = "5.28.dev0"
37-
deprecated_package = False
3837

3938

4039
def _compute_bolt_agent() -> dict[str, str]:

0 commit comments

Comments
 (0)