From cf36ba47d3196a9b7d15bb08be513fa697a37e7f Mon Sep 17 00:00:00 2001 From: Niicck Date: Mon, 16 Oct 2023 17:42:45 -0700 Subject: [PATCH] move to core directory --- django_vite/__init__.py | 2 +- django_vite/apps.py | 2 +- django_vite/{loader.py => core/asset_loader.py} | 4 ++-- django_vite/{ => core}/exceptions.py | 0 django_vite/{ => core}/tag_generator.py | 0 django_vite/templatetags/django_vite.py | 2 +- tests/conftest.py | 2 +- tests/tests/templatetags/test_vite_asset.py | 2 +- tests/tests/templatetags/test_vite_asset_url.py | 2 +- tests/tests/templatetags/test_vite_legacy_asset.py | 2 +- tests/tests/templatetags/test_vite_legacy_polyfills.py | 2 +- tests/tests/templatetags/test_vite_preload_asset.py | 2 +- tests/tests/test_asset_loader.py | 2 +- 13 files changed, 12 insertions(+), 12 deletions(-) rename django_vite/{loader.py => core/asset_loader.py} (99%) rename django_vite/{ => core}/exceptions.py (100%) rename django_vite/{ => core}/tag_generator.py (100%) diff --git a/django_vite/__init__.py b/django_vite/__init__.py index 09f8c32..110be3a 100644 --- a/django_vite/__init__.py +++ b/django_vite/__init__.py @@ -1,4 +1,4 @@ -from .loader import DjangoViteConfig +from .core.asset_loader import DjangoViteConfig __all__ = ["DjangoViteConfig"] diff --git a/django_vite/apps.py b/django_vite/apps.py index 4bc1bdc..afc20be 100644 --- a/django_vite/apps.py +++ b/django_vite/apps.py @@ -3,7 +3,7 @@ from django.apps import AppConfig from django.core.checks import Warning, register -from .exceptions import DjangoViteManifestError +from .core.exceptions import DjangoViteManifestError from .templatetags.django_vite import DjangoViteAssetLoader diff --git a/django_vite/loader.py b/django_vite/core/asset_loader.py similarity index 99% rename from django_vite/loader.py rename to django_vite/core/asset_loader.py index 75bfeb1..6b4741b 100644 --- a/django_vite/loader.py +++ b/django_vite/core/asset_loader.py @@ -7,12 +7,12 @@ from django.apps import apps from django.conf import settings -from django_vite.exceptions import ( +from django_vite.core.exceptions import ( DjangoViteManifestError, DjangoViteAssetNotFoundError, DjangoViteConfigNotFoundError, ) -from django_vite.tag_generator import Tag, TagGenerator +from django_vite.core.tag_generator import Tag, TagGenerator DEFAULT_APP_NAME = "default" diff --git a/django_vite/exceptions.py b/django_vite/core/exceptions.py similarity index 100% rename from django_vite/exceptions.py rename to django_vite/core/exceptions.py diff --git a/django_vite/tag_generator.py b/django_vite/core/tag_generator.py similarity index 100% rename from django_vite/tag_generator.py rename to django_vite/core/tag_generator.py diff --git a/django_vite/templatetags/django_vite.py b/django_vite/templatetags/django_vite.py index 1ffdf62..f10d395 100644 --- a/django_vite/templatetags/django_vite.py +++ b/django_vite/templatetags/django_vite.py @@ -3,7 +3,7 @@ from django import template from django.utils.safestring import mark_safe -from django_vite.loader import DjangoViteAssetLoader, DEFAULT_APP_NAME +from django_vite.core.asset_loader import DjangoViteAssetLoader, DEFAULT_APP_NAME register = template.Library() diff --git a/tests/conftest.py b/tests/conftest.py index ff92a35..df10a20 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,7 +1,7 @@ from typing import Dict, Any import pytest -from django_vite.loader import DjangoViteAssetLoader +from django_vite.core.asset_loader import DjangoViteAssetLoader def reload_django_vite(): diff --git a/tests/tests/templatetags/test_vite_asset.py b/tests/tests/templatetags/test_vite_asset.py index 7923954..5ed9834 100644 --- a/tests/tests/templatetags/test_vite_asset.py +++ b/tests/tests/templatetags/test_vite_asset.py @@ -1,7 +1,7 @@ import pytest from bs4 import BeautifulSoup from django.template import Context, Template, TemplateSyntaxError -from django_vite.exceptions import DjangoViteAssetNotFoundError +from django_vite.core.exceptions import DjangoViteAssetNotFoundError def test_vite_asset_returns_dev_tags(): diff --git a/tests/tests/templatetags/test_vite_asset_url.py b/tests/tests/templatetags/test_vite_asset_url.py index e0eef07..acfbdd2 100644 --- a/tests/tests/templatetags/test_vite_asset_url.py +++ b/tests/tests/templatetags/test_vite_asset_url.py @@ -1,7 +1,7 @@ import pytest from bs4 import BeautifulSoup from django.template import Context, Template -from django_vite.exceptions import DjangoViteAssetNotFoundError +from django_vite.core.exceptions import DjangoViteAssetNotFoundError def test_vite_asset_url_returns_dev_url(): diff --git a/tests/tests/templatetags/test_vite_legacy_asset.py b/tests/tests/templatetags/test_vite_legacy_asset.py index 4c2111a..aed8dc3 100644 --- a/tests/tests/templatetags/test_vite_legacy_asset.py +++ b/tests/tests/templatetags/test_vite_legacy_asset.py @@ -1,7 +1,7 @@ import pytest from bs4 import BeautifulSoup from django.template import Context, Template -from django_vite.exceptions import DjangoViteAssetNotFoundError +from django_vite.core.exceptions import DjangoViteAssetNotFoundError def test_vite_legacy_asset_returns_nothing_with_dev_mode_on(): diff --git a/tests/tests/templatetags/test_vite_legacy_polyfills.py b/tests/tests/templatetags/test_vite_legacy_polyfills.py index 409c032..70d1292 100644 --- a/tests/tests/templatetags/test_vite_legacy_polyfills.py +++ b/tests/tests/templatetags/test_vite_legacy_polyfills.py @@ -1,7 +1,7 @@ import pytest from bs4 import BeautifulSoup from django.template import Context, Template -from django_vite.exceptions import DjangoViteAssetNotFoundError +from django_vite.core.exceptions import DjangoViteAssetNotFoundError def test_vite_legacy_polyfills_returns_nothing_with_dev_mode_on(): diff --git a/tests/tests/templatetags/test_vite_preload_asset.py b/tests/tests/templatetags/test_vite_preload_asset.py index e8ec44a..fdebc19 100644 --- a/tests/tests/templatetags/test_vite_preload_asset.py +++ b/tests/tests/templatetags/test_vite_preload_asset.py @@ -1,7 +1,7 @@ import pytest from bs4 import BeautifulSoup from django.template import Context, Template -from django_vite.exceptions import DjangoViteAssetNotFoundError +from django_vite.core.exceptions import DjangoViteAssetNotFoundError def test_preload_vite_asset_returns_nothing_with_dev_mode_on(): diff --git a/tests/tests/test_asset_loader.py b/tests/tests/test_asset_loader.py index fe56a32..1b5085d 100644 --- a/tests/tests/test_asset_loader.py +++ b/tests/tests/test_asset_loader.py @@ -1,7 +1,7 @@ import pytest from contextlib import suppress -from django_vite.exceptions import DjangoViteManifestError +from django_vite.core.exceptions import DjangoViteManifestError from django_vite.templatetags.django_vite import DjangoViteAssetLoader from django_vite.apps import check_loader_instance