Skip to content

Commit d168d97

Browse files
authored
Bump dependencies & enable Python 3.7 dev env (#1130)
1 parent b957a74 commit d168d97

File tree

13 files changed

+92
-89
lines changed

13 files changed

+92
-89
lines changed

.pre-commit-config.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,13 @@ repos:
1919
- batch
2020
- id: trailing-whitespace
2121
args: [ --markdown-linebreak-ext=md ]
22-
- repo: https://github.com/pycqa/isort
23-
rev: 5.12.0
22+
- repo: local
2423
hooks:
2524
- id: isort
25+
name: isort
26+
entry: isort
27+
types_or: [ python, pyi ]
28+
language: system
2629
- repo: https://github.com/sphinx-contrib/sphinx-lint
2730
rev: e83a1a42a73284d301c05baaffc176042ffbcf82
2831
hooks:
@@ -45,7 +48,7 @@ repos:
4548
name: mypy static type check
4649
entry: mypy
4750
args: [ --show-error-codes, src, tests, testkitbackend, benchkit ]
48-
'types_or': [ python, pyi ]
51+
types_or: [ python, pyi ]
4952
language: system
5053
pass_filenames: false
5154
require_serial: true

benchkit/app.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
from __future__ import annotations
1818

19+
import sys
1920
import typing as t
2021
from contextlib import contextmanager
2122
from multiprocessing import Semaphore
@@ -43,7 +44,10 @@
4344
from .workloads import Workload
4445

4546

46-
T_App: te.TypeAlias = "Sanic[Config, BenchKitContext]"
47+
if sys.version_info < (3, 8):
48+
T_App: te.TypeAlias = "Sanic"
49+
else:
50+
T_App: te.TypeAlias = "Sanic[Config, BenchKitContext]"
4751

4852

4953
def create_app() -> T_App:

benchkit/workloads.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ def parse(cls, query: t.Any) -> te.Self:
543543
@dataclass
544544
class _WorkloadConfig:
545545
database: str | None
546-
routing: t.Literal["r", "w"]
546+
routing: te.Literal["r", "w"]
547547

548548
@classmethod
549549
def parse(cls, data: t.Any) -> te.Self:
@@ -553,7 +553,7 @@ def parse(cls, data: t.Any) -> te.Self:
553553
if not isinstance(database, str):
554554
raise TypeError("Workload database must be a string")
555555

556-
routing: t.Literal["r", "w"] = "w"
556+
routing: te.Literal["r", "w"] = "w"
557557
if "routing" in data:
558558
raw_routing = data["routing"]
559559
if not isinstance(routing, str):

requirements-dev.txt

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,31 @@
22
-e .[pandas,numpy,pyarrow]
33

44
# needed for packaging
5-
build
5+
build>=1.1.1 # TODO: 6.0 - bump when support for Python 3.7 is dropped
66

77
# auto-generate sync driver from async code
8-
unasync>=0.5.0
8+
unasync==0.5.0
99
# pre-commit hooks and tools
10-
pre-commit>=2.15.0
11-
isort>=5.10.0
12-
mypy>=0.971
13-
typing-extensions>=4.3.0
14-
types-pytz>=2022.1.2
15-
ruff>=0.6.4
10+
pre-commit>=2.21.0 # TODO: 6.0 - bump when support for Python 3.7 is dropped
11+
isort>=5.11.5 # TODO: 6.0 - bump when support for Python 3.7 is dropped
12+
mypy>=1.4.1 # TODO: 6.0 - bump when support for Python 3.7 is dropped
13+
typing-extensions>=4.7.1
14+
types-pytz>=2023.3.1.1 # TODO: 6.0 - bump when support for Python 3.7 is dropped
15+
ruff>=0.8.2
1616

1717
# needed for running tests
18-
coverage[toml]>=5.5
18+
coverage[toml]>=7.2.7 # TODO: 6.0 - bump when support for Python 3.7 is dropped
1919
freezegun>=1.5.1
20-
mock>=4.0.3
21-
pytest>=6.2.5
22-
pytest-asyncio>=0.16.0
23-
pytest-benchmark>=3.4.1
24-
pytest-cov>=3.0.0
25-
pytest-mock>=3.6.1
26-
tox>=4.0.0
27-
teamcity-messages>=1.32
20+
mock>=5.1.0
21+
pytest>=7.4.4 # TODO: 6.0 - bump when support for Python 3.7 is dropped
22+
pytest-asyncio~=0.21.2 # TODO: 6.0 - bump when support for Python 3.7 is dropped
23+
pytest-benchmark>=4.0.0
24+
pytest-cov>=4.1.0 # TODO: 6.0 - bump when support for Python 3.7 is dropped
25+
pytest-mock>=3.11.1 # TODO: 6.0 - bump when support for Python 3.7 is dropped
26+
tox>=4.8.0 # TODO: 6.0 - bump when support for Python 3.7 is dropped
2827

2928
# needed for building docs
30-
sphinx
29+
Sphinx>=5.3.0 # TODO: 6.0 - bump when support for Python 3.7 is dropped
3130

3231
# needed for BenchKit
33-
sanic>=23.12.1 ; python_version >= '3.8.0'
32+
sanic>=23.3.0 # TODO: 6.0 - bump when support for Python 3.7 is dropped

src/neo4j/_async/work/result.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ class AsyncResult(AsyncNonConcurrentMethodChecker):
105105
"""
106106

107107
_creation_stack: list[inspect.FrameInfo] | None
108-
_creation_frame_cache: None | t.Literal[False] | inspect.FrameInfo
108+
_creation_frame_cache: None | te.Literal[False] | inspect.FrameInfo
109109

110110
def __init__(
111111
self,
@@ -356,7 +356,7 @@ def _handle_warnings(self) -> None:
356356
)
357357

358358
@property
359-
def _creation_frame(self) -> t.Literal[False] | inspect.FrameInfo:
359+
def _creation_frame(self) -> te.Literal[False] | inspect.FrameInfo:
360360
if self._creation_frame_cache is not None:
361361
return self._creation_frame_cache
362362

src/neo4j/_spatial/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ def y(self) -> float: ...
5858
def z(self) -> float: ...
5959

6060
def __new__(cls, iterable: t.Iterable[float]) -> Point:
61-
return tuple.__new__(cls, map(float, iterable))
61+
# TODO: 6.0 - remove type ignore when support for Python 3.7 is dropped
62+
return tuple.__new__(cls, map(float, iterable)) # type: ignore[type-var]
6263

6364
def __repr__(self) -> str:
6465
return f"POINT({' '.join(map(str, self))})"

src/neo4j/_sync/work/result.py

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/neo4j/api.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,8 @@ def protocol_version(self) -> tuple[int, int]:
385385
This is returned as a 2-tuple:class:`tuple` (subclass) of
386386
``(major, minor)`` integers.
387387
"""
388-
return self._protocol_version
388+
# TODO: 6.0 - remove cast when support for Python 3.7 is dropped
389+
return t.cast(t.Tuple[int, int], self._protocol_version)
389390

390391
@property
391392
def agent(self) -> str:

src/neo4j/time/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,8 @@ def __new__(
470470
)
471471
if not MIN_INT64 <= avg_total_seconds <= MAX_INT64:
472472
raise ValueError(f"Duration value out of range: {tuple_!r}")
473-
return tuple.__new__(cls, tuple_)
473+
# TODO: 6.0 - remove type ignore when support for Python 3.7 is dropped
474+
return tuple.__new__(cls, tuple_) # type: ignore[type-var]
474475

475476
def __bool__(self) -> bool:
476477
"""Falsy if all primary instance attributes are."""

testkit/Dockerfile

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -57,18 +57,3 @@ RUN for version in $PYTHON_VERSIONS; do \
5757
python$version -m pip install -U pip && \
5858
python$version -m pip install -U coverage tox; \
5959
done
60-
61-
# Installing pyarrow lib until pre-built wheel for Python 3.13 exists
62-
# https://github.com/apache/arrow/issues/43519
63-
RUN apt update && \
64-
apt install -y -V lsb-release cmake gcc && \
65-
distro_name=$(lsb_release --id --short | tr 'A-Z' 'a-z') && \
66-
code_name=$(lsb_release --codename --short) && \
67-
wget https://apache.jfrog.io/artifactory/arrow/${distro_name}/apache-arrow-apt-source-latest-${code_name}.deb && \
68-
apt install -y -V ./apache-arrow-apt-source-latest-${code_name}.deb && \
69-
apt update && \
70-
apt install -y -V libarrow-dev libarrow-dataset-dev libarrow-flight-dev libparquet-dev && \
71-
apt clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
72-
ENV PYARROW_WITH_CUDA=off
73-
ENV PYARROW_WITH_GANDIVA=off
74-
ENV PYARROW_PARALLEL=8

0 commit comments

Comments
 (0)