It seems to be as simple as this: if the -n
(the Parallel Execution flag) is used, any PythonInteractiveAction
s that use the built-in input()
function fail with EOFError: EOF when reading a line
.
Consider the following task (python3.6):
def task_copy_bpipe_config():
# Filepaths
in_template = ROOT / 'pipeline/bpipe.config.template'
out_template = ROOT / 'pipeline/bpipe.config'
def action():
# Prompt for user input
queue = input('What queueing system do you use? "slurm", "torque", "pbspro", or "none" (no queueing system) are accepted.')
options = {'slurm', "torque", "pbspro", "none"}
if queue not in options:
raise Exception(f'Queueing system must be one of: {", ".join(options)}')
account = input('What account name do you want to use when running jobs in this system?') if not queue == 'none' else ''
# Write out the new config file
template = Template(in_template.read_text())
out_template.write_text(template.render({
'queue': queue,
'account': account
}))
return {
'actions': [PythonInteractiveAction(action)],
'targets': [out_template],
'uptodate': [True]
}
When run with -n
set, it fails as follows:
(python) ubuntu@michael-xl:/mnt/cpipe_install_test$ doit -n 1 install
-- generate_pipeline_id
-- copy_main_config
What queueing system do you use? "slurm", "torque", "pbspro", or "none" (no queueing system) are accepted.. copy_bpipe_config
########################################
TaskError - taskid:copy_bpipe_config
PythonAction Error
Traceback (most recent call last):
File "/mnt/cpipe_install_test/tools/python/lib/python3.6/site-packages/doit/tools.py", line 218, in execute
returned_value = self.py_callable(*self.args, **kwargs)
File "/mnt/cpipe_install_test/dodo.py", line 123, in action
queue = input('What queueing system do you use? "slurm", "torque", "pbspro", or "none" (no queueing system) are accepted.')
EOFError: EOF when reading a line
When run without -n
set, it succeeds, and prompts the user:
(python) ubuntu@michael-xl:/mnt/cpipe_install_test$ doit install
-- generate_pipeline_id
-- copy_main_config
. copy_bpipe_config
What queueing system do you use? "slurm", "torque", "pbspro", or "none" (no queueing system) are accepted.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too