Get package version from pyproject.toml

This commit is contained in:
Balázs Dukai
2023-06-13 16:31:10 +02:00
committed by Thomas Krijnen
parent 16cda28d16
commit 80f9590410
@@ -18,6 +18,7 @@
# along with ifccityjson. If not, see <http://www.gnu.org/licenses/>. # along with ifccityjson. If not, see <http://www.gnu.org/licenses/>.
import os import os
from importlib.metadata import version as pkg_version
import ifcopenshell import ifcopenshell
import ifcopenshell.api import ifcopenshell.api
from datetime import datetime from datetime import datetime
@@ -196,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.", "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) p_o = self.IFC_model.createIfcPersonAndOrganization(person, organization)
application = self.IFC_model.createIfcApplication(organization, "v0.0.x", "ifccityjson", "ifccityjson") application = self.IFC_model.createIfcApplication(organization, pkg_version("ifccityjson"), "ifccityjson", "ifccityjson")
timestamp = int(datetime.now().timestamp()) timestamp = int(datetime.now().timestamp())
ownerHistory = self.IFC_model.createIfcOwnerHistory(p_o, application, "READWRITE", None, None, None, None, ownerHistory = self.IFC_model.createIfcOwnerHistory(p_o, application, "READWRITE", None, None, None, None,
timestamp) timestamp)