Skip to content

Commit bb9d443

Browse files
authored
feat: align with latest SAQ features and clean up dead code (#108)
This PR aligns litestar-saq with the latest SAQ feature set (removing deprecated lock options from PostgresQueueOptions) and removes the unused BackgroundTaskError class.
1 parent 137cb22 commit bb9d443

6 files changed

Lines changed: 55 additions & 70 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ jobs:
9595
strategy:
9696
fail-fast: true
9797
matrix:
98-
python-version: ["3.9", "3.10", "3.11", "3.12","3.13"]
98+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
9999
uses: ./.github/workflows/test.yml
100100
with:
101101
coverage: ${{ matrix.python-version == '3.12' }}

litestar_saq/config.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,6 @@ class PostgresQueueOptions(TypedDict, total=False):
227227
min_size: NotRequired[int]
228228
max_size: NotRequired[int]
229229
saq_lock_keyspace: NotRequired[int]
230-
job_lock_keyspace: NotRequired[int]
231-
job_lock_sweep: NotRequired[bool]
232230
priorities: NotRequired["tuple[int, int]"]
233231
swept_error_message: NotRequired[str]
234232
manage_pool_lifecycle: NotRequired[bool]

litestar_saq/exceptions.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,3 @@ class ImproperConfigurationError(LitestarSaqError):
77
88
This exception is raised only when a module depends on a dependency that has not been installed.
99
"""
10-
11-
12-
class BackgroundTaskError(Exception):
13-
"""Base class for `Task` related exceptions."""

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ license = { text = "MIT" }
2525
name = "litestar-saq"
2626
readme = "README.md"
2727
requires-python = ">=3.9"
28-
version = "0.7.1"
28+
version = "0.8.0"
2929

3030
[project.optional-dependencies]
3131
hiredis = ["hiredis"]
@@ -81,7 +81,7 @@ test = [
8181
allow_dirty = true
8282
commit = false
8383
commit_args = "--no-verify"
84-
current_version = "0.7.1"
84+
current_version = "0.8.0"
8585
ignore_missing_files = false
8686
ignore_missing_version = false
8787
message = "chore(release): bump to `v{new_version}`"

tests/test_config.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,18 @@ def fake_import_module(path: str) -> types.ModuleType:
5050
config.broker_instance = DummyAsyncRedis() # type: ignore[assignment]
5151

5252
assert config.broker_type == "redis"
53+
54+
55+
def test_postgres_queue_options_does_not_contain_deprecated_options() -> None:
56+
"""Verify that deprecated postgres lock options are not in PostgresQueueOptions."""
57+
from litestar_saq.config import PostgresQueueOptions
58+
59+
assert "job_lock_keyspace" not in PostgresQueueOptions.__annotations__
60+
assert "job_lock_sweep" not in PostgresQueueOptions.__annotations__
61+
62+
63+
def test_background_task_error_not_importable() -> None:
64+
"""Verify that BackgroundTaskError has been removed and cannot be imported."""
65+
import litestar_saq.exceptions
66+
67+
assert not hasattr(litestar_saq.exceptions, "BackgroundTaskError")

uv.lock

Lines changed: 37 additions & 61 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)