From 750edf63c9d28868a5779280f8987243c425c9a5 Mon Sep 17 00:00:00 2001 From: Kristoffer Skare Date: Mon, 18 Mar 2024 15:58:55 +0100 Subject: [PATCH] Replace pkg_resources with importlib to work in python 3.12 --- src/mlfmu/utils/fmi_builder.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/mlfmu/utils/fmi_builder.py b/src/mlfmu/utils/fmi_builder.py index a21617e..428d40a 100644 --- a/src/mlfmu/utils/fmi_builder.py +++ b/src/mlfmu/utils/fmi_builder.py @@ -1,9 +1,8 @@ import datetime +import importlib.metadata as metadata import logging from xml.etree.ElementTree import Element, ElementTree, SubElement, indent -import pkg_resources - from mlfmu.types.fmu_component import ( FmiCausality, FmiModel, @@ -41,7 +40,7 @@ def generate_model_description(fmu_model: FmiModel) -> ElementTree: t = datetime.datetime.now(datetime.timezone.utc) date_str = t.isoformat(timespec="seconds") - TOOL_VERSION = pkg_resources.get_distribution("MLFMU").version + TOOL_VERSION = metadata.version("mlfmu") # Root tag model_description = dict(