Skip to content

Commit

Permalink
refactor: when importlib is unavailable fallback to importlib_metadata
Browse files Browse the repository at this point in the history
Signed-off-by: Vassilis Vassiladis <[email protected]>
  • Loading branch information
VassilisVassiliadis authored and GitHub Enterprise committed Jul 11, 2024
1 parent 5a8ac57 commit ada37a7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
4 changes: 3 additions & 1 deletion requirement_files/requirements_base_3.7.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Numpy dropped support for python 3.7 in v1.22
numpy < 1.22
# Matplotlib dropped support for python 3.7 in v3.6.0
matplotlib < 3.6.0
matplotlib < 3.6.0
# 6.8.0 requires python 3.8 or later
importlib_metadata < 6.8.0
5 changes: 4 additions & 1 deletion scripts/elaunch.py
Original file line number Diff line number Diff line change
Expand Up @@ -1105,7 +1105,10 @@ def arg_to_bool(name, val):


def build_parser() -> NoSystemExitOptparseOptionParser:
import importlib_metadata
try:
import importlib.metadata as importlib_metadata
except ImportError:
import importlib_metadata

# HACK: Daresbury system dependant
projectDir = os.path.split(os.path.expanduser("~"))[0]
Expand Down
6 changes: 5 additions & 1 deletion scripts/ewrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@
import experiment.runtime.output
import experiment.model.frontends.flowir
import experiment.model.storage
import importlib_metadata

try:
import importlib.metadata as importlib_metadata
except ImportError:
import importlib_metadata
import yaml

usage = "usage: %prog [options] [package]"
Expand Down

0 comments on commit ada37a7

Please sign in to comment.