2929"""
3030
3131import os
32- import re
3332import shutil
3433import sys
3534import tempfile
3938
4039import easybuild .tools .options as eboptions
4140from easybuild .tools .build_log import EasyBuildError
42- from easybuild .tools .config import ERROR , IGNORE , WARN , BuildOptions , ConfigurationVariables
43- from easybuild .tools .config import build_option , build_path , get_build_log_path , get_log_filename , get_repositorypath
44- from easybuild .tools .config import install_path , log_file_format , log_path , source_paths
45- from easybuild .tools .config import update_build_option , update_build_options
46- from easybuild .tools .config import DEFAULT_PATH_SUBDIRS , init_build_options
47- from easybuild .tools .filetools import copy_dir , mkdir , write_file
48- from easybuild .tools .options import CONFIG_ENV_VAR_PREFIX
49- from easybuild .tools .docs import list_easyblocks , list_software , list_toolchains
41+ from easybuild .tools .filetools import write_file
42+ from easybuild .tools .docs import list_easyblocks , list_toolchains
5043from easybuild .tools .entrypoints import (
5144 get_group_entrypoints , HOOKS_ENTRYPOINT , EASYBLOCK_ENTRYPOINT , TOOLCHAIN_ENTRYPOINT ,
5245 HAVE_ENTRY_POINTS
5346)
5447from easybuild .framework .easyconfig .easyconfig import get_module_path
55- from easybuild .framework .easyblock import EasyBlock
5648
5749
5850if HAVE_ENTRY_POINTS :
6860MOCK_TOOLCHAIN = "MockTc"
6961
7062
71- MOCK_EP_FILE = f"""
63+ MOCK_EP_FILE = f"""
7264from easybuild.tools.entrypoints import register_entrypoint_hooks
7365from easybuild.tools.hooks import CONFIGURE_STEP, START
7466
@@ -114,7 +106,6 @@ class {MOCK_TOOLCHAIN}(MockCompiler):
114106"""
115107
116108
117-
118109MOCK_EP_META_FILE = f"""
119110[{ HOOKS_ENTRYPOINT } ]
120111{ MOCK_HOOK_EP_NAME } = {{module}}:hello_world
@@ -139,6 +130,7 @@ def read_text(self, filename):
139130 if filename == "METADATA" :
140131 return "Name: mock_hook\n Version: 0.1.0\n "
141132
133+
142134class MockDistributionFinder (DistributionFinder ):
143135 """Mock distribution finder for testing entry points."""
144136 def __init__ (self , * args , module , ** kwargs ):
@@ -180,7 +172,7 @@ def tearDown(self):
180172 if HAVE_ENTRY_POINTS :
181173 # Remove the entry point from the working set
182174 torm = []
183- for idx ,cls in enumerate (sys .meta_path ):
175+ for idx , cls in enumerate (sys .meta_path ):
184176 if isinstance (cls , MockDistributionFinder ):
185177 torm .append (idx )
186178 for idx in reversed (torm ):
0 commit comments