Skip to content

Commit 73dadf2

Browse files
committed
Support Python 3.14 and minor updates
1 parent 52db503 commit 73dadf2

19 files changed

+79
-53
lines changed

.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 3.1.0
2+
current_version = 3.1.2
33

44
[bumpversion:file:pyproject.toml]
55
search = version = "{current_version}"

.github/workflows/publish_on_pypi.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ jobs:
1010
runs-on: ubuntu-latest
1111

1212
steps:
13-
- uses: actions/checkout@v4
13+
- uses: actions/checkout@v5
1414

1515
- name: Set up Python
16-
uses: actions/setup-python@v5
16+
uses: actions/setup-python@v6
1717
with:
18-
python-version: "3.12"
18+
python-version: "3.13"
1919

2020
- name: Install build tool
2121
run: python -m pip install build --user

.github/workflows/test_with_tox.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ jobs:
1010
python: ['3.9', '3.10', '3.11', '3.12', '3.13']
1111

1212
steps:
13-
- uses: actions/checkout@v4
13+
- uses: actions/checkout@v5
1414

1515
- name: Setup Python ${{ matrix.python }}
16-
uses: actions/setup-python@v4
16+
uses: actions/setup-python@v6
1717
with:
1818
python-version: ${{ matrix.python }}
1919

2020
- run: pip install tox
2121

2222
- run: tox -e py
2323

24-
- if: matrix.python == 3.12
24+
- if: matrix.python == 3.13
2525
run: TOXENV=ruff,manifest,docs,spell tox

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,11 @@ dist
1515
local
1616

1717
.idea
18+
.vscode
19+
1820
.tox
1921
.pytest_cache
22+
.ruff_cache
2023

2124
test.bat
2225

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ to a database that can be used in all kinds of multi-threaded environments.
77
The suite supports DB-API 2 compliant database interfaces
88
and the classic PyGreSQL interface.
99

10-
The current version 3.1.1 of DBUtils supports Python versions 3.7 to 3.13.
10+
The current version 3.1.2 of DBUtils supports Python versions 3.7 to 3.14.
1111

1212
**Please have a look at the [changelog](https://webwareforpython.github.io/DBUtils/changelog.html), because there were some breaking changes in version 2.0.**
1313

dbutils/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
__all__ = ["__version__"]
44

5-
__version__ = "3.1.1"
5+
__version__ = "3.1.2"

dbutils/pooled_db.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,10 @@ def __eq__(self, other):
476476
return (self.con._transaction == other.con._transaction
477477
and self.shared == other.shared)
478478

479+
def __hash__(self):
480+
"""Get hash value of this connection."""
481+
return hash((self.con, self.shared))
482+
479483
def share(self):
480484
"""Increase the share of this connection."""
481485
self.shared += 1

dbutils/pooled_pg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ def __init__(
198198
if maxconnections:
199199
maxconnections = max(maxconnections, maxcached)
200200
# Create semaphore for number of allowed connections generally:
201-
from threading import Semaphore
201+
from threading import Semaphore # noqa: PLC0415
202202
self._connections = Semaphore(maxconnections)
203203
self._blocking = blocking
204204
else:

dbutils/simple_pooled_db.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def __init__(self, dbapi, maxconnections, *args, **kwargs):
145145
# If there is no connection level safety, build
146146
# the pool using the synchronized queue class
147147
# that implements all the required locking semantics.
148-
from queue import Queue
148+
from queue import Queue # noqa: PLC0415
149149
self._queue = Queue(maxconnections) # create the queue
150150
self.connection = self._unthreadsafe_get_connection
151151
self.addConnection = self._unthreadsafe_add_connection
@@ -154,7 +154,7 @@ def __init__(self, dbapi, maxconnections, *args, **kwargs):
154154
# If there is connection level safety, implement the
155155
# pool with an ordinary list used as a circular buffer.
156156
# We only need a minimum of locking in this case.
157-
from threading import Lock
157+
from threading import Lock # noqa: PLC0415
158158
self._lock = Lock() # create a lock object to be used later
159159
self._nextConnection = 0 # index of the next connection to be used
160160
self._connections = [] # the list of connections

dbutils/simple_pooled_pg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def __init__(self, maxconnections, *args, **kwargs):
123123
# Since there is no connection level safety, we
124124
# build the pool using the synchronized queue class
125125
# that implements all the required locking semantics.
126-
from queue import Queue
126+
from queue import Queue # noqa: PLC0415
127127
self._queue = Queue(maxconnections)
128128
# Establish all database connections (it would be better to
129129
# only establish a part of them now, and the rest on demand).

0 commit comments

Comments
 (0)