Skip to content

Commit

Permalink
Use only absolute imports (#527)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamchainz authored Sep 22, 2023
1 parent 803d3df commit 1929d89
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/whitenoise/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from __future__ import annotations

from .base import WhiteNoise
from whitenoise.base import WhiteNoise

__all__ = ["WhiteNoise"]
14 changes: 7 additions & 7 deletions src/whitenoise/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
from wsgiref.headers import Headers
from wsgiref.util import FileWrapper

from .media_types import MediaTypes
from .responders import IsDirectoryError
from .responders import MissingFileError
from .responders import Redirect
from .responders import StaticFile
from .string_utils import decode_path_info
from .string_utils import ensure_leading_trailing_slash
from whitenoise.media_types import MediaTypes
from whitenoise.responders import IsDirectoryError
from whitenoise.responders import MissingFileError
from whitenoise.responders import Redirect
from whitenoise.responders import StaticFile
from whitenoise.string_utils import decode_path_info
from whitenoise.string_utils import ensure_leading_trailing_slash


class WhiteNoise:
Expand Down
4 changes: 2 additions & 2 deletions src/whitenoise/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
from django.http import FileResponse
from django.urls import get_script_prefix

from .base import WhiteNoise
from .string_utils import ensure_leading_trailing_slash
from whitenoise.base import WhiteNoise
from whitenoise.string_utils import ensure_leading_trailing_slash

__all__ = ["WhiteNoiseMiddleware"]

Expand Down
2 changes: 1 addition & 1 deletion src/whitenoise/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from django.contrib.staticfiles.storage import ManifestStaticFilesStorage
from django.contrib.staticfiles.storage import StaticFilesStorage

from .compress import Compressor
from whitenoise.compress import Compressor

_PostProcessT = Iterator[Union[Tuple[str, str, bool], Tuple[str, None, RuntimeError]]]

Expand Down
4 changes: 2 additions & 2 deletions tests/django_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

import django

from .utils import AppServer
from .utils import TEST_FILE_PATH
from tests.utils import AppServer
from tests.utils import TEST_FILE_PATH

ALLOWED_HOSTS = ["*"]

Expand Down
4 changes: 2 additions & 2 deletions tests/test_django_whitenoise.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
from django.test.utils import override_settings
from django.utils.functional import empty

from .utils import AppServer
from .utils import Files
from tests.utils import AppServer
from tests.utils import Files
from whitenoise.middleware import WhiteNoiseFileResponse
from whitenoise.middleware import WhiteNoiseMiddleware

Expand Down
2 changes: 1 addition & 1 deletion tests/test_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from django.test.utils import override_settings
from django.utils.functional import empty

from .utils import Files
from tests.utils import Files
from whitenoise.storage import CompressedManifestStaticFilesStorage
from whitenoise.storage import MissingFileError

Expand Down
4 changes: 2 additions & 2 deletions tests/test_whitenoise.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

import pytest

from .utils import AppServer
from .utils import Files
from tests.utils import AppServer
from tests.utils import Files
from whitenoise import WhiteNoise
from whitenoise.responders import StaticFile

Expand Down

0 comments on commit 1929d89

Please sign in to comment.