Skip to content

Commit fafc979

Browse files
authored
Merge branch 'main' into feat/python_313
2 parents 778f5ab + 2007586 commit fafc979

31 files changed

+1301
-428
lines changed

.github/workflows/test-suite.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
image: mariadb:11
2424
env:
2525
MYSQL_USER: username
26-
MYSQL_PASSWORD: passwsss*1348394#
26+
MYSQL_PASSWORD: passwsss*1348394#@
2727
MYSQL_ROOT_PASSWORD: password
2828
MYSQL_DATABASE: testsuite
2929
ports:
@@ -34,7 +34,7 @@ jobs:
3434
image: postgres:16
3535
env:
3636
POSTGRES_USER: username
37-
POSTGRES_PASSWORD: passwsss*1348394#
37+
POSTGRES_PASSWORD: passwsss*1348394#@
3838
POSTGRES_DB: testsuite
3939
ports:
4040
- 5432:5432
@@ -43,13 +43,13 @@ jobs:
4343
mssql:
4444
image: mcr.microsoft.com/mssql/server:2022-CU13-ubuntu-22.04
4545
env:
46-
MSSQL_SA_PASSWORD: Mssql123mssql-
46+
MSSQL_SA_PASSWORD: Mssql123mssql-@
4747
ACCEPT_EULA: "Y"
4848
MSSQL_PID: Developer
4949
ports:
5050
- 1433:1433
5151
options: >-
52-
--health-cmd "/opt/mssql-tools/bin/sqlcmd -U sa -P Mssql123mssql- -Q 'select 1' -b -o /dev/null"
52+
--health-cmd "/opt/mssql-tools/bin/sqlcmd -U sa -P 'Mssql123mssql-@' -Q 'select 1' -b -o /dev/null"
5353
--health-interval 60s
5454
--health-timeout 30s
5555
--health-start-period 20s

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,5 @@ venv/
1212
.idea/
1313
testsuite.sqlite3
1414
test_testsuite.sqlite3
15+
/site
16+
/dist

LICENSE

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Copyright © 2024, Dymmond Ltd. All rights reserved.
2+
3+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
4+
5+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
6+
7+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8+
9+
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
10+
11+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

LICENSE.md

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

databasez/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from databasez.core import Database, DatabaseURL
22

3-
__version__ = "0.10.3"
3+
__version__ = "0.11.1"
44

55
__all__ = ["Database", "DatabaseURL"]

databasez/core/database.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import contextlib
55
import importlib
66
import logging
7+
import sys
78
import weakref
89
from collections.abc import AsyncGenerator, Callable, Iterator, Sequence
910
from contextvars import ContextVar
@@ -264,7 +265,10 @@ def __init__(
264265
self._global_connection: Connection | None = None
265266

266267
self.ref_counter: int = 0
267-
self.ref_lock: asyncio.Lock = asyncio.Lock()
268+
if sys.version_info >= (3, 10):
269+
self.ref_lock: asyncio.Lock = asyncio.Lock()
270+
else:
271+
self.ref_lock = cast(asyncio.Lock, None)
268272

269273
def __copy__(self) -> Database:
270274
return self.__class__(self)
@@ -330,6 +334,9 @@ async def connect(self) -> bool:
330334
"""
331335
Establish the connection pool.
332336
"""
337+
# py39 compatibility
338+
if cast(Any, self.ref_lock) is None:
339+
self.ref_lock = asyncio.Lock()
333340
loop = asyncio.get_running_loop()
334341
if self._loop is not None and loop != self._loop:
335342
if self.poll_interval < 0:

0 commit comments

Comments
 (0)