diff --git a/perun/collect/trace/configuration.py b/perun/collect/trace/configuration.py index 28d39a1a7..9f00df6c6 100644 --- a/perun/collect/trace/configuration.py +++ b/perun/collect/trace/configuration.py @@ -3,7 +3,6 @@ import os import time -import demandimport from perun.collect.trace.collect_engine import CollectEngine from perun.collect.trace.systemtap.engine import SystemTapEngine @@ -12,11 +11,7 @@ from perun.utils.exceptions import InvalidBinaryException from perun.utils import find_executable -import perun.logic.temp as temp - -# Import on demand since eBPF support is optional -with demandimport.enabled(): - import perun.collect.trace.ebpf.engine as bpf +from perun.logic import temp class Configuration: @@ -115,6 +110,8 @@ def engine_factory(self): if self.engine == 'stap': self.engine = SystemTapEngine(self) else: + # Import on demand since eBPF support is optional + import perun.collect.trace.ebpf.engine as bpf self.engine = bpf.BpfEngine(self) def get_functions(self): diff --git a/perun/fuzz/interpret.py b/perun/fuzz/interpret.py index c64f64e40..ec4f5fa9d 100644 --- a/perun/fuzz/interpret.py +++ b/perun/fuzz/interpret.py @@ -1,12 +1,10 @@ """ Module contains a set of functions for fuzzing results interpretation.""" from __future__ import annotations -import demandimport import os.path as path import difflib import scipy.stats.mstats as stats -with demandimport.enabled(): - import matplotlib.pyplot as plt +import matplotlib.pyplot as plt from typing import TextIO, Optional diff --git a/perun/logic/store.py b/perun/logic/store.py index c43ba1017..5fcc089d3 100644 --- a/perun/logic/store.py +++ b/perun/logic/store.py @@ -11,7 +11,6 @@ import string import struct import zlib -import demandimport from typing import BinaryIO, Optional @@ -22,8 +21,7 @@ from perun.utils.exceptions import IncorrectProfileFormatException from perun.profile.factory import Profile -with demandimport.enabled(): - import hashlib +import hashlib INDEX_TAG_REGEX = re.compile(r"^(\d+)@i$") diff --git a/perun/profile/convert.py b/perun/profile/convert.py index 1137490ae..8563a9ad4 100644 --- a/perun/profile/convert.py +++ b/perun/profile/convert.py @@ -25,10 +25,8 @@ import perun.profile.query as query import perun.postprocess.regression_analysis.transform as transform -import demandimport -with demandimport.enabled(): - import numpy - import pandas +import numpy +import pandas diff --git a/perun/utils/view_helpers.py b/perun/utils/view_helpers.py index 67c7de44c..619984629 100644 --- a/perun/utils/view_helpers.py +++ b/perun/utils/view_helpers.py @@ -6,13 +6,11 @@ from collections.abc import MutableMapping, Iterable from enum import Enum -import demandimport -with demandimport.enabled(): - from bokeh.plotting import show, output_file - import bokeh.palettes as bk_palettes - import bokeh.themes.theme as bk_theme - import holoviews as hv +from bokeh.plotting import show, output_file +import bokeh.palettes as bk_palettes +import bokeh.themes.theme as bk_theme +import holoviews as hv import perun.profile.helpers as profiles from perun.utils import log diff --git a/perun/view/bars/factory.py b/perun/view/bars/factory.py index 56a5664d5..265167ff9 100644 --- a/perun/view/bars/factory.py +++ b/perun/view/bars/factory.py @@ -3,10 +3,7 @@ from typing import TYPE_CHECKING -import demandimport - -with demandimport.enabled(): - import holoviews as hv +import holoviews as hv from perun.profile import convert from perun.utils import view_helpers diff --git a/perun/view/flow/factory.py b/perun/view/flow/factory.py index a82c99ac9..c0dfdee05 100644 --- a/perun/view/flow/factory.py +++ b/perun/view/flow/factory.py @@ -3,10 +3,7 @@ from typing import TYPE_CHECKING, Hashable, cast, Protocol -import demandimport - -with demandimport.enabled(): - import holoviews as hv +import holoviews as hv from perun.profile import convert from perun.utils import view_helpers diff --git a/perun/view/scatter/factory.py b/perun/view/scatter/factory.py index fa74579c2..de1836333 100644 --- a/perun/view/scatter/factory.py +++ b/perun/view/scatter/factory.py @@ -6,13 +6,10 @@ from operator import itemgetter -import demandimport - -with demandimport.enabled(): - import numpy as np - import numpy.typing as npt - import holoviews as hv - from bokeh import palettes +import numpy as np +import numpy.typing as npt +import holoviews as hv +from bokeh import palettes from perun.utils import view_helpers from perun.profile import query, convert diff --git a/pyproject.toml b/pyproject.toml index 4cfdf9cb0..8cbe30d7d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,9 +28,6 @@ dependencies = [ "GitPython>=3.1.30", "gitdb>=4.0.10", - # Lazy imports - "demandimport>=0.3.4", - # String / text utilities "Faker>=19.3", "ruamel.yaml>=0.17", @@ -140,7 +137,6 @@ module = [ "scipy.*", "sklearn.*", "statsmodels.*", - "demandimport.*", "holoviews.*", "bcc.*", "binaryornot.*", @@ -212,4 +208,4 @@ exclude_also = [ # Not implemented asserst are omitted "assert NotImplementedError(.*)", -] \ No newline at end of file +]