diff --git a/src/bcf/bcf/v2/model/extensions.py b/src/bcf/bcf/v2/model/extensions.py
index e50277570e..695027bc6c 100644
--- a/src/bcf/bcf/v2/model/extensions.py
+++ b/src/bcf/bcf/v2/model/extensions.py
@@ -14,7 +14,7 @@
# Currently extensions support for v2 is only read-only.
-from dataclasses import dataclass, field, fields
+from dataclasses import dataclass, field
from typing import Optional
diff --git a/src/bcf/bcf/v2/topic.py b/src/bcf/bcf/v2/topic.py
index 30506d734d..2f69a0c18a 100644
--- a/src/bcf/bcf/v2/topic.py
+++ b/src/bcf/bcf/v2/topic.py
@@ -3,11 +3,10 @@
from __future__ import annotations
import datetime
-import tempfile
import uuid
import zipfile
from pathlib import Path
-from typing import Any, NoReturn, Optional, Union
+from typing import Any, NoReturn, Optional
import numpy as np
from ifcopenshell import entity_instance
diff --git a/src/bcf/bcf/v2/visinfo.py b/src/bcf/bcf/v2/visinfo.py
index 1d081ae782..7081bf2052 100644
--- a/src/bcf/bcf/v2/visinfo.py
+++ b/src/bcf/bcf/v2/visinfo.py
@@ -1,7 +1,7 @@
import uuid
import zipfile
from collections.abc import Iterable
-from typing import Any, Literal, Optional, Union
+from typing import Literal, Optional, Union
import ifcopenshell.util.placement
import ifcopenshell.util.unit
diff --git a/src/bcf/bcf/v3/bcfapi.py b/src/bcf/bcf/v3/bcfapi.py
index 5c66cee067..127d9e3732 100644
--- a/src/bcf/bcf/v3/bcfapi.py
+++ b/src/bcf/bcf/v3/bcfapi.py
@@ -24,7 +24,6 @@ import time
import urllib.parse
import uuid
import webbrowser
-from re import A
from typing import Any, Optional
import requests
diff --git a/src/bcf/bcf/v3/document.py b/src/bcf/bcf/v3/document.py
index afc6be50b9..d906b96d26 100644
--- a/src/bcf/bcf/v3/document.py
+++ b/src/bcf/bcf/v3/document.py
@@ -1,7 +1,7 @@
"""BCF XML V3 Documents handler."""
import zipfile
-from typing import Any, Optional
+from typing import Optional
import bcf.v3.model as mdl
from bcf.inmemory_zipfile import ZipFileInterface
diff --git a/src/bcf/bcf/v3/visinfo.py b/src/bcf/bcf/v3/visinfo.py
index 050641ed23..b3b99d7890 100644
--- a/src/bcf/bcf/v3/visinfo.py
+++ b/src/bcf/bcf/v3/visinfo.py
@@ -1,7 +1,7 @@
import uuid
import zipfile
from collections.abc import Iterable
-from typing import Any, Literal, Optional, Union
+from typing import Literal, Optional, Union
import ifcopenshell.util.placement
import ifcopenshell.util.unit
diff --git a/src/bcf/pyproject.toml b/src/bcf/pyproject.toml
index 7047595ce1..b4e990f39c 100644
--- a/src/bcf/pyproject.toml
+++ b/src/bcf/pyproject.toml
@@ -140,3 +140,9 @@ max-attributes = 10
[tool.pylint.format]
expected-line-ending-format = "LF"
max-line-length = 120
+
+[tool.ruff]
+extend = "../../pyproject.toml"
+lint.select = [
+ "F401", # unused imports
+]
diff --git a/src/bcf/tests/v3/test_example_files.py b/src/bcf/tests/v3/test_example_files.py
index 6774c49982..c25a3f3f7e 100644
--- a/src/bcf/tests/v3/test_example_files.py
+++ b/src/bcf/tests/v3/test_example_files.py
@@ -1,11 +1,9 @@
-import json
import os
import zipfile
from pathlib import Path
import bcf.v3.model as mdl
from bcf.v3.bcfxml import BcfXml
-from bcf.v3.topic import TopicHandler
from xsdata.models.datatype import XmlDateTime
diff --git a/src/bsdd/bsdd.py b/src/bsdd/bsdd.py
index ff633095bf..fbc14cc393 100644
--- a/src/bsdd/bsdd.py
+++ b/src/bsdd/bsdd.py
@@ -984,7 +984,6 @@ class Client:
def apply_ifc_classification_properties(
ifc_file: ifcopenshell.file, element: ifcopenshell.entity_instance, classificationProperties: dict[str, Any]
) -> None:
- import ifcopenshell.api
import ifcopenshell.api.pset
import ifcopenshell.util.element
diff --git a/src/bsdd/pyproject.toml b/src/bsdd/pyproject.toml
index d64d667a20..17fa72f37a 100644
--- a/src/bsdd/pyproject.toml
+++ b/src/bsdd/pyproject.toml
@@ -43,3 +43,9 @@ Issues = "https://github.com/IfcOpenShell/IfcOpenShell/issues"
[tool.setuptools]
py-modules = ["bsdd","bsdd_json","type_hints"]
+
+[tool.ruff]
+extend = "../../pyproject.toml"
+lint.select = [
+ "F401", # unused imports
+]
diff --git a/src/ifc4d/__main__.py b/src/ifc4d/__main__.py
index 8313ba7464..b876db860c 100644
--- a/src/ifc4d/__main__.py
+++ b/src/ifc4d/__main__.py
@@ -1,6 +1,4 @@
import argparse
-import os
-import sys
import ifcopenshell
from ifc4d.msp2ifc import MSP2Ifc
diff --git a/src/ifc4d/ifc4d/common.py b/src/ifc4d/ifc4d/common.py
index f4fd42e1d1..296b8f36cb 100644
--- a/src/ifc4d/ifc4d/common.py
+++ b/src/ifc4d/ifc4d/common.py
@@ -4,11 +4,9 @@ from datetime import date, datetime, timedelta
from typing import Any, TypedDict, Union
import ifcopenshell
-import ifcopenshell.api
import ifcopenshell.api.control
import ifcopenshell.api.resource
import ifcopenshell.api.sequence
-import ifcopenshell.util.date
from typing_extensions import NotRequired
diff --git a/src/ifc4d/ifc4d/csv2ifc.py b/src/ifc4d/ifc4d/csv2ifc.py
index 6efbf4fad6..a908acdb53 100644
--- a/src/ifc4d/ifc4d/csv2ifc.py
+++ b/src/ifc4d/ifc4d/csv2ifc.py
@@ -24,7 +24,6 @@ import datetime
from typing import Any, Literal, NamedTuple, Optional, Union, cast, get_args
import ifcopenshell
-import ifcopenshell.api
import ifcopenshell.api.cost
import ifcopenshell.api.pset
import ifcopenshell.api.resource
@@ -33,7 +32,6 @@ import ifcopenshell.api.unit
import ifcopenshell.util.date
import ifcopenshell.util.element
import ifcopenshell.util.resource
-import ifcopenshell.util.unit
import isodate
SUPPORTED_COLUMN = Literal[
diff --git a/src/ifc4d/ifc4d/csv4d2ifc.py b/src/ifc4d/ifc4d/csv4d2ifc.py
index 2e519cc0ea..4247a06bbc 100644
--- a/src/ifc4d/ifc4d/csv4d2ifc.py
+++ b/src/ifc4d/ifc4d/csv4d2ifc.py
@@ -22,7 +22,6 @@ import locale
import re
import ifcopenshell
-import ifcopenshell.api
import ifcopenshell.api.root
import ifcopenshell.api.sequence
import ifcopenshell.util.date
diff --git a/src/ifc4d/ifc4d/ifc2p6.py b/src/ifc4d/ifc4d/ifc2p6.py
index 5093f306be..9294e91cbf 100644
--- a/src/ifc4d/ifc4d/ifc2p6.py
+++ b/src/ifc4d/ifc4d/ifc2p6.py
@@ -24,7 +24,6 @@ import ifcopenshell
import ifcopenshell.util.date
import ifcopenshell.util.sequence
-from .common import ScheduleIfcGenerator
class Ifc2P6:
diff --git a/src/ifc4d/ifc4d/msp2ifc.py b/src/ifc4d/ifc4d/msp2ifc.py
index 3ba14a6985..91ae683c84 100644
--- a/src/ifc4d/ifc4d/msp2ifc.py
+++ b/src/ifc4d/ifc4d/msp2ifc.py
@@ -18,10 +18,9 @@
import datetime
import xml.etree.ElementTree as ET
-from datetime import date, timedelta
+from datetime import timedelta
import ifcopenshell
-import ifcopenshell.api
import ifcopenshell.api.control
import ifcopenshell.api.pset
import ifcopenshell.api.root
diff --git a/src/ifc4d/ifc4d/p62ifc.py b/src/ifc4d/ifc4d/p62ifc.py
index 833bf39dd3..ed2781d5cc 100644
--- a/src/ifc4d/ifc4d/p62ifc.py
+++ b/src/ifc4d/ifc4d/p62ifc.py
@@ -17,12 +17,8 @@
# along with Ifc4D. If not, see .
import datetime
-import math
import xml.etree.ElementTree as ET
-import ifcopenshell
-import ifcopenshell.api
-import ifcopenshell.util.date
from .common import ScheduleIfcGenerator
diff --git a/src/ifc4d/ifc4d/p6xer2ifc.py b/src/ifc4d/ifc4d/p6xer2ifc.py
index ef218ade2d..935634767d 100644
--- a/src/ifc4d/ifc4d/p6xer2ifc.py
+++ b/src/ifc4d/ifc4d/p6xer2ifc.py
@@ -16,11 +16,7 @@
# You should have received a copy of the GNU Lesser General Public License
# along with Ifc4D. If not, see .
-from datetime import date, datetime, timedelta
-import ifcopenshell
-import ifcopenshell.api
-import ifcopenshell.util.date
from xerparser.reader import Reader
from .common import ScheduleIfcGenerator
diff --git a/src/ifc4d/ifc4d/pp2ifc.py b/src/ifc4d/ifc4d/pp2ifc.py
index 338a887e91..ce76b60226 100644
--- a/src/ifc4d/ifc4d/pp2ifc.py
+++ b/src/ifc4d/ifc4d/pp2ifc.py
@@ -12,7 +12,6 @@ from collections import defaultdict
from datetime import timedelta
from typing import Any
-import ifcopenshell.util.date
from .common import Activity, Calendar, ScheduleIfcGenerator, WBSEntry
from .wpattern import AstaCalendarWorkPattern
diff --git a/src/ifc4d/pyproject.toml b/src/ifc4d/pyproject.toml
index 6bb2cc9f22..bbc101905a 100644
--- a/src/ifc4d/pyproject.toml
+++ b/src/ifc4d/pyproject.toml
@@ -28,3 +28,9 @@ Issues = "https://github.com/IfcOpenShell/IfcOpenShell/issues"
[tool.setuptools.packages.find]
include = ["ifc4d"]
exclude = ["test*"]
+
+[tool.ruff]
+extend = "../../pyproject.toml"
+lint.select = [
+ "F401", # unused imports
+]
diff --git a/src/ifc5d/ifc5d/csv2ifc.py b/src/ifc5d/ifc5d/csv2ifc.py
index b1edd82d88..c33d6e847e 100644
--- a/src/ifc5d/ifc5d/csv2ifc.py
+++ b/src/ifc5d/ifc5d/csv2ifc.py
@@ -24,7 +24,6 @@ from pathlib import Path
from typing import Optional, TypedDict, Union
import ifcopenshell
-import ifcopenshell.api
import ifcopenshell.api.control
import ifcopenshell.api.cost
import ifcopenshell.api.root
diff --git a/src/ifc5d/ifc5d/ifc5Dspreadsheet.py b/src/ifc5d/ifc5d/ifc5Dspreadsheet.py
index 324340fb1c..5aab765c26 100644
--- a/src/ifc5d/ifc5d/ifc5Dspreadsheet.py
+++ b/src/ifc5d/ifc5d/ifc5Dspreadsheet.py
@@ -25,7 +25,7 @@ import logging
import os
import time
from collections import Counter
-from typing import Any, Optional, TypedDict, Union
+from typing import Optional, TypedDict, Union
import ifcopenshell
import ifcopenshell.util.cost
@@ -420,7 +420,7 @@ class Ifc5DCsvWriter(Ifc5Dwriter):
class Ifc5DOdsWriter(Ifc5Dwriter):
def write(self) -> None:
- from odf.number import CurrencyStyle, CurrencySymbol, Number, NumberStyle, Text
+ from odf.number import CurrencyStyle, CurrencySymbol, Number
from odf.opendocument import OpenDocumentSpreadsheet
from odf.style import Style, TableCellProperties
@@ -450,7 +450,7 @@ class Ifc5DOdsWriter(Ifc5Dwriter):
self.doc.save(os.path.join(self.output, file_name), True)
def write_table(self, cost_schedule):
- from odf.number import CurrencyStyle, CurrencySymbol, Number, NumberStyle, Text
+ from odf.number import CurrencySymbol, Number
from odf.table import Table, TableCell, TableRow
from odf.text import P
diff --git a/src/ifc5d/ifc5d/qto.py b/src/ifc5d/ifc5d/qto.py
index f7fba8d9e5..955c6fd7af 100644
--- a/src/ifc5d/ifc5d/qto.py
+++ b/src/ifc5d/ifc5d/qto.py
@@ -27,7 +27,6 @@ from collections.abc import Iterable
from typing import Any, Literal, NamedTuple, Union, get_args
import ifcopenshell
-import ifcopenshell.api
import ifcopenshell.api.pset
import ifcopenshell.geom
import ifcopenshell.ifcopenshell_wrapper as W
@@ -35,7 +34,6 @@ import ifcopenshell.util.element
import ifcopenshell.util.representation
import ifcopenshell.util.selector
import ifcopenshell.util.shape
-import ifcopenshell.util.type
import ifcopenshell.util.unit
diff --git a/src/ifc5d/pyproject.toml b/src/ifc5d/pyproject.toml
index 4d89b8a108..8d51a63819 100644
--- a/src/ifc5d/pyproject.toml
+++ b/src/ifc5d/pyproject.toml
@@ -35,3 +35,9 @@ exclude = ["test*"]
[tool.setuptools.package-data]
"*" = ["*.*"]
+
+[tool.ruff]
+extend = "../../pyproject.toml"
+lint.select = [
+ "F401", # unused imports
+]
diff --git a/src/ifc5d/test/test_csv2ifc.py b/src/ifc5d/test/test_csv2ifc.py
index 7dc1bbd718..fc31e9d86e 100644
--- a/src/ifc5d/test/test_csv2ifc.py
+++ b/src/ifc5d/test/test_csv2ifc.py
@@ -26,7 +26,6 @@ import ifcopenshell
import ifcopenshell.api.root
import ifcopenshell.api.unit
import ifcopenshell.util.cost
-import ifcopenshell.util.element
import pytest
diff --git a/src/ifccsv/ifccsv.py b/src/ifccsv/ifccsv.py
index 341fa186e7..f6d3157f81 100755
--- a/src/ifccsv/ifccsv.py
+++ b/src/ifccsv/ifccsv.py
@@ -29,14 +29,11 @@ from statistics import mean
from typing import Literal, Optional, Union
import ifcopenshell
-import ifcopenshell.util.element
-import ifcopenshell.util.schema
import ifcopenshell.util.selector
try:
from odf.namespaces import OFFICENS
- from odf.opendocument import OpenDocumentSpreadsheet, load
- from odf.style import Style, TableCellProperties
+ from odf.opendocument import load
from odf.table import Table, TableCell, TableRow
from odf.text import P
except:
diff --git a/src/ifccsv/pyproject.toml b/src/ifccsv/pyproject.toml
index 4485d411e5..c012decd23 100644
--- a/src/ifccsv/pyproject.toml
+++ b/src/ifccsv/pyproject.toml
@@ -26,3 +26,9 @@ Issues = "https://github.com/IfcOpenShell/IfcOpenShell/issues"
[tool.setuptools]
py-modules = ["ifccsv"]
+
+[tool.ruff]
+extend = "../../pyproject.toml"
+lint.select = [
+ "F401", # unused imports
+]
diff --git a/src/ifcpatch/bootstrap.py b/src/ifcpatch/bootstrap.py
index 368d7b5cff..b4fd470b49 100644
--- a/src/ifcpatch/bootstrap.py
+++ b/src/ifcpatch/bootstrap.py
@@ -16,11 +16,4 @@
# You should have received a copy of the GNU Lesser General Public License
# along with IfcPatch. If not, see .
-import ifcopenshell.util.element
-import ifcopenshell.util.schema
-import ifcopenshell.util.selector
-import ifcpatch.__main__
-import ifcpatch.recipes
-import toposort
-import ifcpatch
diff --git a/src/ifcpatch/ifcpatch/__init__.py b/src/ifcpatch/ifcpatch/__init__.py
index 7ea668d55e..c279bfea1c 100644
--- a/src/ifcpatch/ifcpatch/__init__.py
+++ b/src/ifcpatch/ifcpatch/__init__.py
@@ -18,7 +18,6 @@
# You should have received a copy of the GNU Lesser General Public License
# along with IfcPatch. If not, see .
-import collections
import importlib
import importlib.util
import inspect
diff --git a/src/ifcpatch/ifcpatch/recipes/AGS2IFC.py b/src/ifcpatch/ifcpatch/recipes/AGS2IFC.py
index 8067d2e718..d24aec34e4 100644
--- a/src/ifcpatch/ifcpatch/recipes/AGS2IFC.py
+++ b/src/ifcpatch/ifcpatch/recipes/AGS2IFC.py
@@ -19,9 +19,7 @@
import csv
import os
-from itertools import cycle
-import ifcopenshell
import ifcopenshell.api.aggregate
import ifcopenshell.api.context
import ifcopenshell.api.document
diff --git a/src/ifcpatch/ifcpatch/recipes/AddGeometricRepresentationToAlignment.py b/src/ifcpatch/ifcpatch/recipes/AddGeometricRepresentationToAlignment.py
index 65f48f899d..8045490181 100644
--- a/src/ifcpatch/ifcpatch/recipes/AddGeometricRepresentationToAlignment.py
+++ b/src/ifcpatch/ifcpatch/recipes/AddGeometricRepresentationToAlignment.py
@@ -16,7 +16,6 @@
# You should have received a copy of the GNU Lesser General Public License
# along with IfcPatch. If not, see .
-import typing
from logging import Logger
from typing import Union
diff --git a/src/ifcpatch/ifcpatch/recipes/AddLinearPlacementFallbackPosition.py b/src/ifcpatch/ifcpatch/recipes/AddLinearPlacementFallbackPosition.py
index 9ec3f52a6a..c659c38c64 100644
--- a/src/ifcpatch/ifcpatch/recipes/AddLinearPlacementFallbackPosition.py
+++ b/src/ifcpatch/ifcpatch/recipes/AddLinearPlacementFallbackPosition.py
@@ -16,7 +16,6 @@
# You should have received a copy of the GNU Lesser General Public License
# along with IfcPatch. If not, see .
-import typing
from logging import Logger
from typing import Union
diff --git a/src/ifcpatch/ifcpatch/recipes/AddZeroLengthSegmentToAlignment.py b/src/ifcpatch/ifcpatch/recipes/AddZeroLengthSegmentToAlignment.py
index e1f6664cd0..d92f794959 100644
--- a/src/ifcpatch/ifcpatch/recipes/AddZeroLengthSegmentToAlignment.py
+++ b/src/ifcpatch/ifcpatch/recipes/AddZeroLengthSegmentToAlignment.py
@@ -16,7 +16,6 @@
# You should have received a copy of the GNU Lesser General Public License
# along with IfcPatch. If not, see .
-import typing
from logging import Logger
from typing import Union
diff --git a/src/ifcpatch/ifcpatch/recipes/ConvertLengthUnit.py b/src/ifcpatch/ifcpatch/recipes/ConvertLengthUnit.py
index 6b3554b192..3b5774bfcb 100644
--- a/src/ifcpatch/ifcpatch/recipes/ConvertLengthUnit.py
+++ b/src/ifcpatch/ifcpatch/recipes/ConvertLengthUnit.py
@@ -21,10 +21,6 @@ from logging import Logger
from typing import Union
import ifcopenshell
-import ifcopenshell.api
-import ifcopenshell.api.owner.settings
-import ifcopenshell.util.element
-import ifcopenshell.util.pset
import ifcopenshell.util.unit
import ifcpatch
diff --git a/src/ifcpatch/ifcpatch/recipes/ConvertNestToAggregate.py b/src/ifcpatch/ifcpatch/recipes/ConvertNestToAggregate.py
index 8471ed28f3..0d10de9bae 100644
--- a/src/ifcpatch/ifcpatch/recipes/ConvertNestToAggregate.py
+++ b/src/ifcpatch/ifcpatch/recipes/ConvertNestToAggregate.py
@@ -16,7 +16,6 @@
# You should have received a copy of the GNU Lesser General Public License
# along with IfcPatch. If not, see .
-import ifcopenshell
import ifcopenshell.guid
diff --git a/src/ifcpatch/ifcpatch/recipes/ConvertPropertiesToQuantities.py b/src/ifcpatch/ifcpatch/recipes/ConvertPropertiesToQuantities.py
index a9df2c93c4..3b3b54cac4 100644
--- a/src/ifcpatch/ifcpatch/recipes/ConvertPropertiesToQuantities.py
+++ b/src/ifcpatch/ifcpatch/recipes/ConvertPropertiesToQuantities.py
@@ -20,9 +20,7 @@ from logging import Logger
from typing import Union
import ifcopenshell
-import ifcopenshell.api
import ifcopenshell.api.pset
-import ifcopenshell.util.element
import ifcopenshell.util.pset
diff --git a/src/ifcpatch/ifcpatch/recipes/DowngradeIndexedPolyCurve.py b/src/ifcpatch/ifcpatch/recipes/DowngradeIndexedPolyCurve.py
index ea169f2967..4ae36f26b8 100644
--- a/src/ifcpatch/ifcpatch/recipes/DowngradeIndexedPolyCurve.py
+++ b/src/ifcpatch/ifcpatch/recipes/DowngradeIndexedPolyCurve.py
@@ -16,7 +16,6 @@
# You should have received a copy of the GNU Lesser General Public License
# along with IfcPatch. If not, see .
-import ifcopenshell
import ifcopenshell.util.element
diff --git a/src/ifcpatch/ifcpatch/recipes/ExtractElements.py b/src/ifcpatch/ifcpatch/recipes/ExtractElements.py
index 31f1fb4140..6f88f820be 100644
--- a/src/ifcpatch/ifcpatch/recipes/ExtractElements.py
+++ b/src/ifcpatch/ifcpatch/recipes/ExtractElements.py
@@ -20,7 +20,6 @@ from logging import Logger
from typing import Union
import ifcopenshell
-import ifcopenshell.api
import ifcopenshell.api.project
import ifcopenshell.guid
import ifcopenshell.util.selector
diff --git a/src/ifcpatch/ifcpatch/recipes/ExtractPropertiesToSQLite.py b/src/ifcpatch/ifcpatch/recipes/ExtractPropertiesToSQLite.py
index 5df98c4ab4..634a8fb796 100644
--- a/src/ifcpatch/ifcpatch/recipes/ExtractPropertiesToSQLite.py
+++ b/src/ifcpatch/ifcpatch/recipes/ExtractPropertiesToSQLite.py
@@ -17,13 +17,8 @@
# along with IfcPatch. If not, see .
-import json
-import os
-import re
import tempfile
-import time
-import ifcopenshell
import ifcopenshell.util.element
try:
diff --git a/src/ifcpatch/ifcpatch/recipes/FixArchiCADToRevitDoorSwings.py b/src/ifcpatch/ifcpatch/recipes/FixArchiCADToRevitDoorSwings.py
index cf602bab0a..c2523c7e8f 100644
--- a/src/ifcpatch/ifcpatch/recipes/FixArchiCADToRevitDoorSwings.py
+++ b/src/ifcpatch/ifcpatch/recipes/FixArchiCADToRevitDoorSwings.py
@@ -18,8 +18,6 @@
import logging
-import math
-import os
from typing import Union
import ifcopenshell
diff --git a/src/ifcpatch/ifcpatch/recipes/FixArchiCADToRevitSpaces.py b/src/ifcpatch/ifcpatch/recipes/FixArchiCADToRevitSpaces.py
index c6ea871c7b..2245f8c0df 100644
--- a/src/ifcpatch/ifcpatch/recipes/FixArchiCADToRevitSpaces.py
+++ b/src/ifcpatch/ifcpatch/recipes/FixArchiCADToRevitSpaces.py
@@ -18,7 +18,6 @@
import logging
-import ifcopenshell
class Patcher:
@@ -70,7 +69,6 @@ class Patcher:
def patch(self) -> None:
import bonsai.tool as tool
import bpy
- import ifcopenshell
import ifcopenshell.util.element
from mathutils import Matrix, Vector
diff --git a/src/ifcpatch/ifcpatch/recipes/FixRevit2025TINs.py b/src/ifcpatch/ifcpatch/recipes/FixRevit2025TINs.py
index d6dc49be18..642afb6e8c 100644
--- a/src/ifcpatch/ifcpatch/recipes/FixRevit2025TINs.py
+++ b/src/ifcpatch/ifcpatch/recipes/FixRevit2025TINs.py
@@ -21,9 +21,7 @@ import logging
from typing import Optional
import ifcopenshell
-import ifcopenshell.util.schema
import ifcopenshell.util.shape_builder
-import ifcopenshell.util.unit
class Patcher:
@@ -167,8 +165,6 @@ class Patcher:
import bpy
import ifcopenshell.api.geometry
import ifcopenshell.api.root
- import ifcopenshell.api.spatial
- import ifcopenshell.api.type
import ifcopenshell.util.element
import ifcopenshell.util.representation
@@ -234,11 +230,8 @@ class Patcher:
import bmesh
import bonsai.tool as tool
- import bpy
import ifcopenshell.api.geometry
import ifcopenshell.api.root
- import ifcopenshell.api.spatial
- import ifcopenshell.api.type
import ifcopenshell.util.element
import ifcopenshell.util.representation
@@ -284,11 +277,8 @@ class Patcher:
import bmesh
import bonsai.tool as tool
- import bpy
import ifcopenshell.api.geometry
import ifcopenshell.api.root
- import ifcopenshell.api.spatial
- import ifcopenshell.api.type
import ifcopenshell.util.element
import ifcopenshell.util.representation
from mathutils import Matrix
diff --git a/src/ifcpatch/ifcpatch/recipes/FixRevitClassificationCodeTypes.py b/src/ifcpatch/ifcpatch/recipes/FixRevitClassificationCodeTypes.py
index 1ec5b331de..1ec871160a 100644
--- a/src/ifcpatch/ifcpatch/recipes/FixRevitClassificationCodeTypes.py
+++ b/src/ifcpatch/ifcpatch/recipes/FixRevitClassificationCodeTypes.py
@@ -16,7 +16,6 @@
# You should have received a copy of the GNU Lesser General Public License
# along with IfcPatch. If not, see .
-import ifcopenshell
import ifcopenshell.util.element
diff --git a/src/ifcpatch/ifcpatch/recipes/FixRevitTINs.py b/src/ifcpatch/ifcpatch/recipes/FixRevitTINs.py
index 872b1a0091..4d2eb030d5 100644
--- a/src/ifcpatch/ifcpatch/recipes/FixRevitTINs.py
+++ b/src/ifcpatch/ifcpatch/recipes/FixRevitTINs.py
@@ -19,7 +19,6 @@
import logging
-import ifcopenshell
class Patcher:
diff --git a/src/ifcpatch/ifcpatch/recipes/Ifc2Sql.py b/src/ifcpatch/ifcpatch/recipes/Ifc2Sql.py
index 74744f3487..f7e294898a 100644
--- a/src/ifcpatch/ifcpatch/recipes/Ifc2Sql.py
+++ b/src/ifcpatch/ifcpatch/recipes/Ifc2Sql.py
@@ -21,9 +21,7 @@ import itertools
import json
import logging
import multiprocessing
-import os
import re
-import tempfile
import time
import typing
from pathlib import Path
diff --git a/src/ifcpatch/ifcpatch/recipes/MergeDuplicateTypes.py b/src/ifcpatch/ifcpatch/recipes/MergeDuplicateTypes.py
index 2c8385066b..38b01135b3 100644
--- a/src/ifcpatch/ifcpatch/recipes/MergeDuplicateTypes.py
+++ b/src/ifcpatch/ifcpatch/recipes/MergeDuplicateTypes.py
@@ -20,7 +20,6 @@ from logging import Logger
from typing import Any
import ifcopenshell
-import ifcopenshell.api
import ifcopenshell.api.type
import ifcopenshell.util.element
diff --git a/src/ifcpatch/ifcpatch/recipes/Migrate.py b/src/ifcpatch/ifcpatch/recipes/Migrate.py
index 6b5c18ff11..627342f096 100644
--- a/src/ifcpatch/ifcpatch/recipes/Migrate.py
+++ b/src/ifcpatch/ifcpatch/recipes/Migrate.py
@@ -16,7 +16,6 @@
# You should have received a copy of the GNU Lesser General Public License
# along with IfcPatch. If not, see .
-import typing
from logging import Logger
from typing import Union
diff --git a/src/ifcpatch/ifcpatch/recipes/OffsetObjectPlacements.py b/src/ifcpatch/ifcpatch/recipes/OffsetObjectPlacements.py
index a575fc4eac..7b8f122482 100644
--- a/src/ifcpatch/ifcpatch/recipes/OffsetObjectPlacements.py
+++ b/src/ifcpatch/ifcpatch/recipes/OffsetObjectPlacements.py
@@ -19,7 +19,6 @@
import math
import typing
-import ifcopenshell
import ifcopenshell.util.placement
import numpy as np
from ifcopenshell.util.shape_builder import ShapeBuilder
diff --git a/src/ifcpatch/ifcpatch/recipes/Optimise.py b/src/ifcpatch/ifcpatch/recipes/Optimise.py
index 79699ae2e6..b0043a7299 100644
--- a/src/ifcpatch/ifcpatch/recipes/Optimise.py
+++ b/src/ifcpatch/ifcpatch/recipes/Optimise.py
@@ -17,7 +17,6 @@
# along with IfcPatch. If not, see .
import ifcopenshell
-import ifcopenshell.util.element
class Patcher:
diff --git a/src/ifcpatch/ifcpatch/recipes/PatchStationReferentPosition.py b/src/ifcpatch/ifcpatch/recipes/PatchStationReferentPosition.py
index cd3a4fb523..9af1afc950 100644
--- a/src/ifcpatch/ifcpatch/recipes/PatchStationReferentPosition.py
+++ b/src/ifcpatch/ifcpatch/recipes/PatchStationReferentPosition.py
@@ -1,4 +1,3 @@
-import typing
from logging import Logger
from typing import Union
diff --git a/src/ifcpatch/ifcpatch/recipes/ResetAbsoluteCoordinates.py b/src/ifcpatch/ifcpatch/recipes/ResetAbsoluteCoordinates.py
index 641ba928b1..1414464fcd 100644
--- a/src/ifcpatch/ifcpatch/recipes/ResetAbsoluteCoordinates.py
+++ b/src/ifcpatch/ifcpatch/recipes/ResetAbsoluteCoordinates.py
@@ -17,7 +17,7 @@
# along with IfcPatch. If not, see .
import logging
-from typing import Literal, Optional, Union
+from typing import Literal, Union
import ifcopenshell
import numpy as np
diff --git a/src/ifcpatch/ifcpatch/recipes/ResetSpatialElementLocations.py b/src/ifcpatch/ifcpatch/recipes/ResetSpatialElementLocations.py
index 0f7c3933b4..9bd751e763 100644
--- a/src/ifcpatch/ifcpatch/recipes/ResetSpatialElementLocations.py
+++ b/src/ifcpatch/ifcpatch/recipes/ResetSpatialElementLocations.py
@@ -19,9 +19,7 @@
import logging
import ifcopenshell
-import ifcopenshell.api
import ifcopenshell.api.geometry
-import ifcopenshell.util
import ifcopenshell.util.element
import ifcopenshell.util.placement
import numpy as np
diff --git a/src/ifcpatch/ifcpatch/recipes/SetFalseOrigin.py b/src/ifcpatch/ifcpatch/recipes/SetFalseOrigin.py
index 72218e5ecf..bd8706f9e1 100644
--- a/src/ifcpatch/ifcpatch/recipes/SetFalseOrigin.py
+++ b/src/ifcpatch/ifcpatch/recipes/SetFalseOrigin.py
@@ -18,7 +18,6 @@
import typing
-import ifcopenshell
import ifcopenshell.api.georeference
import ifcopenshell.util.geolocation
diff --git a/src/ifcpatch/ifcpatch/recipes/TessellateElements.py b/src/ifcpatch/ifcpatch/recipes/TessellateElements.py
index 14ee80aec2..75dc5578d8 100644
--- a/src/ifcpatch/ifcpatch/recipes/TessellateElements.py
+++ b/src/ifcpatch/ifcpatch/recipes/TessellateElements.py
@@ -21,7 +21,6 @@ from logging import Logger
from typing import Union
import ifcopenshell
-import ifcopenshell.api
import ifcopenshell.api.geometry
import ifcopenshell.geom
import ifcopenshell.util.representation
diff --git a/src/ifcpatch/ifcpatch/recipes/UnsharePsets.py b/src/ifcpatch/ifcpatch/recipes/UnsharePsets.py
index e7a1ad9eb1..67dc3da646 100644
--- a/src/ifcpatch/ifcpatch/recipes/UnsharePsets.py
+++ b/src/ifcpatch/ifcpatch/recipes/UnsharePsets.py
@@ -20,7 +20,6 @@ from logging import Logger
import ifcopenshell
import ifcopenshell.api.pset
-import ifcopenshell.guid
import ifcopenshell.util.element
import ifcopenshell.util.selector
diff --git a/src/ifcpatch/pyproject.toml b/src/ifcpatch/pyproject.toml
index 72ec9ca3f0..22cf2ec3c5 100644
--- a/src/ifcpatch/pyproject.toml
+++ b/src/ifcpatch/pyproject.toml
@@ -31,3 +31,11 @@ Issues = "https://github.com/IfcOpenShell/IfcOpenShell/issues"
[tool.setuptools.packages.find]
include = ["ifcpatch*"]
exclude = ["test*"]
+
+[tool.ruff]
+extend = "../../pyproject.toml"
+
+[tool.ruff.lint]
+select = [
+ "F401", # unused imports
+]
diff --git a/src/ifcpatch/test/test_ConvertLengthUnit.py b/src/ifcpatch/test/test_ConvertLengthUnit.py
index a4f586512f..6fdf2668ec 100644
--- a/src/ifcpatch/test/test_ConvertLengthUnit.py
+++ b/src/ifcpatch/test/test_ConvertLengthUnit.py
@@ -16,7 +16,6 @@
# You should have received a copy of the GNU Lesser General Public License
# along with IfcOpenShell. If not, see .
-import ifcopenshell.api
import ifcopenshell.api.root
import ifcopenshell.api.unit
import ifcopenshell.util.unit
diff --git a/src/ifcpatch/test/test_ExtractElements.py b/src/ifcpatch/test/test_ExtractElements.py
index fe2e9350dd..8d7d4021c6 100644
--- a/src/ifcpatch/test/test_ExtractElements.py
+++ b/src/ifcpatch/test/test_ExtractElements.py
@@ -19,7 +19,6 @@
import os
import ifcopenshell
-import ifcopenshell.api
import ifcopenshell.api.aggregate
import ifcopenshell.api.root
import ifcopenshell.api.spatial
diff --git a/src/ifcpatch/test/test_Ifc2Sql.py b/src/ifcpatch/test/test_Ifc2Sql.py
index 79257a69c3..49e38c08fe 100644
--- a/src/ifcpatch/test/test_Ifc2Sql.py
+++ b/src/ifcpatch/test/test_Ifc2Sql.py
@@ -20,15 +20,6 @@ import tempfile
from pathlib import Path
import ifcopenshell
-import ifcopenshell.api.context
-import ifcopenshell.api.geometry
-import ifcopenshell.api.georeference
-import ifcopenshell.geom
-import ifcopenshell.util.geolocation
-import ifcopenshell.util.placement
-import ifcopenshell.util.representation
-import ifcopenshell.util.shape
-import ifcopenshell.util.shape_builder
import ifcpatch
diff --git a/src/ifcpatch/test/test_MergeDuplicateTypes.py b/src/ifcpatch/test/test_MergeDuplicateTypes.py
index 439f7a0c06..565a62517b 100644
--- a/src/ifcpatch/test/test_MergeDuplicateTypes.py
+++ b/src/ifcpatch/test/test_MergeDuplicateTypes.py
@@ -16,17 +16,13 @@
# You should have received a copy of the GNU Lesser General Public License
# along with IfcOpenShell. If not, see .
-import os
-import ifcopenshell
-import ifcopenshell.api
import ifcopenshell.api.geometry
import ifcopenshell.api.material
import ifcopenshell.api.root
import ifcopenshell.api.type
import ifcopenshell.util.element
import ifcopenshell.util.representation
-import pytest
import ifcpatch
import test.bootstrap
diff --git a/src/ifcpatch/test/test_Migrate.py b/src/ifcpatch/test/test_Migrate.py
index 319e01d91b..85e60ff09f 100644
--- a/src/ifcpatch/test/test_Migrate.py
+++ b/src/ifcpatch/test/test_Migrate.py
@@ -16,7 +16,6 @@
# You should have received a copy of the GNU Lesser General Public License
# along with IfcOpenShell. If not, see .
-import ifcopenshell
import ifcpatch
import test.bootstrap
diff --git a/src/ifcpatch/test/test_RegenerateGlobalIds.py b/src/ifcpatch/test/test_RegenerateGlobalIds.py
index e51e4c7a9c..4858b6a7b0 100644
--- a/src/ifcpatch/test/test_RegenerateGlobalIds.py
+++ b/src/ifcpatch/test/test_RegenerateGlobalIds.py
@@ -16,13 +16,8 @@
# You should have received a copy of the GNU Lesser General Public License
# along with IfcOpenShell. If not, see .
-import os
-import ifcopenshell
-import ifcopenshell.api
import ifcopenshell.api.root
-import ifcopenshell.util.element
-import pytest
import ifcpatch
import test.bootstrap
diff --git a/src/ifcpatch/test/test_ResetSpatialElementLocations.py b/src/ifcpatch/test/test_ResetSpatialElementLocations.py
index 5d446c9128..d0dc385015 100644
--- a/src/ifcpatch/test/test_ResetSpatialElementLocations.py
+++ b/src/ifcpatch/test/test_ResetSpatialElementLocations.py
@@ -16,7 +16,6 @@
# You should have received a copy of the GNU Lesser General Public License
# along with IfcOpenShell. If not, see .
-import ifcopenshell.api
import ifcopenshell.api.aggregate
import ifcopenshell.api.geometry
import ifcopenshell.api.root
diff --git a/src/ifcpatch/test/test_SetFalseOrigin.py b/src/ifcpatch/test/test_SetFalseOrigin.py
index 1357ec39b0..e15e8684fb 100644
--- a/src/ifcpatch/test/test_SetFalseOrigin.py
+++ b/src/ifcpatch/test/test_SetFalseOrigin.py
@@ -16,7 +16,6 @@
# You should have received a copy of the GNU Lesser General Public License
# along with IfcOpenShell. If not, see .
-import ifcopenshell.api
import ifcopenshell.api.aggregate
import ifcopenshell.api.context
import ifcopenshell.api.geometry
diff --git a/src/ifcpatch/test/test_TesselateElements.py b/src/ifcpatch/test/test_TesselateElements.py
index 7acdc899a7..9e15c35f72 100644
--- a/src/ifcpatch/test/test_TesselateElements.py
+++ b/src/ifcpatch/test/test_TesselateElements.py
@@ -16,14 +16,10 @@
# You should have received a copy of the GNU Lesser General Public License
# along with IfcOpenShell. If not, see .
-import ifcopenshell
import ifcopenshell.api.context
import ifcopenshell.api.geometry
-import ifcopenshell.api.profile
import ifcopenshell.api.root
import ifcopenshell.api.unit
-import ifcopenshell.geom
-import ifcopenshell.util.element
import ifcopenshell.util.representation
from ifcopenshell.util.shape_builder import ShapeBuilder
diff --git a/src/ifcpatch/test/test_UnsharePsets.py b/src/ifcpatch/test/test_UnsharePsets.py
index fc40bdb74d..ae09ed879b 100644
--- a/src/ifcpatch/test/test_UnsharePsets.py
+++ b/src/ifcpatch/test/test_UnsharePsets.py
@@ -18,7 +18,6 @@
import ifcopenshell
import ifcopenshell.api.pset
-import ifcopenshell.geom
import ifcopenshell.util.element
import ifcpatch
diff --git a/src/ifctester/ifctester/__init__.py b/src/ifctester/ifctester/__init__.py
index edb1db90e4..46b38aa82e 100644
--- a/src/ifctester/ifctester/__init__.py
+++ b/src/ifctester/ifctester/__init__.py
@@ -16,6 +16,6 @@
# You should have received a copy of the GNU Lesser General Public License
# along with IfcTester. If not, see .
-from .ids import open
+from .ids import open as open
__version__ = version = "0.0.0"
diff --git a/src/ifctester/ifctester/ids.py b/src/ifctester/ifctester/ids.py
index d7403e2594..d6ae3bd44a 100644
--- a/src/ifctester/ifctester/ids.py
+++ b/src/ifctester/ifctester/ids.py
@@ -28,16 +28,10 @@ from xmlschema import XMLSchema, etree_tostring
from xmlschema.validators.exceptions import XMLSchemaValidationError
from .facet import (
- Attribute,
Cardinality,
- Classification,
Entity,
Facet,
FacetFailure,
- Material,
- PartOf,
- Property,
- Restriction,
get_pset,
get_psets,
)
diff --git a/src/ifctester/pyproject.toml b/src/ifctester/pyproject.toml
index c174854190..1be89ed68b 100644
--- a/src/ifctester/pyproject.toml
+++ b/src/ifctester/pyproject.toml
@@ -32,3 +32,9 @@ exclude = ["test*"]
[tool.setuptools.package-data]
"*" = ["*.*"]
+
+[tool.ruff]
+extend = "../../pyproject.toml"
+lint.select = [
+ "F401", # unused imports
+]
diff --git a/src/ifctester/test/ids_doc_generator.py b/src/ifctester/test/ids_doc_generator.py
index a8323fbeed..3788afebbc 100644
--- a/src/ifctester/test/ids_doc_generator.py
+++ b/src/ifctester/test/ids_doc_generator.py
@@ -24,7 +24,6 @@ from pathlib import Path
from xml.dom.minidom import parseString
import ifcopenshell
-import ifcopenshell.api
import ifcopenshell.api.aggregate
import ifcopenshell.api.context
import ifcopenshell.api.geometry
diff --git a/src/ifctester/test/test_facet.py b/src/ifctester/test/test_facet.py
index 2e0a16ec85..a8ace9622a 100644
--- a/src/ifctester/test/test_facet.py
+++ b/src/ifctester/test/test_facet.py
@@ -20,7 +20,6 @@
import uuid
import ifcopenshell
-import ifcopenshell.api
import ifcopenshell.api.aggregate
import ifcopenshell.api.classification
import ifcopenshell.api.group
diff --git a/src/ifctester/test/test_ids.py b/src/ifctester/test/test_ids.py
index 0a851a355c..9410d73948 100644
--- a/src/ifctester/test/test_ids.py
+++ b/src/ifctester/test/test_ids.py
@@ -20,7 +20,6 @@ import os
from typing import Optional
import ifcopenshell
-import ifcopenshell.api
import ifcopenshell.api.material
import pytest
import xmlschema
diff --git a/src/ifctester/webapp/public/worker/api.py b/src/ifctester/webapp/public/worker/api.py
index dafc61c646..4489d358d5 100644
--- a/src/ifctester/webapp/public/worker/api.py
+++ b/src/ifctester/webapp/public/worker/api.py
@@ -1,10 +1,7 @@
-import xml.etree.ElementTree as ET
import ifcopenshell
-import ifcopenshell.util
import ifcopenshell.util.attribute
import ifcopenshell.util.pset
-import ifcopenshell.util.schema
from ifctester.ids import Ids, IdsXmlValidationError, get_schema
from xmlschema.validators.exceptions import XMLSchemaValidationError
diff --git a/test/run.py b/test/run.py
index 320b8decc4..ad1880166f 100644
--- a/test/run.py
+++ b/test/run.py
@@ -28,7 +28,6 @@
import inspect
import os
-import shutil
import subprocess
import sys
from urllib.request import urlretrieve