Skip to content

Commit

Permalink
Replace pkg_resources with importlib to work in python 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
KristofferSkare committed Mar 18, 2024
1 parent 6dd2435 commit 750edf6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/mlfmu/utils/fmi_builder.py
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -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 <fmiModelDescription> tag
model_description = dict(
Expand Down

0 comments on commit 750edf6

Please sign in to comment.