Skip to content

Commit

Permalink
fix:removed package exports
Browse files Browse the repository at this point in the history
  • Loading branch information
cunla committed Dec 2, 2024
1 parent 8b067fc commit 2820b8a
Show file tree
Hide file tree
Showing 15 changed files with 21 additions and 27 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
2 changes: 1 addition & 1 deletion scheduler/admin/ephemeral_models.py
Original file line number Diff line number Diff line change
@@ -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


Expand Down
4 changes: 3 additions & 1 deletion scheduler/admin/old_task_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion scheduler/admin/task_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion scheduler/management/commands/import.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
10 changes: 0 additions & 10 deletions scheduler/models/__init__.py
Original file line number Diff line number Diff line change
@@ -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",
]
2 changes: 1 addition & 1 deletion scheduler/tests/test_job_arg_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion scheduler/tests/test_mgmt_commands/test_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion scheduler/tests/test_old_models/test_cron_task.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion scheduler/tests/test_old_models/test_old_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion scheduler/tests/test_old_models/test_old_task_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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, \
Expand Down
2 changes: 1 addition & 1 deletion scheduler/tests/test_task_types/test_repeatable_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions scheduler/tests/test_task_types/test_task_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
8 changes: 5 additions & 3 deletions scheduler/tests/testtools.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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),
Expand Down

0 comments on commit 2820b8a

Please sign in to comment.