Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
[project]
name = "quart-sqlalchemy"
version = "3.0.4"
version = "3.0.5"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

It's good to see the version number updated. However, ensure that the versioning scheme follows semantic versioning principles. Consider if a minor or patch version bump is more appropriate based on the changes made.

version = "3.1.0"

description = "SQLAlchemy for humans, with framework adapter for Quart."
authors = [
{name = "Joe Black", email = "me@joeblack.nyc"},
]
dependencies = [
"quart<0.20.0,>=0.18.3",
"quart>=0.18.3 ; python_version >= '3.9'",
"quart<0.20.0,>=0.18.3 ; python_version < '3.9'",
"werkzeug<3.1.0,>=2.2.0",
"blinker<1.7,>=1.5",
"SQLAlchemy[asyncio]<2.1.0,>=2.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/quart_sqlalchemy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "3.0.4"
__version__ = "3.0.5"

from .bind import AsyncBind
from .bind import Bind
Expand Down
3 changes: 2 additions & 1 deletion src/quart_sqlalchemy/bind.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,8 @@ def register_engine_connection_cross_process_safety_handlers(
def close_connections_for_forking():
engine.dispose(close=False)

os.register_at_fork(before=close_connections_for_forking)
if os.name == 'posix':
os.register_at_fork(before=close_connections_for_forking)
Comment on lines +261 to +262

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This check for os.name == 'posix' is good for preventing errors on Windows. However, consider if there's a more robust cross-platform solution for handling forking, or if a warning should be logged when running on Windows to indicate that forking-related connection safety measures are not active.

Suggested change
if os.name == 'posix':
os.register_at_fork(before=close_connections_for_forking)
if os.name == 'posix':
os.register_at_fork(before=close_connections_for_forking)
else:
import logging
logging.warning("os.register_at_fork is not available on Windows. Connection safety during forking is not guaranteed.")


def connect(dbapi_connection, connection_record):
connection_record.info["pid"] = os.getpid()
Expand Down
4 changes: 4 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@ skip_missing_interpreters = true
skip_install = true

[testenv]
allowlist_externals =
pdm
commands =
pdm install --dev
pytest -v -rsx --tb=short --asyncio-mode=auto --py311-task true --loop-scope session {posargs} tests

[testenv:q183]
allowlist_externals =
pdm
commands =
pdm install --dev
pip install aiofiles==23.2.1 blinker==1.5 click==8.1.7 flask==2.2.1 quart==0.18.3 werkzeug==2.2.0 jinja2==3.1.2
Expand Down