Drop support for Python 2.

This commit is contained in:
Dion Moult
2024-05-07 12:17:46 +10:00
parent 7e13ed746e
commit 89c4cbeb05
17 changed files with 2 additions and 67 deletions
@@ -30,10 +30,6 @@ Example:
model = ifcopenshell.open("/path/to/model.ifc")
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import sys
import zipfile
@@ -17,10 +17,6 @@
# along with IfcOpenShell. If not, see <http://www.gnu.org/licenses/>.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import functools
import importlib
import numbers
@@ -17,8 +17,6 @@
# along with IfcOpenShell. If not, see <http://www.gnu.org/licenses/>.
from __future__ import print_function
import sys
import nodes
import templates
@@ -17,13 +17,10 @@
# along with IfcOpenShell. If not, see <http://www.gnu.org/licenses/>.
from __future__ import print_function
import io
import string
import operator
import collections
import bootstrap
class Node:
+1 -13
View File
@@ -17,11 +17,6 @@
# along with IfcOpenShell. If not, see <http://www.gnu.org/licenses/>.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import annotations
import os
import re
import numbers
@@ -34,13 +29,6 @@ from typing import Optional, Any
from . import ifcopenshell_wrapper
from .entity_instance import entity_instance
try:
# Python 2
basestring
except NameError:
# Python 3 or newer
basestring = (str, bytes)
class Transaction:
def __init__(self, ifc_file):
@@ -403,7 +391,7 @@ class file(object):
def __getitem__(self, key):
if isinstance(key, numbers.Integral):
return entity_instance(self.wrapped_data.by_id(key), self)
elif isinstance(key, basestring):
elif isinstance(key, (str, bytes)):
return entity_instance(self.wrapped_data.by_guid(str(key)), self)
def by_id(self, id: int) -> ifcopenshell.entity_instance:
@@ -18,9 +18,6 @@
"""Geometry processing and analysis"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
def _has_occ():
@@ -16,10 +16,6 @@
# You should have received a copy of the GNU Lesser General Public License
# along with IfcOpenShell. If not, see <http://www.gnu.org/licenses/>.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import sys
import time
@@ -16,10 +16,6 @@
# You should have received a copy of the GNU Lesser General Public License
# along with IfcOpenShell. If not, see <http://www.gnu.org/licenses/>.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import sys
import logging
@@ -17,11 +17,6 @@
# along with IfcOpenShell. If not, see <http://www.gnu.org/licenses/>.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import annotations
import os
import sys
import operator
@@ -17,20 +17,12 @@
# along with IfcOpenShell. If not, see <http://www.gnu.org/licenses/>.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import random
import operator
import warnings
from collections import namedtuple
try: # python 3.3+
from collections.abc import Iterable
except ImportError: # python 2
from collections import Iterable
from collections.abc import Iterable
import OCC
@@ -18,9 +18,6 @@
"""Reads and writes encoded GlobalIds"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import uuid
import string
@@ -17,10 +17,6 @@
# along with IfcOpenShell. If not, see <http://www.gnu.org/licenses/>.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from . import ifcopenshell_wrapper
version = ifcopenshell_wrapper.version()
@@ -17,10 +17,6 @@
# along with IfcOpenShell. If not, see <http://www.gnu.org/licenses/>.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import time
import uuid
@@ -16,7 +16,6 @@
# You should have received a copy of the GNU Lesser General Public License
# along with IfcOpenShell. If not, see <http://www.gnu.org/licenses/>.
from __future__ import annotations
import numpy as np
import ifcopenshell
from typing import Any, Union
@@ -16,7 +16,6 @@
# You should have received a copy of the GNU Lesser General Public License
# along with IfcOpenShell. If not, see <http://www.gnu.org/licenses/>.
from __future__ import annotations
import ifcopenshell
import ifcopenshell.util.element
from typing import Any, Callable, Optional, Union, Literal, overload
@@ -16,7 +16,6 @@
# You should have received a copy of the GNU Lesser General Public License
# along with IfcOpenShell. If not, see <http://www.gnu.org/licenses/>.
from __future__ import annotations
import re
import pathlib
import ifcopenshell
@@ -32,8 +32,6 @@ Available flags:
- ``--fields``: Output more detailed information about failed entities (available only with ``--json``).
"""
from __future__ import print_function
import os
import sys
import json