Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove demandimport module #121

Merged
merged 2 commits into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions perun/collect/trace/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -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):
Expand Down
4 changes: 1 addition & 3 deletions perun/fuzz/interpret.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
4 changes: 1 addition & 3 deletions perun/logic/store.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import string
import struct
import zlib
import demandimport

from typing import BinaryIO, Optional

Expand All @@ -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$")
Expand Down
6 changes: 2 additions & 4 deletions perun/profile/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -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



Expand Down
10 changes: 4 additions & 6 deletions perun/utils/view_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 1 addition & 4 deletions perun/view/bars/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 1 addition & 4 deletions perun/view/flow/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 4 additions & 7 deletions perun/view/scatter/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 1 addition & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -140,7 +137,6 @@ module = [
"scipy.*",
"sklearn.*",
"statsmodels.*",
"demandimport.*",
"holoviews.*",
"bcc.*",
"binaryornot.*",
Expand Down Expand Up @@ -212,4 +208,4 @@ exclude_also = [

# Not implemented asserst are omitted
"assert NotImplementedError(.*)",
]
]