asyncz 0.13.3__tar.gz → 0.13.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {asyncz-0.13.3 → asyncz-0.13.4}/PKG-INFO +2 -4
- asyncz-0.13.4/asyncz/__init__.py +1 -0
- {asyncz-0.13.3 → asyncz-0.13.4}/asyncz/datastructures.py +2 -1
- {asyncz-0.13.3 → asyncz-0.13.4}/asyncz/executors/base.py +2 -1
- {asyncz-0.13.3 → asyncz-0.13.4}/asyncz/schedulers/asgi.py +2 -2
- {asyncz-0.13.3 → asyncz-0.13.4}/asyncz/schedulers/base.py +2 -2
- {asyncz-0.13.3 → asyncz-0.13.4}/asyncz/schedulers/types.py +2 -2
- {asyncz-0.13.3 → asyncz-0.13.4}/asyncz/schedulers/utils.py +2 -1
- {asyncz-0.13.3 → asyncz-0.13.4}/asyncz/stores/redis.py +8 -8
- {asyncz-0.13.3 → asyncz-0.13.4}/asyncz/tasks/base.py +2 -2
- {asyncz-0.13.3 → asyncz-0.13.4}/asyncz/tasks/types.py +2 -2
- {asyncz-0.13.3 → asyncz-0.13.4}/asyncz/utils.py +2 -1
- {asyncz-0.13.3 → asyncz-0.13.4}/pyproject.toml +4 -6
- asyncz-0.13.3/asyncz/__init__.py +0 -1
- {asyncz-0.13.3 → asyncz-0.13.4}/.gitignore +0 -0
- {asyncz-0.13.3 → asyncz-0.13.4}/LICENSE +0 -0
- {asyncz-0.13.3 → asyncz-0.13.4}/README.md +0 -0
- {asyncz-0.13.3 → asyncz-0.13.4}/asyncz/enums.py +0 -0
- {asyncz-0.13.3 → asyncz-0.13.4}/asyncz/events/__init__.py +0 -0
- {asyncz-0.13.3 → asyncz-0.13.4}/asyncz/events/base.py +0 -0
- {asyncz-0.13.3 → asyncz-0.13.4}/asyncz/events/constants.py +0 -0
- {asyncz-0.13.3 → asyncz-0.13.4}/asyncz/exceptions.py +0 -0
- {asyncz-0.13.3 → asyncz-0.13.4}/asyncz/executors/__init__.py +0 -0
- {asyncz-0.13.3 → asyncz-0.13.4}/asyncz/executors/asyncio.py +0 -0
- {asyncz-0.13.3 → asyncz-0.13.4}/asyncz/executors/debug.py +0 -0
- {asyncz-0.13.3 → asyncz-0.13.4}/asyncz/executors/pool.py +0 -0
- {asyncz-0.13.3 → asyncz-0.13.4}/asyncz/executors/process_pool.py +0 -0
- {asyncz-0.13.3 → asyncz-0.13.4}/asyncz/executors/types.py +0 -0
- {asyncz-0.13.3 → asyncz-0.13.4}/asyncz/file_locking.py +0 -0
- {asyncz-0.13.3 → asyncz-0.13.4}/asyncz/locks.py +0 -0
- {asyncz-0.13.3 → asyncz-0.13.4}/asyncz/protocols.py +0 -0
- {asyncz-0.13.3 → asyncz-0.13.4}/asyncz/py.typed +0 -0
- {asyncz-0.13.3 → asyncz-0.13.4}/asyncz/schedulers/__init__.py +0 -0
- {asyncz-0.13.3 → asyncz-0.13.4}/asyncz/schedulers/asyncio.py +0 -0
- {asyncz-0.13.3 → asyncz-0.13.4}/asyncz/schedulers/datastructures.py +0 -0
- {asyncz-0.13.3 → asyncz-0.13.4}/asyncz/schedulers/defaults.py +0 -0
- {asyncz-0.13.3 → asyncz-0.13.4}/asyncz/state.py +0 -0
- {asyncz-0.13.3 → asyncz-0.13.4}/asyncz/stores/__init__.py +0 -0
- {asyncz-0.13.3 → asyncz-0.13.4}/asyncz/stores/base.py +0 -0
- {asyncz-0.13.3 → asyncz-0.13.4}/asyncz/stores/file.py +0 -0
- {asyncz-0.13.3 → asyncz-0.13.4}/asyncz/stores/memory.py +0 -0
- {asyncz-0.13.3 → asyncz-0.13.4}/asyncz/stores/mongo.py +0 -0
- {asyncz-0.13.3 → asyncz-0.13.4}/asyncz/stores/sqlalchemy.py +0 -0
- {asyncz-0.13.3 → asyncz-0.13.4}/asyncz/stores/types.py +0 -0
- {asyncz-0.13.3 → asyncz-0.13.4}/asyncz/tasks/__init__.py +0 -0
- {asyncz-0.13.3 → asyncz-0.13.4}/asyncz/triggers/__init__.py +0 -0
- {asyncz-0.13.3 → asyncz-0.13.4}/asyncz/triggers/base.py +0 -0
- {asyncz-0.13.3 → asyncz-0.13.4}/asyncz/triggers/combination.py +0 -0
- {asyncz-0.13.3 → asyncz-0.13.4}/asyncz/triggers/cron/__init__.py +0 -0
- {asyncz-0.13.3 → asyncz-0.13.4}/asyncz/triggers/cron/constants.py +0 -0
- {asyncz-0.13.3 → asyncz-0.13.4}/asyncz/triggers/cron/expressions.py +0 -0
- {asyncz-0.13.3 → asyncz-0.13.4}/asyncz/triggers/cron/fields.py +0 -0
- {asyncz-0.13.3 → asyncz-0.13.4}/asyncz/triggers/cron/trigger.py +0 -0
- {asyncz-0.13.3 → asyncz-0.13.4}/asyncz/triggers/cron/types.py +0 -0
- {asyncz-0.13.3 → asyncz-0.13.4}/asyncz/triggers/date.py +0 -0
- {asyncz-0.13.3 → asyncz-0.13.4}/asyncz/triggers/interval.py +0 -0
- {asyncz-0.13.3 → asyncz-0.13.4}/asyncz/triggers/shutdown.py +0 -0
- {asyncz-0.13.3 → asyncz-0.13.4}/asyncz/triggers/types.py +0 -0
- {asyncz-0.13.3 → asyncz-0.13.4}/asyncz/typing.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: asyncz
|
|
3
|
-
Version: 0.13.
|
|
3
|
+
Version: 0.13.4
|
|
4
4
|
Summary: The scheduler that nobody wants but every application needs.
|
|
5
5
|
Project-URL: Homepage, https://github.com/dymmond/asyncz
|
|
6
6
|
Project-URL: Documentation, https://asyncz.dymmond.com/
|
|
@@ -22,8 +22,6 @@ Classifier: Operating System :: OS Independent
|
|
|
22
22
|
Classifier: Programming Language :: Python
|
|
23
23
|
Classifier: Programming Language :: Python :: 3
|
|
24
24
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
25
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
26
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
27
25
|
Classifier: Programming Language :: Python :: 3.10
|
|
28
26
|
Classifier: Programming Language :: Python :: 3.11
|
|
29
27
|
Classifier: Programming Language :: Python :: 3.12
|
|
@@ -36,7 +34,7 @@ Classifier: Topic :: Software Development :: Libraries
|
|
|
36
34
|
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
|
37
35
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
38
36
|
Classifier: Typing :: Typed
|
|
39
|
-
Requires-Python: >=3.
|
|
37
|
+
Requires-Python: >=3.10
|
|
40
38
|
Requires-Dist: cryptography
|
|
41
39
|
Requires-Dist: pydantic<3.0.0,>=2.5.3
|
|
42
40
|
Provides-Extra: localtime
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.13.4"
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import logging
|
|
2
2
|
import sys
|
|
3
3
|
import traceback
|
|
4
|
+
from collections.abc import Callable
|
|
4
5
|
from datetime import datetime, timedelta
|
|
5
6
|
from datetime import timezone as tz
|
|
6
7
|
from threading import RLock
|
|
7
8
|
from traceback import format_tb
|
|
8
|
-
from typing import TYPE_CHECKING, Any,
|
|
9
|
+
from typing import TYPE_CHECKING, Any, cast
|
|
9
10
|
|
|
10
11
|
from asyncz.events import TaskExecutionEvent
|
|
11
12
|
from asyncz.events.constants import TASK_ERROR, TASK_EXECUTED, TASK_MISSED
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
-
from collections.abc import Awaitable
|
|
3
|
+
from collections.abc import Awaitable, Callable
|
|
4
4
|
from contextlib import suppress
|
|
5
5
|
from dataclasses import dataclass
|
|
6
6
|
from inspect import isawaitable
|
|
7
|
-
from typing import TYPE_CHECKING
|
|
7
|
+
from typing import TYPE_CHECKING
|
|
8
8
|
|
|
9
9
|
from asyncz.typing import DictStrAny
|
|
10
10
|
|
|
@@ -8,12 +8,12 @@ import sys
|
|
|
8
8
|
import warnings
|
|
9
9
|
from abc import abstractmethod
|
|
10
10
|
from collections import defaultdict
|
|
11
|
-
from collections.abc import Mapping, Sequence
|
|
11
|
+
from collections.abc import Callable, Mapping, Sequence
|
|
12
12
|
from datetime import datetime, timedelta
|
|
13
13
|
from functools import partial
|
|
14
14
|
from importlib import import_module
|
|
15
15
|
from threading import TIMEOUT_MAX, Lock, RLock
|
|
16
|
-
from typing import TYPE_CHECKING, Any,
|
|
16
|
+
from typing import TYPE_CHECKING, Any, Optional, Union, cast, overload
|
|
17
17
|
|
|
18
18
|
from asyncz.enums import PluginInstance, SchedulerState
|
|
19
19
|
from asyncz.events.base import SchedulerEvent, TaskEvent, TaskSubmissionEvent
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
from abc import ABC, abstractmethod
|
|
4
|
-
from collections.abc import Awaitable
|
|
4
|
+
from collections.abc import Awaitable, Callable
|
|
5
5
|
from inspect import isawaitable
|
|
6
|
-
from typing import TYPE_CHECKING, Any,
|
|
6
|
+
from typing import TYPE_CHECKING, Any, Optional, Union
|
|
7
7
|
|
|
8
8
|
from asyncz.events.constants import (
|
|
9
9
|
ALL_EVENTS,
|
|
@@ -37,7 +37,7 @@ class RedisStore(BaseStore):
|
|
|
37
37
|
database: int = 0,
|
|
38
38
|
tasks_key: str = "asyncz.tasks",
|
|
39
39
|
run_times_key: str = "asyncz.run_times",
|
|
40
|
-
pickle_protocol:
|
|
40
|
+
pickle_protocol: int | None = pickle.HIGHEST_PROTOCOL,
|
|
41
41
|
**kwargs: Any,
|
|
42
42
|
):
|
|
43
43
|
super().__init__(**kwargs)
|
|
@@ -67,11 +67,11 @@ class RedisStore(BaseStore):
|
|
|
67
67
|
|
|
68
68
|
def get_due_tasks(self, now: datetime) -> list["TaskType"]:
|
|
69
69
|
timestamp = datetime_to_utc_timestamp(now)
|
|
70
|
-
ids: list[str] = self.redis.zrangebyscore(self.run_times_key, 0, timestamp)
|
|
70
|
+
ids: list[str] = self.redis.zrangebyscore(self.run_times_key, 0, timestamp) # type: ignore
|
|
71
71
|
if not ids:
|
|
72
72
|
return []
|
|
73
|
-
states: list[Any] = self.redis.hmget(self.tasks_key, ids)
|
|
74
|
-
return self.rebuild_tasks(zip(ids, states))
|
|
73
|
+
states: list[Any] = self.redis.hmget(self.tasks_key, ids) # type: ignore
|
|
74
|
+
return self.rebuild_tasks(zip(ids, states, strict=False))
|
|
75
75
|
|
|
76
76
|
def rebuild_tasks(self, states: Iterable[tuple[str, Any]]) -> list["TaskType"]:
|
|
77
77
|
tasks = []
|
|
@@ -94,14 +94,14 @@ class RedisStore(BaseStore):
|
|
|
94
94
|
|
|
95
95
|
return tasks
|
|
96
96
|
|
|
97
|
-
def get_next_run_time(self) ->
|
|
97
|
+
def get_next_run_time(self) -> datetime | None:
|
|
98
98
|
next_run_time: Any = self.redis.zrange(self.run_times_key, 0, 0, withscores=True)
|
|
99
99
|
if next_run_time:
|
|
100
100
|
return utc_timestamp_to_datetime(cast(float, next_run_time[0][1]))
|
|
101
101
|
return None
|
|
102
102
|
|
|
103
103
|
def get_all_tasks(self) -> list["TaskType"]:
|
|
104
|
-
states: list[tuple[str, Any]] = self.redis.hgetall(self.tasks_key)
|
|
104
|
+
states: list[tuple[str, Any]] = self.redis.hgetall(self.tasks_key) # type: ignore
|
|
105
105
|
tasks = self.rebuild_tasks(states.items())
|
|
106
106
|
paused_sort_key = datetime(9999, 12, 31, tzinfo=tz.utc)
|
|
107
107
|
return sorted(tasks, key=lambda task: task.next_run_time or paused_sort_key)
|
|
@@ -116,7 +116,7 @@ class RedisStore(BaseStore):
|
|
|
116
116
|
pipe.hset(
|
|
117
117
|
self.tasks_key,
|
|
118
118
|
task.id,
|
|
119
|
-
self.conditional_encrypt(pickle.dumps(task.__getstate__(), self.pickle_protocol)),
|
|
119
|
+
self.conditional_encrypt(pickle.dumps(task.__getstate__(), self.pickle_protocol)), # type: ignore
|
|
120
120
|
)
|
|
121
121
|
|
|
122
122
|
if task.next_run_time:
|
|
@@ -135,7 +135,7 @@ class RedisStore(BaseStore):
|
|
|
135
135
|
pipe.hset(
|
|
136
136
|
self.tasks_key,
|
|
137
137
|
task.id,
|
|
138
|
-
self.conditional_encrypt(pickle.dumps(task.__getstate__(), self.pickle_protocol)),
|
|
138
|
+
self.conditional_encrypt(pickle.dumps(task.__getstate__(), self.pickle_protocol)), # type: ignore
|
|
139
139
|
)
|
|
140
140
|
if task.next_run_time:
|
|
141
141
|
pipe.zadd(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import inspect
|
|
2
|
-
from collections.abc import Iterable, Mapping, Sequence
|
|
2
|
+
from collections.abc import Callable, Iterable, Mapping, Sequence
|
|
3
3
|
from datetime import datetime, tzinfo
|
|
4
|
-
from typing import Any,
|
|
4
|
+
from typing import Any, Optional, Union, cast
|
|
5
5
|
from uuid import uuid4
|
|
6
6
|
|
|
7
7
|
from pydantic import Field
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
from abc import ABC, abstractmethod
|
|
4
|
-
from collections.abc import Sequence
|
|
4
|
+
from collections.abc import Callable, Sequence
|
|
5
5
|
from datetime import datetime, tzinfo
|
|
6
|
-
from typing import Any,
|
|
6
|
+
from typing import Any, Optional, TypeVar
|
|
7
7
|
|
|
8
8
|
from asyncz.schedulers.types import SchedulerType
|
|
9
9
|
from asyncz.triggers.types import TriggerType
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import inspect
|
|
2
2
|
import re
|
|
3
|
+
from collections.abc import Callable
|
|
3
4
|
from datetime import date, datetime, time, timedelta, tzinfo
|
|
4
5
|
from datetime import timezone as dttz
|
|
5
6
|
from functools import partial
|
|
6
|
-
from typing import Any,
|
|
7
|
+
from typing import Any, Optional, Union, cast, overload
|
|
7
8
|
|
|
8
9
|
from asyncz.exceptions import AsynczException, AsynczLookupError
|
|
9
10
|
|
|
@@ -7,7 +7,7 @@ name = "asyncz"
|
|
|
7
7
|
description = "The scheduler that nobody wants but every application needs."
|
|
8
8
|
long_description = "The scheduler that nobody wants but every application needs."
|
|
9
9
|
readme = "README.md"
|
|
10
|
-
requires-python = ">=3.
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
11
|
dynamic = ['version']
|
|
12
12
|
authors = [{ name = "Tiago Silva", email = "tiago.arasilva@gmail.com" }]
|
|
13
13
|
classifiers = [
|
|
@@ -29,8 +29,6 @@ classifiers = [
|
|
|
29
29
|
"Intended Audience :: Developers",
|
|
30
30
|
"License :: OSI Approved :: BSD License",
|
|
31
31
|
"Programming Language :: Python :: 3 :: Only",
|
|
32
|
-
"Programming Language :: Python :: 3.8",
|
|
33
|
-
"Programming Language :: Python :: 3.9",
|
|
34
32
|
"Programming Language :: Python :: 3.10",
|
|
35
33
|
"Programming Language :: Python :: 3.11",
|
|
36
34
|
"Programming Language :: Python :: 3.12",
|
|
@@ -147,7 +145,7 @@ disallow_any_generics = false
|
|
|
147
145
|
implicit_reexport = false
|
|
148
146
|
show_error_codes = true
|
|
149
147
|
disallow_incomplete_defs = true
|
|
150
|
-
disable_error_code = "attr-defined"
|
|
148
|
+
disable_error_code = "attr-defined,no-untyped-call"
|
|
151
149
|
warn_unused_ignores = true
|
|
152
150
|
warn_redundant_casts = true
|
|
153
151
|
|
|
@@ -155,8 +153,8 @@ warn_redundant_casts = true
|
|
|
155
153
|
line-length=99
|
|
156
154
|
|
|
157
155
|
[tool.ruff.lint]
|
|
158
|
-
select = ["E", "W", "F", "C", "B", "I", "UP", "SIM"]
|
|
159
|
-
ignore = ["E501", "B008", "C901", "B026"]
|
|
156
|
+
select = ["E", "W", "F", "C", "B", "I", "UP", "SIM", "FA"]
|
|
157
|
+
ignore = ["E501", "B008", "C901", "B026", "UP006", "UP038", "UP045", "UP007"]
|
|
160
158
|
|
|
161
159
|
exclude = ["docs_src/*", ".pdbrc"]
|
|
162
160
|
|
asyncz-0.13.3/asyncz/__init__.py
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.13.3"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|