Don't use importlib for version

This commit is contained in:
Balázs Dukai
2023-06-14 02:26:28 +02:00
parent 435090e7f1
commit 2b71b33c82
2 changed files with 3 additions and 4 deletions
@@ -1,4 +1,3 @@
# ifccityjson - Python CityJSON to IFC converter
# Copyright (C) 2021 Laurens J.N. Oostwegel <l.oostwegel@gmail.com>
#
@@ -16,5 +15,5 @@
#
# You should have received a copy of the GNU Lesser General Public License
# along with ifccityjson. If not, see <http://www.gnu.org/licenses/>.
__version__ = "0.1.0"
from .cityjson2ifc import *
@@ -18,12 +18,12 @@
# along with ifccityjson. If not, see <http://www.gnu.org/licenses/>.
import os
from importlib.metadata import version as pkg_version
import ifcopenshell
import ifcopenshell.api
from datetime import datetime
from .geometry import GeometryIO
from . import __version__
JSON_TO_IFC = {
"Building": ["IfcBuilding"],
@@ -197,7 +197,7 @@ class Cityjson2ifc:
"IfcOpenShell, an open source (LGPL) software library that helps users and software developers to work with the IFC file format.",
)
p_o = self.IFC_model.createIfcPersonAndOrganization(person, organization)
application = self.IFC_model.createIfcApplication(organization, pkg_version("ifccityjson"), "ifccityjson", "ifccityjson")
application = self.IFC_model.createIfcApplication(organization, __version__, "ifccityjson", "ifccityjson")
timestamp = int(datetime.now().timestamp())
ownerHistory = self.IFC_model.createIfcOwnerHistory(p_o, application, "READWRITE", None, None, None, None,
timestamp)