Skip to content

Commit

Permalink
Reuse already computed path in include-easyblocks
Browse files Browse the repository at this point in the history
`easyblocks_dir` already exists so no need to re-compute it as `new_dir`
  • Loading branch information
Flamefire committed Oct 11, 2024
1 parent 8c35411 commit ea8db4d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions easybuild/tools/include.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,8 @@ def include_easyblocks(tmpdir, paths):

# hard inject location to included (generic) easyblocks into Python search path
# only prepending to sys.path is not enough due to 'pkgutil.extend_path' in easybuild/easyblocks/__init__.py
new_path = os.path.join(easyblocks_path, 'easybuild', 'easyblocks')
easybuild.easyblocks.__path__.insert(0, new_path)
new_path = os.path.join(new_path, 'generic')
easybuild.easyblocks.generic.__path__.insert(0, new_path)
easybuild.easyblocks.__path__.insert(0, easyblocks_dir)
easybuild.easyblocks.generic.__path__.insert(0, os.path.join(easyblocks_dir, 'generic'))

# sanity check: verify that included easyblocks can be imported (from expected location)
for subdir, ebs in [('', included_ebs), ('generic', included_generic_ebs)]:
Expand Down

0 comments on commit ea8db4d

Please sign in to comment.