From 06adfcaf38a749e777f2349876127e64565296b6 Mon Sep 17 00:00:00 2001
From: Campbell Barton <campbell@blender.org>
Date: Fri, 19 Apr 2024 16:09:30 +1000
Subject: [PATCH] Cleanup: unused imports

---
 build_files/cmake/cmake_static_check_clang_array.py   | 3 ---
 build_files/utils/make_source_archive.py              | 1 -
 scripts/freestyle/modules/parameter_editor.py         | 5 ++---
 scripts/modules/bl_i18n_utils/utils_languages_menu.py | 3 ---
 tests/python/bl_blendfile_versioning.py               | 1 -
 tests/python/bl_node_field_type_inference.py          | 2 --
 tools/check_blender_release/check_release.py          | 3 ---
 tools/check_docs/check_docs_code_layout.py            | 2 --
 tools/check_source/check_spelling.py                  | 1 -
 tools/utils/gitea_inactive_developers.py              | 1 -
 10 files changed, 2 insertions(+), 20 deletions(-)

diff --git a/build_files/cmake/cmake_static_check_clang_array.py b/build_files/cmake/cmake_static_check_clang_array.py
index 02498893c91..13a833efe80 100644
--- a/build_files/cmake/cmake_static_check_clang_array.py
+++ b/build_files/cmake/cmake_static_check_clang_array.py
@@ -10,9 +10,6 @@ import os
 
 from typing import (
     Any,
-    Callable,
-    List,
-    Tuple,
 )
 
 
diff --git a/build_files/utils/make_source_archive.py b/build_files/utils/make_source_archive.py
index d5590e4bc00..b8964b38fd0 100755
--- a/build_files/utils/make_source_archive.py
+++ b/build_files/utils/make_source_archive.py
@@ -6,7 +6,6 @@
 import argparse
 import make_utils
 import os
-import re
 import subprocess
 import sys
 from pathlib import Path
diff --git a/scripts/freestyle/modules/parameter_editor.py b/scripts/freestyle/modules/parameter_editor.py
index d598c4a097e..14b03d0ab62 100644
--- a/scripts/freestyle/modules/parameter_editor.py
+++ b/scripts/freestyle/modules/parameter_editor.py
@@ -97,11 +97,10 @@ from _freestyle import (
 
 import time
 import bpy
-import random
 
 from mathutils import Vector
-from math import pi, sin, cos, acos, radians, atan2
-from itertools import cycle, tee
+from math import pi, sin, cos, acos, radians
+from itertools import cycle
 
 # WARNING: highly experimental, not a stable API
 # lists of callback functions
diff --git a/scripts/modules/bl_i18n_utils/utils_languages_menu.py b/scripts/modules/bl_i18n_utils/utils_languages_menu.py
index 89b411d3696..f15c59ad3ca 100755
--- a/scripts/modules/bl_i18n_utils/utils_languages_menu.py
+++ b/scripts/modules/bl_i18n_utils/utils_languages_menu.py
@@ -5,9 +5,6 @@
 # Update "languages" text file used by Blender at runtime to build translations menu.
 
 
-import os
-
-
 OK = 0
 MISSING = 1
 TOOLOW = 2
diff --git a/tests/python/bl_blendfile_versioning.py b/tests/python/bl_blendfile_versioning.py
index 6ceedb501f1..d47d3bc208e 100644
--- a/tests/python/bl_blendfile_versioning.py
+++ b/tests/python/bl_blendfile_versioning.py
@@ -53,7 +53,6 @@ class TestBlendFileOpenAllTestFiles(TestHelper):
                     yield dir_entry.path
 
     def test_open(self):
-        import subprocess
         blendfile_paths = [p for p in self.iter_blendfiles_from_directory(self.args.src_test_dir)]
         # `os.scandir()` used by `iter_blendfiles_from_directory` does not
         # guarantee any form of order.
diff --git a/tests/python/bl_node_field_type_inference.py b/tests/python/bl_node_field_type_inference.py
index e38ece23410..4fc37f99009 100644
--- a/tests/python/bl_node_field_type_inference.py
+++ b/tests/python/bl_node_field_type_inference.py
@@ -6,8 +6,6 @@ import pathlib
 import sys
 import unittest
 import tempfile
-import math
-from dataclasses import dataclass
 
 import bpy
 
diff --git a/tools/check_blender_release/check_release.py b/tools/check_blender_release/check_release.py
index 92e6943d3f7..d1a45c56d4e 100755
--- a/tools/check_blender_release/check_release.py
+++ b/tools/check_blender_release/check_release.py
@@ -5,9 +5,6 @@
 
 # Usage: ./check_release.py -- ../path/to/release/folder
 
-
-import os
-import sys
 import unittest
 
 import check_module_enabled
diff --git a/tools/check_docs/check_docs_code_layout.py b/tools/check_docs/check_docs_code_layout.py
index 09d07c95f57..627c09eb243 100644
--- a/tools/check_docs/check_docs_code_layout.py
+++ b/tools/check_docs/check_docs_code_layout.py
@@ -16,13 +16,11 @@ check_docs_code_layout.py --markdown=markdown.txt
 """
 
 import os
-import re
 import argparse
 
 from typing import (
     List,
     Optional,
-    Tuple,
 )
 
 
diff --git a/tools/check_source/check_spelling.py b/tools/check_source/check_spelling.py
index 99f265c67ce..8286789d35a 100755
--- a/tools/check_source/check_spelling.py
+++ b/tools/check_source/check_spelling.py
@@ -308,7 +308,6 @@ class Comment:
 
 
 def extract_code_strings(filepath: str) -> Tuple[List[Comment], Set[str]]:
-    import pygments
     from pygments import lexers
     from pygments.token import Token
 
diff --git a/tools/utils/gitea_inactive_developers.py b/tools/utils/gitea_inactive_developers.py
index bbd5698e416..498b9fe4872 100755
--- a/tools/utils/gitea_inactive_developers.py
+++ b/tools/utils/gitea_inactive_developers.py
@@ -11,7 +11,6 @@
 # * 403 Client Error: That means the token doesn't have the right scope.
 # * 500 Server Error: The token is invalid.
 
-import csv
 import logging
 import os
 import requests
-- 
GitLab