Skip to content

Commit

Permalink
Merge pull request #22 from dapper91/dev
Browse files Browse the repository at this point in the history
- python 3.12 support added.
  • Loading branch information
dapper91 committed Oct 5, 2023
2 parents adaeebd + 3834a10 commit 8d25c79
Show file tree
Hide file tree
Showing 9 changed files with 162 additions and 153 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11']
python-version: ['3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
Expand Down
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,21 @@ repos:
args:
- --fix=no
- repo: https://github.com/asottile/add-trailing-comma
rev: v2.4.0
rev: v3.1.0
hooks:
- id: add-trailing-comma
stages:
- commit
- repo: https://github.com/pre-commit/mirrors-autopep8
rev: v2.0.2
rev: v2.0.4
hooks:
- id: autopep8
stages:
- commit
args:
- --diff
- repo: https://github.com/pycqa/flake8
rev: 6.0.0
rev: 6.1.0
hooks:
- id: flake8
- repo: https://github.com/pycqa/isort
Expand All @@ -63,7 +63,7 @@ repos:
- --multi-line=9
- --project=generic_connection_pool
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.1.1
rev: v1.5.1
hooks:
- id: mypy
stages:
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Changelog
=========

0.6.0 (2023-10-05)
------------------

- python 3.12 support added.


0.5.0 (2023-08-17)
------------------

Expand Down
4 changes: 2 additions & 2 deletions generic_connection_pool/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from typing import Dict, Generic, Hashable, Optional, Tuple, TypeVar

from . import exceptions
from .heap import ExtHeap
from .rankmap import RankMap

logger = logging.getLogger(__package__)

Expand Down Expand Up @@ -279,7 +279,7 @@ class BaseEventQueue(Generic[KeyType]):
"""

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

def _insert(self, timestamp: float, key: KeyType) -> None:
"""
Expand Down
4 changes: 1 addition & 3 deletions generic_connection_pool/contrib/unix.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ class CheckSocketAlivenessMixin(Generic[EndpointT]):

def check_aliveness(self, endpoint: EndpointT, conn: socket.socket, timeout: Optional[float] = None) -> bool:
try:
with socket_timeout(conn, timeout):
resp = conn.recv(1, socket.MSG_PEEK | socket.MSG_DONTWAIT)
if resp == b'':
if conn.recv(1, socket.MSG_PEEK | socket.MSG_DONTWAIT) == b'':
return False
except BlockingIOError as exc:
if exc.errno != errno.EAGAIN:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class ComparableAndHashable(ComparableP, Protocol, Hashable):
Item = TypeVar('Item', bound=ComparableAndHashable)


class ExtHeap(Generic[Item]):
class RankMap(Generic[Item]):
"""
Extended heap data structure implementation.
Similar to `heapq` but supports remove and replace operations.
Expand Down
7 changes: 6 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "generic-connection-pool"
version = "0.5.0"
version = "0.6.0"
description = "generic connection pool"
authors = ["Dmitry Pershin <dapper1291@gmail.com>"]
license = "Unlicense"
Expand All @@ -14,12 +14,17 @@ classifiers = [
"Intended Audience :: Developers",
"Natural Language :: English",
"License :: Public Domain",
"Operating System :: OS Independent",
"Topic :: Database",
"Topic :: Internet :: WWW/HTTP",
"Topic :: Software Development :: Libraries",
"Topic :: System :: Networking",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Typing :: Typed",
]

[tool.poetry.dependencies]
Expand Down
141 changes: 0 additions & 141 deletions tests/test_heap.py

This file was deleted.

Loading

0 comments on commit 8d25c79

Please sign in to comment.