Skip to content

Commit

Permalink
Rename module to match package name
Browse files Browse the repository at this point in the history
  • Loading branch information
RealOrangeOne committed May 22, 2024
1 parent 98d7f1f commit 4c39d15
Show file tree
Hide file tree
Showing 20 changed files with 37 additions and 41 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ If omitted, the following configuration is used:
```python
TASKS = {
"default": {
"BACKEND": "django_core_tasks.backends.immediate.ImmediateBackend"
"BACKEND": "django_tasks.backends.immediate.ImmediateBackend"
}
}
```
Expand All @@ -44,7 +44,7 @@ A few backends are included by default:
A task is created with the `task` decorator.

```python
from django_core_tasks import task
from django_tasks import task


@task()
Expand Down
2 changes: 1 addition & 1 deletion django_core_tasks/__init__.py → django_tasks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def configure_settings(self, settings: Optional[dict]) -> dict:
# Can be replaced with `django.conf.global_settings` once vendored.
return {
"default": {
"BACKEND": "django_core_tasks.backends.immediate.ImmediateBackend"
"BACKEND": "django_tasks.backends.immediate.ImmediateBackend"
}
}

Expand Down
2 changes: 1 addition & 1 deletion django_core_tasks/apps.py → django_tasks/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


class TasksAppConfig(AppConfig):
name = "django_core_tasks"
name = "django_tasks"

def ready(self) -> None:
from . import signal_handlers # noqa
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
from django.utils import timezone
from typing_extensions import ParamSpec

from django_core_tasks.exceptions import InvalidTaskError
from django_core_tasks.task import Task, TaskResult
from django_core_tasks.utils import is_global_function
from django_tasks.exceptions import InvalidTaskError
from django_tasks.task import Task, TaskResult
from django_tasks.utils import is_global_function

T = TypeVar("T")
P = ParamSpec("P")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

from typing_extensions import ParamSpec

from django_core_tasks.exceptions import ResultDoesNotExist
from django_core_tasks.task import ResultStatus, Task, TaskResult
from django_tasks.exceptions import ResultDoesNotExist
from django_tasks.task import ResultStatus, Task, TaskResult

from .base import BaseTaskBackend

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from asgiref.sync import async_to_sync
from typing_extensions import ParamSpec

from django_core_tasks.task import ResultStatus, Task, TaskResult
from django_tasks.task import ResultStatus, Task, TaskResult

from .base import BaseTaskBackend

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def clear_tasks_handlers(*, setting: str, **kwargs: dict) -> None:
Reset the connection handler whenever the settings change
"""
if setting == "TASKS":
from django_core_tasks import close_task_backends, tasks
from django_tasks import close_task_backends, tasks

close_task_backends()
tasks._settings = tasks.settings = tasks.configure_settings(None) # type:ignore[attr-defined]
Expand Down
File renamed without changes.
File renamed without changes.
12 changes: 6 additions & 6 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
just --list

test *ARGS:
coverage run --source=django_core_tasks manage.py test {{ ARGS }}
coverage run --source=django_tasks manage.py test {{ ARGS }}
coverage report
coverage html

format:
ruff check django_core_tasks tests --fix
ruff format django_core_tasks tests
ruff check django_tasks tests --fix
ruff format django_tasks tests

lint:
ruff check django_core_tasks tests
ruff format django_core_tasks tests --check
mypy django_core_tasks tests
ruff check django_tasks tests
ruff format django_tasks tests --check
mypy django_tasks tests
2 changes: 1 addition & 1 deletion tests/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
ALLOWED_HOSTS = ["*"]

INSTALLED_APPS = [
"django_core_tasks",
"django_tasks",
"tests",
]

Expand Down
2 changes: 1 addition & 1 deletion tests/tasks.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from django_core_tasks import task
from django_tasks import task


@task()
Expand Down
2 changes: 1 addition & 1 deletion tests/tests/is_global_function_fixture.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
because it's covered by a decorator.
"""

from django_core_tasks.utils import is_global_function
from django_tasks.utils import is_global_function


@is_global_function
Expand Down
8 changes: 4 additions & 4 deletions tests/tests/test_dummy_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
from django.test import SimpleTestCase, override_settings
from django.urls import reverse

from django_core_tasks import ResultStatus, default_task_backend, tasks
from django_core_tasks.backends.dummy import DummyBackend
from django_core_tasks.exceptions import ResultDoesNotExist
from django_tasks import ResultStatus, default_task_backend, tasks
from django_tasks.backends.dummy import DummyBackend
from django_tasks.exceptions import ResultDoesNotExist
from tests import tasks as test_tasks


@override_settings(
TASKS={"default": {"BACKEND": "django_core_tasks.backends.dummy.DummyBackend"}}
TASKS={"default": {"BACKEND": "django_tasks.backends.dummy.DummyBackend"}}
)
class DummyBackendTestCase(SimpleTestCase):
def setUp(self) -> None:
Expand Down
10 changes: 4 additions & 6 deletions tests/tests/test_immediate_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,14 @@
from django.urls import reverse
from django.utils import timezone

from django_core_tasks import ResultStatus, default_task_backend, tasks
from django_core_tasks.backends.immediate import ImmediateBackend
from django_core_tasks.exceptions import InvalidTaskError
from django_tasks import ResultStatus, default_task_backend, tasks
from django_tasks.backends.immediate import ImmediateBackend
from django_tasks.exceptions import InvalidTaskError
from tests import tasks as test_tasks


@override_settings(
TASKS={
"default": {"BACKEND": "django_core_tasks.backends.immediate.ImmediateBackend"}
}
TASKS={"default": {"BACKEND": "django_tasks.backends.immediate.ImmediateBackend"}}
)
class ImmediateBackendTestCase(SimpleTestCase):
def test_using_correct_backend(self) -> None:
Expand Down
14 changes: 6 additions & 8 deletions tests/tests/test_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
from django.test import SimpleTestCase, override_settings
from django.utils import timezone

from django_core_tasks import ResultStatus, default_task_backend, task, tasks
from django_core_tasks.backends.dummy import DummyBackend
from django_core_tasks.backends.immediate import ImmediateBackend
from django_core_tasks.exceptions import (
from django_tasks import ResultStatus, default_task_backend, task, tasks
from django_tasks.backends.dummy import DummyBackend
from django_tasks.backends.immediate import ImmediateBackend
from django_tasks.exceptions import (
InvalidTaskBackendError,
InvalidTaskError,
ResultDoesNotExist,
Expand All @@ -17,10 +17,8 @@

@override_settings(
TASKS={
"default": {"BACKEND": "django_core_tasks.backends.dummy.DummyBackend"},
"immediate": {
"BACKEND": "django_core_tasks.backends.immediate.ImmediateBackend"
},
"default": {"BACKEND": "django_tasks.backends.dummy.DummyBackend"},
"immediate": {"BACKEND": "django_tasks.backends.immediate.ImmediateBackend"},
"missing": {"BACKEND": "does.not.exist"},
}
)
Expand Down
2 changes: 1 addition & 1 deletion tests/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from django.test import SimpleTestCase

from django_core_tasks import utils
from django_tasks import utils
from tests import tasks as test_tasks


Expand Down
4 changes: 2 additions & 2 deletions tests/views.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from django.http import Http404, HttpRequest, HttpResponse, JsonResponse

from django_core_tasks import default_task_backend
from django_core_tasks.exceptions import ResultDoesNotExist
from django_tasks import default_task_backend
from django_tasks.exceptions import ResultDoesNotExist

from . import tasks

Expand Down

0 comments on commit 4c39d15

Please sign in to comment.