Fix ruff complaints

This commit is contained in:
Andrej730
2026-07-17 12:28:50 +05:00
parent d7f9ade853
commit 3efb2c2d5f
16 changed files with 16 additions and 22 deletions
@@ -11,7 +11,6 @@ import tempfile
import zipfile import zipfile
from pathlib import Path from pathlib import Path
SCHEMA_ORDER = { SCHEMA_ORDER = {
"ifc2x3": 0, "ifc2x3": 0,
"ifc4": 1, "ifc4": 1,
+2 -3
View File
@@ -16,7 +16,6 @@ import zipfile
from email.parser import Parser from email.parser import Parser
from pathlib import Path from pathlib import Path
MAIN_SHARED_OBJECT_RE = re.compile(r"(^|/)_ifcopenshell_wrapper(?:\.|$)") MAIN_SHARED_OBJECT_RE = re.compile(r"(^|/)_ifcopenshell_wrapper(?:\.|$)")
PURE_PYTHON_PACKAGE_NAME = "ifcopenshell-pure-python" PURE_PYTHON_PACKAGE_NAME = "ifcopenshell-pure-python"
PURE_PYTHON_PREFIXES = ( PURE_PYTHON_PREFIXES = (
@@ -132,14 +131,14 @@ def build_wheel(
"License-File: COPYING\n" "License-File: COPYING\n"
"License-File: COPYING.LESSER\n" "License-File: COPYING.LESSER\n"
"\n" "\n"
).encode("utf-8") ).encode()
wheel = ( wheel = (
"Wheel-Version: 1.0\n" "Wheel-Version: 1.0\n"
"Generator: split_pyodide_ifcopenshell_wheel.py\n" "Generator: split_pyodide_ifcopenshell_wheel.py\n"
f"Root-Is-Purelib: {str(root_is_purelib).lower()}\n" f"Root-Is-Purelib: {str(root_is_purelib).lower()}\n"
f"Tag: {tag}\n" f"Tag: {tag}\n"
"\n" "\n"
).encode("utf-8") ).encode()
with zipfile.ZipFile(out, "w", compression=zipfile.ZIP_DEFLATED, compresslevel=9) as zf: with zipfile.ZipFile(out, "w", compression=zipfile.ZIP_DEFLATED, compresslevel=9) as zf:
for info, data in payloads: for info, data in payloads:
@@ -20,7 +20,6 @@ import bpy
import ifcopenshell.util.unit import ifcopenshell.util.unit
from bpy.types import Menu, Panel, UIList from bpy.types import Menu, Panel, UIList
import ifcopenshell.util.unit
import bonsai.bim import bonsai.bim
import bonsai.tool as tool import bonsai.tool as tool
from bonsai.bim.helper import prop_with_search from bonsai.bim.helper import prop_with_search
-1
View File
@@ -25,7 +25,6 @@ import bpy
import ifcopenshell.util.unit import ifcopenshell.util.unit
from bpy.types import Panel from bpy.types import Panel
import ifcopenshell.util.unit
import bonsai.bim import bonsai.bim
import bonsai.tool as tool import bonsai.tool as tool
from bonsai.bim.helper import prop_with_search from bonsai.bim.helper import prop_with_search
-1
View File
@@ -19,7 +19,6 @@
from __future__ import annotations from __future__ import annotations
import json import json
import os
import re import re
from collections import defaultdict from collections import defaultdict
from collections.abc import Iterable from collections.abc import Iterable
+1 -1
View File
@@ -75,7 +75,7 @@ import bonsai.core.style
import bonsai.core.system import bonsai.core.system
import bonsai.core.tool import bonsai.core.tool
import bonsai.tool as tool import bonsai.tool as tool
from bonsai.bim.ifc import IfcStore, get_cache_or_detect_lock from bonsai.bim.ifc import get_cache_or_detect_lock
if TYPE_CHECKING: if TYPE_CHECKING:
from bonsai.bim.module.geometry.prop import ( from bonsai.bim.module.geometry.prop import (
+1
View File
@@ -17,6 +17,7 @@
# along with Bonsai. If not, see <http://www.gnu.org/licenses/>. # along with Bonsai. If not, see <http://www.gnu.org/licenses/>.
import os import os
import bpy import bpy
import ifcopenshell import ifcopenshell
import ifcopenshell.api.style import ifcopenshell.api.style
@@ -28,7 +28,6 @@ import subprocess
import zipfile import zipfile
from pathlib import Path from pathlib import Path
PROJECT_ROOT = Path(__file__).resolve().parent.parent PROJECT_ROOT = Path(__file__).resolve().parent.parent
DIST_DIR = PROJECT_ROOT / "dist" DIST_DIR = PROJECT_ROOT / "dist"
TARGET_DIR = PROJECT_ROOT / "target" / "release" TARGET_DIR = PROJECT_ROOT / "target" / "release"
-1
View File
@@ -3,7 +3,6 @@
import os import os
from datetime import datetime from datetime import datetime
project = "Bonsai Viewer" project = "Bonsai Viewer"
copyright = f"2020-{datetime.now().year} IfcOpenShell Contributors" copyright = f"2020-{datetime.now().year} IfcOpenShell Contributors"
author = "IfcOpenShell Contributors" author = "IfcOpenShell Contributors"
@@ -62,7 +62,7 @@ import tempfile
import zipfile import zipfile
from collections.abc import Generator, Sequence from collections.abc import Generator, Sequence
from pathlib import Path from pathlib import Path
from typing import TYPE_CHECKING, Any, Literal, Optional, Union, overload from typing import TYPE_CHECKING, Literal, Optional, Union, overload
if TYPE_CHECKING: if TYPE_CHECKING:
import ifcopenshell.express.schema_class import ifcopenshell.express.schema_class
@@ -22,19 +22,15 @@ from __future__ import annotations
import functools import functools
import importlib import importlib
import itertools import itertools
import numbers
import operator import operator
import subprocess import subprocess
import sys import sys
import time import time
from collections.abc import Callable, Sequence from collections.abc import Callable, Sequence
from typing import TYPE_CHECKING, Any, NoReturn, TypeVar, Union, cast, overload from typing import Any, TypeVar, Union
from . import ifcopenshell_wrapper, settings from . import ifcopenshell_wrapper, settings
if TYPE_CHECKING:
import ifcopenshell
try: try:
import logging import logging
except ImportError: except ImportError:
@@ -403,4 +399,4 @@ class entity_instance_mixin:
return ifcopenshell_wrapper.get_info_cpp(self.wrapped_data, include_identifier) return ifcopenshell_wrapper.get_info_cpp(self.wrapped_data, include_identifier)
return self.get_info_py( return self.get_info_py(
include_identifier=include_identifier, recursive=recursive, return_type=return_type, ignore=ignore include_identifier=include_identifier, recursive=recursive, return_type=return_type, ignore=ignore
) )
@@ -22,8 +22,6 @@ import functools
import numbers import numbers
import os import os
import re import re
import types
import weakref
import zipfile import zipfile
from collections.abc import Callable, Generator from collections.abc import Callable, Generator
from pathlib import Path from pathlib import Path
@@ -29,7 +29,6 @@ try:
import ifcopenshell.util.schema import ifcopenshell.util.schema
from . import ifcopenshell_wrapper from . import ifcopenshell_wrapper
from . import entity_instance
from . import file from . import file
class StreamTransformer(Transformer): class StreamTransformer(Transformer):
+8 -1
View File
@@ -18,7 +18,14 @@ from .conventions import (
sequence_adapter_name, sequence_adapter_name,
strip_pointer, strip_pointer,
) )
from .model import CallableModel, ClassModel, EnumModel, EnumValueModel, ModuleModel, ParameterModel from .model import (
CallableModel,
ClassModel,
EnumModel,
EnumValueModel,
ModuleModel,
ParameterModel,
)
def _require_clang(): def _require_clang():
-1
View File
@@ -3,7 +3,6 @@ from __future__ import annotations
import keyword import keyword
import re import re
INTEGER_CPP_TYPES = {"int", "size_t", "std::size_t", "unsigned int", "uint32_t"} INTEGER_CPP_TYPES = {"int", "size_t", "std::size_t", "unsigned int", "uint32_t"}
@@ -4,6 +4,7 @@ from enum import IntEnum
import _ifcopenshell_experimental as _native import _ifcopenshell_experimental as _native
class FileType(IntEnum): class FileType(IntEnum):
FT_IFCSPF = _native.FT_IFCSPF FT_IFCSPF = _native.FT_IFCSPF
FT_IFCXML = _native.FT_IFCXML FT_IFCXML = _native.FT_IFCXML