Skip to content

Commit 4aea019

Browse files
committed
fix: using get_annotations
1 parent 6d0e1fc commit 4aea019

File tree

4 files changed

+14
-1
lines changed

4 files changed

+14
-1
lines changed

docs/changelog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,12 @@
22

33
## v4.0.9 🌈
44

5+
### 🐛 Bug Fixes
6+
7+
58
### 🧰 Maintenance
69

10+
- Support for python 3.14
711
- Add python 3.14 to test matrix @cclauss #302
812
- Turn off fail-fast @cclauss #303
913
- Fix typos in docs @cclauss #304

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ dependencies = [
4242
"django>=5",
4343
"croniter>=2.0",
4444
"click~=8.2",
45+
"typing-extensions>=4.15.0",
4546
]
4647

4748
[project.optional-dependencies]

scheduler/settings.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66

77
from scheduler.types import SchedulerConfiguration, QueueConfiguration
88

9+
try:
10+
from annotationlib import get_annotations
11+
except ImportError:
12+
from typing_extensions import get_annotations
13+
914
logger = logging.getLogger("scheduler")
1015

1116
_QUEUES: Dict[str, QueueConfiguration] = dict()
@@ -39,7 +44,8 @@ def conf_settings():
3944
if not isinstance(user_settings, dict):
4045
raise ImproperlyConfigured("SCHEDULER_CONFIG should be a SchedulerConfiguration or dict")
4146
for k, v in user_settings.items():
42-
if k not in SCHEDULER_CONFIG.__annotations__:
47+
annotations = get_annotations(SCHEDULER_CONFIG)
48+
if k not in annotations:
4349
raise ImproperlyConfigured(f"Unknown setting {k} in SCHEDULER_CONFIG")
4450
setattr(SCHEDULER_CONFIG, k, v)
4551

uv.lock

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

0 commit comments

Comments
 (0)