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

adopt module_load_environment in RepeatModeler and RepeatMasker easyblocks #3630

Merged
merged 3 commits into from
Feb 21, 2025
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
15 changes: 7 additions & 8 deletions easybuild/easyblocks/r/repeatmasker.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@
class EB_RepeatMasker(Tarball):
"""Support for building/installing RepeatMasker."""

def __init__(self, *args, **kwargs):
"""Easyblock constructor."""
super(EB_RepeatMasker, self).__init__(*args, **kwargs)

# custom path-like environment variables for RepeatMaskerConfig
self.module_load_environment.PATH = ['']

def install_step(self):
"""Custom install procedure for RepeatMasker."""
super(EB_RepeatMasker, self).install_step()
Expand Down Expand Up @@ -124,11 +131,3 @@ def sanity_check_step(self):
custom_commands = ['RepeatMasker']

super(EB_RepeatMasker, self).sanity_check_step(custom_paths=custom_paths, custom_commands=custom_commands)

def make_module_req_guess(self):
"""Custom guesses for path-like environment variables for RepeatMaskerConfig."""
guesses = super(EB_RepeatMasker, self).make_module_req_guess()

guesses['PATH'] = ['']

return guesses
23 changes: 13 additions & 10 deletions easybuild/easyblocks/r/repeatmodeler.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import os

from easybuild.easyblocks.generic.tarball import Tarball
from easybuild.easyblocks.perl import get_site_suffix
from easybuild.easyblocks.perl import get_major_perl_version, get_site_suffix
from easybuild.tools.build_log import EasyBuildError
from easybuild.tools.filetools import change_dir, patch_perl_script_autoflush
from easybuild.tools.modules import get_software_root
Expand Down Expand Up @@ -59,6 +59,13 @@ def get_dep_path(dep_name, rel_path, log, optional):
class EB_RepeatModeler(Tarball):
"""Support for building/installing RepeatModeler."""

def __init__(self, *args, **kwargs):
"""Easyblock constructor."""
super(EB_RepeatModeler, self).__init__(*args, **kwargs)

# custom path-like environment variables for RepeatModelerConfig
self.module_load_environment.PATH = ['']

def install_step(self):
"""Custom install procedure for RepeatModeler."""
super(EB_RepeatModeler, self).install_step()
Expand Down Expand Up @@ -182,13 +189,9 @@ def sanity_check_step(self):

super(EB_RepeatModeler, self).sanity_check_step(custom_commands=custom_commands, custom_paths=custom_paths)

def make_module_req_guess(self):
"""Custom guesses for path-like environment variables for RepeatModelerConfig."""
guesses = super(EB_RepeatModeler, self).make_module_req_guess()

guesses.update({
'PATH': [''],
'PERL5LIB': [get_site_suffix('sitelib')],
})
def make_module_step(self, *args, **kwargs):
"""Additional path-like environment variables that depend on installation files"""
perl_lib_var = f"PERL{get_major_perl_version()}LIB"
setattr(self.module_load_environment, perl_lib_var, [get_site_suffix('sitelib')])

return guesses
return super().make_module_step(*args, **kwargs)
Loading