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

inject custom '%(python)s' template value before getting value of 'buildcmd' custom easyconfig parameter in PythonPackage easyblock #3539

Merged
Merged
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: 6 additions & 3 deletions easybuild/easyblocks/generic/pythonpackage.py
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,11 @@ def configure_step(self):

def build_step(self):
"""Build Python package using setup.py"""
build_cmd = self.cfg.get_ref('buildcmd')

# inject extra '%(python)s' template value before getting value of 'buildcmd' custom easyconfig parameter
self.cfg.template_values['python'] = self.python_cmd
build_cmd = self.cfg['buildcmd']

if self.use_setup_py:

if get_software_root('CMake'):
Expand All @@ -829,10 +833,9 @@ def build_step(self):

if not build_cmd:
build_cmd = 'build' # Default value for setup.py
build_cmd = '%(python)s setup.py ' + build_cmd
build_cmd = f"{self.python_cmd} setup.py {build_cmd}"

if build_cmd:
build_cmd = build_cmd % {'python': self.python_cmd}
cmd = ' '.join([self.cfg['prebuildopts'], build_cmd, self.cfg['buildopts']])
res = run_shell_cmd(cmd)

Expand Down