Skip to content

Commit 8d25c79

Browse files
authored
Merge pull request #22 from dapper91/dev
- python 3.12 support added.
2 parents adaeebd + 3834a10 commit 8d25c79

File tree

9 files changed

+162
-153
lines changed

9 files changed

+162
-153
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runs-on: ubuntu-latest
1515
strategy:
1616
matrix:
17-
python-version: ['3.9', '3.10', '3.11']
17+
python-version: ['3.9', '3.10', '3.11', '3.12']
1818
steps:
1919
- uses: actions/checkout@v2
2020
- name: Set up Python ${{ matrix.python-version }}

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,21 @@ repos:
2525
args:
2626
- --fix=no
2727
- repo: https://github.com/asottile/add-trailing-comma
28-
rev: v2.4.0
28+
rev: v3.1.0
2929
hooks:
3030
- id: add-trailing-comma
3131
stages:
3232
- commit
3333
- repo: https://github.com/pre-commit/mirrors-autopep8
34-
rev: v2.0.2
34+
rev: v2.0.4
3535
hooks:
3636
- id: autopep8
3737
stages:
3838
- commit
3939
args:
4040
- --diff
4141
- repo: https://github.com/pycqa/flake8
42-
rev: 6.0.0
42+
rev: 6.1.0
4343
hooks:
4444
- id: flake8
4545
- repo: https://github.com/pycqa/isort
@@ -63,7 +63,7 @@ repos:
6363
- --multi-line=9
6464
- --project=generic_connection_pool
6565
- repo: https://github.com/pre-commit/mirrors-mypy
66-
rev: v1.1.1
66+
rev: v1.5.1
6767
hooks:
6868
- id: mypy
6969
stages:

CHANGELOG.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
Changelog
22
=========
33

4+
0.6.0 (2023-10-05)
5+
------------------
6+
7+
- python 3.12 support added.
8+
9+
410
0.5.0 (2023-08-17)
511
------------------
612

generic_connection_pool/common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from typing import Dict, Generic, Hashable, Optional, Tuple, TypeVar
77

88
from . import exceptions
9-
from .heap import ExtHeap
9+
from .rankmap import RankMap
1010

1111
logger = logging.getLogger(__package__)
1212

@@ -279,7 +279,7 @@ class BaseEventQueue(Generic[KeyType]):
279279
"""
280280

281281
def __init__(self) -> None:
282-
self._queue: ExtHeap[Event[KeyType]] = ExtHeap()
282+
self._queue: RankMap[Event[KeyType]] = RankMap()
283283

284284
def _insert(self, timestamp: float, key: KeyType) -> None:
285285
"""

generic_connection_pool/contrib/unix.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@ class CheckSocketAlivenessMixin(Generic[EndpointT]):
2727

2828
def check_aliveness(self, endpoint: EndpointT, conn: socket.socket, timeout: Optional[float] = None) -> bool:
2929
try:
30-
with socket_timeout(conn, timeout):
31-
resp = conn.recv(1, socket.MSG_PEEK | socket.MSG_DONTWAIT)
32-
if resp == b'':
30+
if conn.recv(1, socket.MSG_PEEK | socket.MSG_DONTWAIT) == b'':
3331
return False
3432
except BlockingIOError as exc:
3533
if exc.errno != errno.EAGAIN:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class ComparableAndHashable(ComparableP, Protocol, Hashable):
1313
Item = TypeVar('Item', bound=ComparableAndHashable)
1414

1515

16-
class ExtHeap(Generic[Item]):
16+
class RankMap(Generic[Item]):
1717
"""
1818
Extended heap data structure implementation.
1919
Similar to `heapq` but supports remove and replace operations.

pyproject.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "generic-connection-pool"
3-
version = "0.5.0"
3+
version = "0.6.0"
44
description = "generic connection pool"
55
authors = ["Dmitry Pershin <[email protected]>"]
66
license = "Unlicense"
@@ -14,12 +14,17 @@ classifiers = [
1414
"Intended Audience :: Developers",
1515
"Natural Language :: English",
1616
"License :: Public Domain",
17+
"Operating System :: OS Independent",
18+
"Topic :: Database",
19+
"Topic :: Internet :: WWW/HTTP",
1720
"Topic :: Software Development :: Libraries",
1821
"Topic :: System :: Networking",
1922
"Programming Language :: Python :: 3",
2023
"Programming Language :: Python :: 3.9",
2124
"Programming Language :: Python :: 3.10",
2225
"Programming Language :: Python :: 3.11",
26+
"Programming Language :: Python :: 3.12",
27+
"Typing :: Typed",
2328
]
2429

2530
[tool.poetry.dependencies]

tests/test_heap.py

Lines changed: 0 additions & 141 deletions
This file was deleted.

0 commit comments

Comments
 (0)