EAScheduler 0.2.3__tar.gz → 0.2.5__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.
- {eascheduler-0.2.3/src/EAScheduler.egg-info → eascheduler-0.2.5}/PKG-INFO +11 -3
- {eascheduler-0.2.3 → eascheduler-0.2.5}/requirements_setup.txt +2 -2
- {eascheduler-0.2.3 → eascheduler-0.2.5/src/EAScheduler.egg-info}/PKG-INFO +11 -3
- eascheduler-0.2.5/src/EAScheduler.egg-info/requires.txt +4 -0
- eascheduler-0.2.5/src/eascheduler/__version__.py +1 -0
- {eascheduler-0.2.3 → eascheduler-0.2.5}/src/eascheduler/builder/filters.py +8 -1
- {eascheduler-0.2.3 → eascheduler-0.2.5}/src/eascheduler/builder/helper.py +5 -3
- {eascheduler-0.2.3 → eascheduler-0.2.5}/src/eascheduler/helpers/time_replace.py +2 -2
- {eascheduler-0.2.3 → eascheduler-0.2.5}/src/eascheduler/jobs/base.py +4 -1
- {eascheduler-0.2.3 → eascheduler-0.2.5}/src/eascheduler/producers/prod_operation.py +9 -9
- {eascheduler-0.2.3 → eascheduler-0.2.5}/src/eascheduler/producers/prod_sun.py +1 -1
- {eascheduler-0.2.3 → eascheduler-0.2.5}/src/eascheduler/producers/prod_time.py +4 -2
- eascheduler-0.2.3/src/EAScheduler.egg-info/requires.txt +0 -4
- eascheduler-0.2.3/src/eascheduler/__version__.py +0 -1
- {eascheduler-0.2.3 → eascheduler-0.2.5}/LICENSE +0 -0
- {eascheduler-0.2.3 → eascheduler-0.2.5}/MANIFEST.in +0 -0
- {eascheduler-0.2.3 → eascheduler-0.2.5}/setup.cfg +0 -0
- {eascheduler-0.2.3 → eascheduler-0.2.5}/setup.py +0 -0
- {eascheduler-0.2.3 → eascheduler-0.2.5}/src/EAScheduler.egg-info/SOURCES.txt +0 -0
- {eascheduler-0.2.3 → eascheduler-0.2.5}/src/EAScheduler.egg-info/dependency_links.txt +0 -0
- {eascheduler-0.2.3 → eascheduler-0.2.5}/src/EAScheduler.egg-info/top_level.txt +0 -0
- {eascheduler-0.2.3 → eascheduler-0.2.5}/src/eascheduler/__init__.py +0 -0
- {eascheduler-0.2.3 → eascheduler-0.2.5}/src/eascheduler/builder/__init__.py +0 -0
- {eascheduler-0.2.3 → eascheduler-0.2.5}/src/eascheduler/builder/jobs.py +0 -0
- {eascheduler-0.2.3 → eascheduler-0.2.5}/src/eascheduler/builder/triggers.py +0 -0
- {eascheduler-0.2.3 → eascheduler-0.2.5}/src/eascheduler/builder/utils.py +0 -0
- {eascheduler-0.2.3 → eascheduler-0.2.5}/src/eascheduler/const.py +0 -0
- {eascheduler-0.2.3 → eascheduler-0.2.5}/src/eascheduler/default.py +0 -0
- {eascheduler-0.2.3 → eascheduler-0.2.5}/src/eascheduler/errors/__init__.py +0 -0
- {eascheduler-0.2.3 → eascheduler-0.2.5}/src/eascheduler/errors/errors.py +0 -0
- {eascheduler-0.2.3 → eascheduler-0.2.5}/src/eascheduler/errors/handler.py +0 -0
- {eascheduler-0.2.3 → eascheduler-0.2.5}/src/eascheduler/executor/__init__.py +0 -0
- {eascheduler-0.2.3 → eascheduler-0.2.5}/src/eascheduler/executor/base.py +0 -0
- {eascheduler-0.2.3 → eascheduler-0.2.5}/src/eascheduler/helpers/__init__.py +0 -0
- {eascheduler-0.2.3 → eascheduler-0.2.5}/src/eascheduler/helpers/dst_param.py +0 -0
- {eascheduler-0.2.3 → eascheduler-0.2.5}/src/eascheduler/helpers/helpers.py +0 -0
- {eascheduler-0.2.3 → eascheduler-0.2.5}/src/eascheduler/job_control/__init__.py +0 -0
- {eascheduler-0.2.3 → eascheduler-0.2.5}/src/eascheduler/job_control/base.py +0 -0
- {eascheduler-0.2.3 → eascheduler-0.2.5}/src/eascheduler/job_control/job_countdown.py +0 -0
- {eascheduler-0.2.3 → eascheduler-0.2.5}/src/eascheduler/job_control/job_datetime.py +0 -0
- {eascheduler-0.2.3 → eascheduler-0.2.5}/src/eascheduler/job_control/job_onetime.py +0 -0
- {eascheduler-0.2.3 → eascheduler-0.2.5}/src/eascheduler/job_stores/__init__.py +0 -0
- {eascheduler-0.2.3 → eascheduler-0.2.5}/src/eascheduler/job_stores/base.py +0 -0
- {eascheduler-0.2.3 → eascheduler-0.2.5}/src/eascheduler/job_stores/memory.py +0 -0
- {eascheduler-0.2.3 → eascheduler-0.2.5}/src/eascheduler/jobs/__init__.py +0 -0
- {eascheduler-0.2.3 → eascheduler-0.2.5}/src/eascheduler/jobs/event_handler.py +0 -0
- {eascheduler-0.2.3 → eascheduler-0.2.5}/src/eascheduler/jobs/job_countdown.py +0 -0
- {eascheduler-0.2.3 → eascheduler-0.2.5}/src/eascheduler/jobs/job_datetime.py +0 -0
- {eascheduler-0.2.3 → eascheduler-0.2.5}/src/eascheduler/jobs/job_onetime.py +0 -0
- {eascheduler-0.2.3 → eascheduler-0.2.5}/src/eascheduler/producers/__init__.py +0 -0
- {eascheduler-0.2.3 → eascheduler-0.2.5}/src/eascheduler/producers/base.py +0 -0
- {eascheduler-0.2.3 → eascheduler-0.2.5}/src/eascheduler/producers/prod_filter.py +0 -0
- {eascheduler-0.2.3 → eascheduler-0.2.5}/src/eascheduler/producers/prod_filter_holiday.py +0 -0
- {eascheduler-0.2.3 → eascheduler-0.2.5}/src/eascheduler/producers/prod_group.py +0 -0
- {eascheduler-0.2.3 → eascheduler-0.2.5}/src/eascheduler/producers/prod_interval.py +0 -0
- {eascheduler-0.2.3 → eascheduler-0.2.5}/src/eascheduler/py.typed +0 -0
- {eascheduler-0.2.3 → eascheduler-0.2.5}/src/eascheduler/schedulers/__init__.py +0 -0
- {eascheduler-0.2.3 → eascheduler-0.2.5}/src/eascheduler/schedulers/async_scheduler.py +0 -0
- {eascheduler-0.2.3 → eascheduler-0.2.5}/src/eascheduler/schedulers/base.py +0 -0
- {eascheduler-0.2.3 → eascheduler-0.2.5}/src/eascheduler/task_managers/__init__.py +0 -0
- {eascheduler-0.2.3 → eascheduler-0.2.5}/src/eascheduler/task_managers/base.py +0 -0
- {eascheduler-0.2.3 → eascheduler-0.2.5}/src/eascheduler/task_managers/parallel.py +0 -0
- {eascheduler-0.2.3 → eascheduler-0.2.5}/src/eascheduler/task_managers/sequential.py +0 -0
- {eascheduler-0.2.3 → eascheduler-0.2.5}/tests/test_const.py +0 -0
- {eascheduler-0.2.3 → eascheduler-0.2.5}/tests/test_default.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: EAScheduler
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.5
|
|
4
4
|
Summary: Easy async scheduling with a nice interface
|
|
5
5
|
Home-page: https://github.com/spacemanspiff2007/eascheduler
|
|
6
6
|
Author: spaceman_spiff
|
|
@@ -19,9 +19,9 @@ Classifier: Programming Language :: Python :: 3 :: Only
|
|
|
19
19
|
Requires-Python: >=3.10
|
|
20
20
|
Description-Content-Type: text/markdown
|
|
21
21
|
License-File: LICENSE
|
|
22
|
-
Requires-Dist: whenever==0.
|
|
22
|
+
Requires-Dist: whenever==0.8.0
|
|
23
23
|
Requires-Dist: astral==3.2
|
|
24
|
-
Requires-Dist: holidays==0.
|
|
24
|
+
Requires-Dist: holidays==0.72
|
|
25
25
|
Requires-Dist: typing_extensions
|
|
26
26
|
Dynamic: author
|
|
27
27
|
Dynamic: classifier
|
|
@@ -137,6 +137,14 @@ scheduler.at(
|
|
|
137
137
|
````
|
|
138
138
|
|
|
139
139
|
## Changelog
|
|
140
|
+
#### 0.2.5 (2025-05-06)
|
|
141
|
+
- Updated to whenever 0.8 which introduces breaking changes
|
|
142
|
+
- Updated dependencies
|
|
143
|
+
|
|
144
|
+
#### 0.2.4 (2025-05-06)
|
|
145
|
+
- Updated to whenever 0.8 which introduces breaking changes
|
|
146
|
+
- Updated dependencies
|
|
147
|
+
|
|
140
148
|
#### 0.2.3 (2025-03-26)
|
|
141
149
|
- Updated dependencies
|
|
142
150
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: EAScheduler
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.5
|
|
4
4
|
Summary: Easy async scheduling with a nice interface
|
|
5
5
|
Home-page: https://github.com/spacemanspiff2007/eascheduler
|
|
6
6
|
Author: spaceman_spiff
|
|
@@ -19,9 +19,9 @@ Classifier: Programming Language :: Python :: 3 :: Only
|
|
|
19
19
|
Requires-Python: >=3.10
|
|
20
20
|
Description-Content-Type: text/markdown
|
|
21
21
|
License-File: LICENSE
|
|
22
|
-
Requires-Dist: whenever==0.
|
|
22
|
+
Requires-Dist: whenever==0.8.0
|
|
23
23
|
Requires-Dist: astral==3.2
|
|
24
|
-
Requires-Dist: holidays==0.
|
|
24
|
+
Requires-Dist: holidays==0.72
|
|
25
25
|
Requires-Dist: typing_extensions
|
|
26
26
|
Dynamic: author
|
|
27
27
|
Dynamic: classifier
|
|
@@ -137,6 +137,14 @@ scheduler.at(
|
|
|
137
137
|
````
|
|
138
138
|
|
|
139
139
|
## Changelog
|
|
140
|
+
#### 0.2.5 (2025-05-06)
|
|
141
|
+
- Updated to whenever 0.8 which introduces breaking changes
|
|
142
|
+
- Updated dependencies
|
|
143
|
+
|
|
144
|
+
#### 0.2.4 (2025-05-06)
|
|
145
|
+
- Updated to whenever 0.8 which introduces breaking changes
|
|
146
|
+
- Updated dependencies
|
|
147
|
+
|
|
140
148
|
#### 0.2.3 (2025-03-26)
|
|
141
149
|
- Updated dependencies
|
|
142
150
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = '0.2.5'
|
|
@@ -58,8 +58,15 @@ class FilterBuilder:
|
|
|
58
58
|
@staticmethod
|
|
59
59
|
def time(lower: HINT_TIME | None = None, upper: HINT_TIME | None = None) -> FilterObject:
|
|
60
60
|
"""Restrict the trigger instant to a time range"""
|
|
61
|
+
|
|
62
|
+
if lower is None and upper is None:
|
|
63
|
+
msg = 'At least one of lower or upper must be provided'
|
|
64
|
+
raise ValueError(msg)
|
|
65
|
+
|
|
66
|
+
time_lower = get_time(lower) if lower is not None else None
|
|
67
|
+
time_upper = get_time(upper) if upper is not None else None
|
|
61
68
|
return FilterObject(
|
|
62
|
-
TimeProducerFilter(
|
|
69
|
+
TimeProducerFilter(time_lower, time_upper)
|
|
63
70
|
)
|
|
64
71
|
|
|
65
72
|
@staticmethod
|
|
@@ -16,7 +16,7 @@ from eascheduler.helpers import HINT_CLOCK_BACKWARD, HINT_CLOCK_FORWARD, TimeRep
|
|
|
16
16
|
HINT_TIME: TypeAlias = dt_time | Time | str
|
|
17
17
|
HINT_TIMEDELTA: TypeAlias = dt_timedelta | TimeDelta | int | float | str
|
|
18
18
|
HINT_POS_TIMEDELTA: TypeAlias = HINT_TIMEDELTA
|
|
19
|
-
HINT_INSTANT: TypeAlias = dt_datetime | None | str | HINT_TIME | HINT_TIMEDELTA | SystemDateTime
|
|
19
|
+
HINT_INSTANT: TypeAlias = dt_datetime | None | str | HINT_TIME | HINT_TIMEDELTA | SystemDateTime | Instant
|
|
20
20
|
HINT_NAME_OR_NR: TypeAlias = int | str | Iterable[int | str]
|
|
21
21
|
HINT_DATE: TypeAlias = dt_date | dt_datetime | str | None | Date | SystemDateTime | Instant
|
|
22
22
|
|
|
@@ -98,11 +98,13 @@ def get_instant(value: HINT_INSTANT) -> Instant:
|
|
|
98
98
|
value.second, nanosecond=value.microsecond * 1_000).instant()
|
|
99
99
|
case SystemDateTime():
|
|
100
100
|
return value.instant()
|
|
101
|
+
case Instant():
|
|
102
|
+
return value
|
|
101
103
|
|
|
102
104
|
# ------------------------------------------------------------------------------------------------------------------
|
|
103
105
|
# timedelta
|
|
104
106
|
try:
|
|
105
|
-
timedelta = get_timedelta(value)
|
|
107
|
+
timedelta = get_timedelta(value) # type: ignore[arg-type]
|
|
106
108
|
except (ValueError, TypeError):
|
|
107
109
|
pass
|
|
108
110
|
else:
|
|
@@ -111,7 +113,7 @@ def get_instant(value: HINT_INSTANT) -> Instant:
|
|
|
111
113
|
# ------------------------------------------------------------------------------------------------------------------
|
|
112
114
|
# time
|
|
113
115
|
try:
|
|
114
|
-
time = get_time(value)
|
|
116
|
+
time = get_time(value) # type: ignore[arg-type]
|
|
115
117
|
except (ValueError, TypeError):
|
|
116
118
|
pass
|
|
117
119
|
else:
|
|
@@ -4,7 +4,7 @@ from enum import Enum
|
|
|
4
4
|
from typing import TYPE_CHECKING, Final, Literal, TypeAlias
|
|
5
5
|
|
|
6
6
|
from typing_extensions import Self
|
|
7
|
-
from whenever import Date,
|
|
7
|
+
from whenever import Date, PlainDateTime, RepeatedTime, SkippedTime, SystemDateTime, Time
|
|
8
8
|
|
|
9
9
|
from eascheduler.helpers.helpers import to_enum
|
|
10
10
|
|
|
@@ -35,7 +35,7 @@ HINT_REPEATED: TypeAlias = RepeatedTimeBehavior | Literal['skip', 'earlier', 'la
|
|
|
35
35
|
|
|
36
36
|
def find_time_after_dst_switch(dt: SystemDateTime | Date, time: Time) -> SystemDateTime:
|
|
37
37
|
# DST changes typically occur on the full minute
|
|
38
|
-
t =
|
|
38
|
+
t = PlainDateTime(dt.year, dt.month, dt.day, time.hour, time.minute)
|
|
39
39
|
|
|
40
40
|
# dst is typically 1 hour, but who knows
|
|
41
41
|
for _ in range(121):
|
|
@@ -116,7 +116,10 @@ class JobBase(Generic[IdType]):
|
|
|
116
116
|
self.update_next()
|
|
117
117
|
return self.status
|
|
118
118
|
|
|
119
|
-
def __lt__(self, other_job:
|
|
119
|
+
def __lt__(self, other_job: JobBase) -> bool:
|
|
120
|
+
if not isinstance(other_job, JobBase):
|
|
121
|
+
return NotImplemented
|
|
122
|
+
|
|
120
123
|
if (other := other_job.next_run) is None:
|
|
121
124
|
return True
|
|
122
125
|
if (this := self.next_run) is None:
|
|
@@ -4,7 +4,7 @@ from random import uniform
|
|
|
4
4
|
from typing import TYPE_CHECKING, Final
|
|
5
5
|
|
|
6
6
|
from typing_extensions import Self, override
|
|
7
|
-
from whenever import
|
|
7
|
+
from whenever import PlainDateTime, SkippedTime, SystemDateTime, Time, TimeDelta
|
|
8
8
|
|
|
9
9
|
from eascheduler.helpers import TimeReplacer, TimeSkippedError, TimeTwiceError
|
|
10
10
|
from eascheduler.producers.base import DateTimeProducerBase, DateTimeProducerOperationBase
|
|
@@ -16,13 +16,13 @@ if TYPE_CHECKING:
|
|
|
16
16
|
|
|
17
17
|
def find_time_after_dst_switch(dt: SystemDateTime, time: Time) -> Instant:
|
|
18
18
|
# DST changes typically occur on the full minute
|
|
19
|
-
local =
|
|
19
|
+
local = PlainDateTime(dt.year, dt.month, dt.day, time.hour, time.minute)
|
|
20
20
|
|
|
21
21
|
while True:
|
|
22
22
|
local = local.add(minutes=1, ignore_dst=True)
|
|
23
23
|
|
|
24
24
|
try:
|
|
25
|
-
return dt.replace_time(local.time(), disambiguate='raise').
|
|
25
|
+
return dt.replace_time(local.time(), disambiguate='raise').to_instant()
|
|
26
26
|
except SkippedTime:
|
|
27
27
|
continue
|
|
28
28
|
|
|
@@ -59,13 +59,13 @@ class EarliestProducerOperation(DateTimeProducerOperationBase):
|
|
|
59
59
|
@override
|
|
60
60
|
def apply_operation(self, next_dt: Instant, dt: Instant) -> Instant:
|
|
61
61
|
try:
|
|
62
|
-
earliest_dt = self.earliest.replace(next_dt.to_system_tz()).
|
|
62
|
+
earliest_dt = self.earliest.replace(next_dt.to_system_tz()).to_instant()
|
|
63
63
|
except TimeSkippedError:
|
|
64
64
|
return next_dt
|
|
65
65
|
except TimeTwiceError as e:
|
|
66
|
-
earliest_dt = e.earlier.
|
|
66
|
+
earliest_dt = e.earlier.to_instant()
|
|
67
67
|
if earliest_dt <= dt:
|
|
68
|
-
earliest_dt = e.later.
|
|
68
|
+
earliest_dt = e.later.to_instant()
|
|
69
69
|
|
|
70
70
|
if next_dt < earliest_dt:
|
|
71
71
|
return earliest_dt
|
|
@@ -87,13 +87,13 @@ class LatestProducerOperation(DateTimeProducerOperationBase):
|
|
|
87
87
|
@override
|
|
88
88
|
def apply_operation(self, next_dt: Instant, dt: Instant) -> Instant:
|
|
89
89
|
try:
|
|
90
|
-
latest_dt = self.latest.replace(next_dt.to_system_tz()).
|
|
90
|
+
latest_dt = self.latest.replace(next_dt.to_system_tz()).to_instant()
|
|
91
91
|
except TimeSkippedError:
|
|
92
92
|
return next_dt
|
|
93
93
|
except TimeTwiceError as e:
|
|
94
|
-
latest_dt = e.earlier.
|
|
94
|
+
latest_dt = e.earlier.to_instant()
|
|
95
95
|
if latest_dt <= dt:
|
|
96
|
-
latest_dt = e.later.
|
|
96
|
+
latest_dt = e.later.to_instant()
|
|
97
97
|
|
|
98
98
|
if next_dt > latest_dt:
|
|
99
99
|
return latest_dt
|
|
@@ -55,7 +55,7 @@ def set_location(latitude: float | str, longitude: float | str, elevation: float
|
|
|
55
55
|
OBSERVER = Observer(latitude, longitude, elevation)
|
|
56
56
|
|
|
57
57
|
|
|
58
|
-
SUN_CACHE: Final = OrderedDict()
|
|
58
|
+
SUN_CACHE: Final[OrderedDict[tuple[Hashable, ...], Instant]] = OrderedDict()
|
|
59
59
|
|
|
60
60
|
|
|
61
61
|
class SunProducer(DateTimeProducerBase):
|
|
@@ -9,7 +9,7 @@ from eascheduler.producers.base import DateTimeProducerBase, not_infinite_loop
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
if TYPE_CHECKING:
|
|
12
|
-
from whenever import Instant
|
|
12
|
+
from whenever import Instant, SystemDateTime
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
class TimeProducer(DateTimeProducerBase):
|
|
@@ -27,6 +27,8 @@ class TimeProducer(DateTimeProducerBase):
|
|
|
27
27
|
@override
|
|
28
28
|
def get_next(self, dt: Instant) -> Instant: # type: ignore[return]
|
|
29
29
|
|
|
30
|
+
local_dts: tuple[SystemDateTime, ...]
|
|
31
|
+
|
|
30
32
|
date = dt.to_system_tz().date()
|
|
31
33
|
for _ in not_infinite_loop(): # noqa: RET503
|
|
32
34
|
try:
|
|
@@ -37,7 +39,7 @@ class TimeProducer(DateTimeProducerBase):
|
|
|
37
39
|
local_dts = (e.earlier, e.later)
|
|
38
40
|
|
|
39
41
|
for local_dt in local_dts:
|
|
40
|
-
next_dt = local_dt.
|
|
42
|
+
next_dt = local_dt.to_instant()
|
|
41
43
|
if next_dt > dt and ((f := self._filter) is None or f.allow(local_dt)):
|
|
42
44
|
return next_dt
|
|
43
45
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = '0.2.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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|