diff options
-rw-r--r-- | src/apscheduler/__init__.py | 4 | ||||
-rw-r--r-- | src/apscheduler/_context.py (renamed from src/apscheduler/context.py) | 0 | ||||
-rw-r--r-- | src/apscheduler/schedulers/async_.py | 2 | ||||
-rw-r--r-- | src/apscheduler/schedulers/sync.py | 2 | ||||
-rw-r--r-- | src/apscheduler/workers/async_.py | 2 | ||||
-rw-r--r-- | src/apscheduler/workers/sync.py | 2 | ||||
-rw-r--r-- | tests/test_schedulers.py | 4 |
7 files changed, 11 insertions, 5 deletions
diff --git a/src/apscheduler/__init__.py b/src/apscheduler/__init__.py index 630ca51..3149248 100644 --- a/src/apscheduler/__init__.py +++ b/src/apscheduler/__init__.py @@ -21,10 +21,14 @@ __all__ = [ "SerializationError", "Task", "TaskLookupError", + "current_scheduler", + "current_worker", + "job_info", ] from typing import Any +from ._context import current_scheduler, current_worker, job_info from ._enums import CoalescePolicy, ConflictPolicy, JobOutcome, RunState from ._exceptions import ( ConflictingIdError, diff --git a/src/apscheduler/context.py b/src/apscheduler/_context.py index 42ccf87..42ccf87 100644 --- a/src/apscheduler/context.py +++ b/src/apscheduler/_context.py diff --git a/src/apscheduler/schedulers/async_.py b/src/apscheduler/schedulers/async_.py index cbe8887..2cde777 100644 --- a/src/apscheduler/schedulers/async_.py +++ b/src/apscheduler/schedulers/async_.py @@ -14,6 +14,7 @@ import attrs from anyio import TASK_STATUS_IGNORED, create_task_group, move_on_after from anyio.abc import TaskGroup, TaskStatus +from .._context import current_scheduler from .._converters import as_async_datastore, as_async_eventbroker from .._enums import CoalescePolicy, ConflictPolicy, JobOutcome, RunState from .._exceptions import ( @@ -24,7 +25,6 @@ from .._exceptions import ( ) from .._structures import Job, JobResult, Schedule, Task from ..abc import AsyncDataStore, AsyncEventBroker, Subscription, Trigger -from ..context import current_scheduler from ..datastores.memory import MemoryDataStore from ..eventbrokers.async_local import LocalAsyncEventBroker from ..events import ( diff --git a/src/apscheduler/schedulers/sync.py b/src/apscheduler/schedulers/sync.py index 162e6b9..2380cca 100644 --- a/src/apscheduler/schedulers/sync.py +++ b/src/apscheduler/schedulers/sync.py @@ -15,6 +15,7 @@ from uuid import UUID, uuid4 import attrs +from .._context import current_scheduler from .._enums import CoalescePolicy, ConflictPolicy, JobOutcome, RunState from .._exceptions import ( JobCancelled, @@ -24,7 +25,6 @@ from .._exceptions import ( ) from .._structures import Job, JobResult, Schedule, Task from ..abc import DataStore, EventBroker, Trigger -from ..context import current_scheduler from ..datastores.memory import MemoryDataStore from ..eventbrokers.local import LocalEventBroker from ..events import ( diff --git a/src/apscheduler/workers/async_.py b/src/apscheduler/workers/async_.py index ffd6e4d..f15465f 100644 --- a/src/apscheduler/workers/async_.py +++ b/src/apscheduler/workers/async_.py @@ -20,12 +20,12 @@ from anyio import ( ) from anyio.abc import CancelScope, TaskGroup +from .._context import current_worker, job_info from .._converters import as_async_datastore, as_async_eventbroker from .._enums import JobOutcome, RunState from .._structures import Job, JobInfo, JobResult from .._validators import positive_integer from ..abc import AsyncDataStore, AsyncEventBroker -from ..context import current_worker, job_info from ..eventbrokers.async_local import LocalAsyncEventBroker from ..events import JobAdded, WorkerStarted, WorkerStopped diff --git a/src/apscheduler/workers/sync.py b/src/apscheduler/workers/sync.py index 61f23ad..2dbeaf9 100644 --- a/src/apscheduler/workers/sync.py +++ b/src/apscheduler/workers/sync.py @@ -15,11 +15,11 @@ from uuid import UUID import attrs +from .._context import current_worker, job_info from .._enums import JobOutcome, RunState from .._structures import Job, JobInfo, JobResult from .._validators import positive_integer from ..abc import DataStore, EventBroker -from ..context import current_worker, job_info from ..eventbrokers.local import LocalEventBroker from ..events import JobAdded, WorkerStarted, WorkerStopped diff --git a/tests/test_schedulers.py b/tests/test_schedulers.py index cd64b34..54c6bbf 100644 --- a/tests/test_schedulers.py +++ b/tests/test_schedulers.py @@ -18,8 +18,10 @@ from apscheduler import ( Schedule, ScheduleLookupError, Task, + current_scheduler, + current_worker, + job_info, ) -from apscheduler.context import current_scheduler, current_worker, job_info from apscheduler.events import ( Event, JobAdded, |