From 9e455662cdc66bcf40e8108e11da3cc80a0aebd5 Mon Sep 17 00:00:00 2001
From: Brandon Rodriguez <brodriguez8774@gmail.com>
Date: Wed, 7 Sep 2022 12:28:09 -0400
Subject: [PATCH] Clean up project imports

---
 django_dump_die/constants.py             |  7 ++++---
 django_dump_die/middleware.py            |  3 +++
 django_dump_die/templatetags/dump_die.py |  5 +++--
 django_dump_die/utils.py                 | 15 ++++++++-------
 django_dump_die/views/dd_view.py         |  2 +-
 django_dump_die/views/example_helpers.py |  1 +
 tests/settings.py                        |  4 ++++
 tests/test_views/test_complex_type.py    |  3 ++-
 tests/test_views/test_simple_type.py     |  2 --
 tests/views.py                           |  6 +++++-
 10 files changed, 31 insertions(+), 17 deletions(-)

diff --git a/django_dump_die/constants.py b/django_dump_die/constants.py
index d8b64b2..1ad6646 100644
--- a/django_dump_die/constants.py
+++ b/django_dump_die/constants.py
@@ -1,15 +1,16 @@
 """Constants for dump die"""
 
+# System Imports.
 import datetime
 import types
-
 from decimal import Decimal
+from pathlib import PosixPath, PurePath, PurePosixPath, PureWindowsPath
+
+# Third-Party Imports.
 from django.conf import settings
 from django.forms.boundfield import BoundField
 from django.utils import timezone
 
-from pathlib import PosixPath, PurePath, PurePosixPath, PureWindowsPath
-
 # Imports that may not be accessible, depending on local python environment setup.
 try:
     import pytz
diff --git a/django_dump_die/middleware.py b/django_dump_die/middleware.py
index 2b1d7b0..5ae04ae 100644
--- a/django_dump_die/middleware.py
+++ b/django_dump_die/middleware.py
@@ -2,10 +2,13 @@
 Middleware for DumpAndDie.
 """
 
+# System Imports.
 import logging
 
+# Third-Party Imports.
 from django.conf import settings
 
+# Internal Imports.
 from .views import dd_view
 from django_dump_die.utils import get_dumped_object_info
 
diff --git a/django_dump_die/templatetags/dump_die.py b/django_dump_die/templatetags/dump_die.py
index 0048041..b4d4ad7 100644
--- a/django_dump_die/templatetags/dump_die.py
+++ b/django_dump_die/templatetags/dump_die.py
@@ -1,14 +1,16 @@
 """Template Tags for DumpDie"""
 
+# System Imports.
 import inspect
 import re
 import types
-
 from decimal import Decimal
 
+# Third-Party Imports.
 from django import template
 from django.forms.boundfield import BoundField
 
+# Internal Imports.
 from django_dump_die.constants import (
     SIMPLE_TYPES,
     INTERMEDIATE_TYPES,
@@ -26,7 +28,6 @@ from django_dump_die.constants import (
     INCLUDE_FUNCTIONS,
     PYTZ_PRESENT,
 )
-
 from django_dump_die.utils import (
     get_dumped_object_info,
     generate_unique_from_obj,
diff --git a/django_dump_die/utils.py b/django_dump_die/utils.py
index 1ae450b..d033b94 100644
--- a/django_dump_die/utils.py
+++ b/django_dump_die/utils.py
@@ -1,12 +1,15 @@
 """Utils for dump die"""
 
+# System Imports.
 import copy
 import inspect
-import linecache
-import tokenize
-
 import io
+import linecache
 import re
+import tokenize
+from collections.abc import Sequence
+from decimal import Decimal
+from enum import EnumMeta
 from tokenize import (
     generate_tokens,
     ENDMARKER,
@@ -17,13 +20,11 @@ from tokenize import (
     STRING,
 )
 
-from collections.abc import Sequence
-from decimal import Decimal
-from enum import EnumMeta
-
+# Third-Party Imports.
 from django.core.exceptions import ObjectDoesNotExist
 from django.http import QueryDict
 
+# Internal Imports.
 from django_dump_die.constants import COLORIZE_DUMPED_OBJECT_NAME, INCLUDE_FILENAME_LINENUMBER, PYTZ_PRESENT
 
 # Imports that may not be accessible, depending on local python environment setup.
diff --git a/django_dump_die/views/dd_view.py b/django_dump_die/views/dd_view.py
index 2ad4ad7..872a506 100644
--- a/django_dump_die/views/dd_view.py
+++ b/django_dump_die/views/dd_view.py
@@ -1,6 +1,6 @@
 """Core view for DumpDie library. All logic renders from this."""
 
-
+# Third-Party Imports.
 from django.conf import settings
 from django.shortcuts import render
 
diff --git a/django_dump_die/views/example_helpers.py b/django_dump_die/views/example_helpers.py
index 693f470..777c68b 100644
--- a/django_dump_die/views/example_helpers.py
+++ b/django_dump_die/views/example_helpers.py
@@ -26,6 +26,7 @@ from django.utils import timezone
 # Internal Imports.
 from django_dump_die.constants import PYTZ_PRESENT, ZONEINFO_PRESENT
 
+# Imports that may not be accessible, depending on local python environment setup.
 if PYTZ_PRESENT:
     import pytz
 if ZONEINFO_PRESENT:
diff --git a/tests/settings.py b/tests/settings.py
index 1bbb6d8..4718f52 100644
--- a/tests/settings.py
+++ b/tests/settings.py
@@ -1,4 +1,8 @@
+"""
+Project testing settings, so that tests can run project as if it was a proper Django application.
+"""
 
+# System Imports.
 import sys
 
 
diff --git a/tests/test_views/test_complex_type.py b/tests/test_views/test_complex_type.py
index 3312b2c..8c96b78 100644
--- a/tests/test_views/test_complex_type.py
+++ b/tests/test_views/test_complex_type.py
@@ -2,10 +2,11 @@
 Tests for "complex" type DD output.
 """
 
+# System Imports.
+from unittest.mock import patch
 
 # Third-Party Imports.
 from django.test import override_settings
-from unittest.mock import patch
 from django_expanded_test_cases import IntegrationTestCase
 
 
diff --git a/tests/test_views/test_simple_type.py b/tests/test_views/test_simple_type.py
index ef42a56..cdc5798 100644
--- a/tests/test_views/test_simple_type.py
+++ b/tests/test_views/test_simple_type.py
@@ -4,8 +4,6 @@ Tests for "simple" type DD output.
 
 # Third-Party Imports.
 from django.test import override_settings
-
-# Internal Imports.
 from django_expanded_test_cases import IntegrationTestCase
 
 
diff --git a/tests/views.py b/tests/views.py
index 170a56e..84a7ed0 100644
--- a/tests/views.py
+++ b/tests/views.py
@@ -1,8 +1,12 @@
 """Views for testing DumpDie"""
+
+# System Imports.
 from decimal import Decimal
-from django.http import HttpResponse
 from types import ModuleType
 
+# Third-Party Imports.
+from django.http import HttpResponse
+
 
 def function_example(request):
     """Function Type Example Test View."""
-- 
GitLab