diff --git a/pyproject.toml b/pyproject.toml index 76601d4..2635677 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ name = "django-tasks-scheduler" packages = [ { include = "scheduler" }, ] -version = "3.0.0b1" +version = "3.0.0b2" description = "An async job scheduler for django using redis/valkey brokers" readme = "README.md" keywords = ["redis", "valkey", "django", "background-jobs", "job-queue", "task-queue", "redis-queue", "scheduled-jobs"] diff --git a/scheduler/admin/ephemeral_models.py b/scheduler/admin/ephemeral_models.py index a556577..4bb1f13 100644 --- a/scheduler/admin/ephemeral_models.py +++ b/scheduler/admin/ephemeral_models.py @@ -1,7 +1,7 @@ from django.contrib import admin from scheduler import views -from scheduler.models import Queue +from scheduler.models.queue import Queue from scheduler.models.worker import Worker diff --git a/scheduler/admin/old_task_models.py b/scheduler/admin/old_task_models.py index 80ff764..725eff4 100644 --- a/scheduler/admin/old_task_models.py +++ b/scheduler/admin/old_task_models.py @@ -9,7 +9,9 @@ from scheduler import tools from scheduler.broker_types import ConnectionErrorTypes -from scheduler.models import CronTask, TaskArg, TaskKwarg, RepeatableTask, ScheduledTask, BaseTask, migrate_util +from scheduler.models import migrate_util +from scheduler.models.args import TaskKwarg, TaskArg +from scheduler.models.old_scheduled_task import CronTask, RepeatableTask, ScheduledTask, BaseTask from scheduler.settings import SCHEDULER_CONFIG, logger from scheduler.tools import get_job_executions_for_task diff --git a/scheduler/admin/task_admin.py b/scheduler/admin/task_admin.py index e19af2c..4e22905 100644 --- a/scheduler/admin/task_admin.py +++ b/scheduler/admin/task_admin.py @@ -4,7 +4,8 @@ from scheduler import tools from scheduler.broker_types import ConnectionErrorTypes -from scheduler.models import TaskArg, TaskKwarg, Task +from scheduler.models.args import TaskArg, TaskKwarg +from scheduler.models.task import Task from scheduler.settings import SCHEDULER_CONFIG, logger from scheduler.tools import get_job_executions_for_task, TaskType diff --git a/scheduler/management/commands/import.py b/scheduler/management/commands/import.py index fb21089..eca0661 100644 --- a/scheduler/management/commands/import.py +++ b/scheduler/management/commands/import.py @@ -8,7 +8,7 @@ from django.core.management.base import BaseCommand from django.utils import timezone -from scheduler.models import TaskArg, TaskKwarg, Task +from scheduler.models.task import TaskArg, TaskKwarg, Task from scheduler.models.task import TaskType from scheduler.tools import MODEL_NAMES diff --git a/scheduler/models/__init__.py b/scheduler/models/__init__.py index 7dea098..e69de29 100644 --- a/scheduler/models/__init__.py +++ b/scheduler/models/__init__.py @@ -1,10 +0,0 @@ -from .args import TaskKwarg, TaskArg -from .old_scheduled_task import BaseTask, ScheduledTask, RepeatableTask, CronTask -from .queue import Queue -from .task import Task - -__all__ = [ - "TaskKwarg", "TaskArg", - "BaseTask", "ScheduledTask", "RepeatableTask", "CronTask", - "Queue", "Task", -] diff --git a/scheduler/tests/test_job_arg_models.py b/scheduler/tests/test_job_arg_models.py index 453778a..28e815d 100644 --- a/scheduler/tests/test_job_arg_models.py +++ b/scheduler/tests/test_job_arg_models.py @@ -2,7 +2,7 @@ from django.test import TestCase from django.utils import timezone -from scheduler.models import TaskArg, TaskKwarg +from scheduler.models.args import TaskArg, TaskKwarg from .jobs import arg_callable from .testtools import taskarg_factory diff --git a/scheduler/tests/test_mgmt_commands/test_import.py b/scheduler/tests/test_mgmt_commands/test_import.py index c856e28..2d641fc 100644 --- a/scheduler/tests/test_mgmt_commands/test_import.py +++ b/scheduler/tests/test_mgmt_commands/test_import.py @@ -7,7 +7,7 @@ from django.core.management import call_command from django.test import TestCase -from scheduler.models import Task +from scheduler.models.task import Task from scheduler.tests.testtools import task_factory from scheduler.tools import TaskType from scheduler.tests import test_settings # noqa diff --git a/scheduler/tests/test_old_models/test_cron_task.py b/scheduler/tests/test_old_models/test_cron_task.py index 33743ec..ab79b92 100644 --- a/scheduler/tests/test_old_models/test_cron_task.py +++ b/scheduler/tests/test_old_models/test_cron_task.py @@ -1,7 +1,7 @@ from django.core.exceptions import ValidationError from scheduler import settings -from scheduler.models import CronTask +from scheduler.models.old_scheduled_task import CronTask from scheduler.tools import create_worker from scheduler.tests.test_old_models.test_old_models import BaseTestCases from scheduler.tests.testtools import old_task_factory diff --git a/scheduler/tests/test_old_models/test_old_models.py b/scheduler/tests/test_old_models/test_old_models.py index e76764f..1bdd5d4 100644 --- a/scheduler/tests/test_old_models/test_old_models.py +++ b/scheduler/tests/test_old_models/test_old_models.py @@ -9,7 +9,7 @@ from freezegun import freeze_time from scheduler import settings -from scheduler.models import BaseTask, TaskArg, TaskKwarg, ScheduledTask +from scheduler.models.old_scheduled_task import BaseTask, TaskArg, TaskKwarg, ScheduledTask from scheduler.queues import get_queue from scheduler.tests import jobs from scheduler.tests.testtools import ( diff --git a/scheduler/tests/test_old_models/test_old_repeatable_task.py b/scheduler/tests/test_old_models/test_old_repeatable_task.py index 6005cd3..3a74150 100644 --- a/scheduler/tests/test_old_models/test_old_repeatable_task.py +++ b/scheduler/tests/test_old_models/test_old_repeatable_task.py @@ -5,7 +5,7 @@ from django.utils import timezone from scheduler import settings -from scheduler.models import RepeatableTask +from scheduler.models.old_scheduled_task import RepeatableTask from scheduler.tests.test_old_models.test_old_task_model import BaseTestCases from scheduler.tests.testtools import old_task_factory, _get_task_job_execution_from_registry diff --git a/scheduler/tests/test_old_models/test_old_task_model.py b/scheduler/tests/test_old_models/test_old_task_model.py index c8c9afe..c23c6e3 100644 --- a/scheduler/tests/test_old_models/test_old_task_model.py +++ b/scheduler/tests/test_old_models/test_old_task_model.py @@ -9,7 +9,7 @@ from freezegun import freeze_time from scheduler import settings -from scheduler.models import BaseTask, TaskArg, TaskKwarg, ScheduledTask +from scheduler.models.old_scheduled_task import BaseTask, TaskArg, TaskKwarg, ScheduledTask from scheduler.tools import run_task, create_worker from scheduler.tests import jobs from scheduler.tests.testtools import old_task_factory, taskarg_factory, _get_task_job_execution_from_registry, \ diff --git a/scheduler/tests/test_task_types/test_repeatable_task.py b/scheduler/tests/test_task_types/test_repeatable_task.py index 4dd9aec..17e4983 100644 --- a/scheduler/tests/test_task_types/test_repeatable_task.py +++ b/scheduler/tests/test_task_types/test_repeatable_task.py @@ -5,7 +5,7 @@ from django.utils import timezone from scheduler import settings -from scheduler.models import RepeatableTask +from scheduler.models.old_scheduled_task import RepeatableTask from scheduler.tests.testtools import task_factory, _get_task_job_execution_from_registry from scheduler.tools import TaskType from scheduler.tests.test_task_types.test_task_model import BaseTestCases diff --git a/scheduler/tests/test_task_types/test_task_model.py b/scheduler/tests/test_task_types/test_task_model.py index 02de659..fc5603d 100644 --- a/scheduler/tests/test_task_types/test_task_model.py +++ b/scheduler/tests/test_task_types/test_task_model.py @@ -9,8 +9,7 @@ from freezegun import freeze_time from scheduler import settings -from scheduler.models import Task, TaskArg, TaskKwarg -from scheduler.models.task import TaskType +from scheduler.models.task import TaskType, Task, TaskArg, TaskKwarg from scheduler.queues import get_queue from scheduler.tests import jobs from scheduler.tests.testtools import ( diff --git a/scheduler/tests/testtools.py b/scheduler/tests/testtools.py index 8548486..151816f 100644 --- a/scheduler/tests/testtools.py +++ b/scheduler/tests/testtools.py @@ -7,9 +7,11 @@ from django.utils import timezone from scheduler import settings -from scheduler.models import CronTask, TaskKwarg, RepeatableTask, ScheduledTask, BaseTask -from scheduler.models.task import TaskType, Task +from scheduler.models.args import TaskKwarg +from scheduler.models.old_scheduled_task import CronTask, RepeatableTask, ScheduledTask, BaseTask +from scheduler.models.task import Task from scheduler.queues import get_queue +from scheduler.tools import TaskType def assert_message_in_response(response, message): @@ -28,7 +30,7 @@ def sequence_gen(): def task_factory( - task_type: TaskType, callable_name: str = "scheduler.tests.jobs.test_job", instance_only=False, **kwargs + task_type: TaskType, callable_name: str = "scheduler.tests.jobs.test_job", instance_only=False, **kwargs ): values = dict( name="Scheduled Job %d" % next(seq),