diff --git a/bin/slurm_calibrate.sh b/bin/slurm_calibrate.sh index d5e87ebc30bfb9649a97543b4cc1e855493446cd..a088389228835377d6ddcc34877cdc61b5eecb65 100755 --- a/bin/slurm_calibrate.sh +++ b/bin/slurm_calibrate.sh @@ -59,6 +59,6 @@ fi if [ "${final}" == "FINAL" ] then - ${finalize} $SLURM_JOB_ID + XFEL_CALIBRATE_PYTHON="${python_path}" ${finalize} $SLURM_JOB_ID fi killall -9 cal_influx_feeder.sh || true diff --git a/xfel_calibrate/calibrate.py b/xfel_calibrate/calibrate.py index 352c4ca3ba9c15dd7d50220a46b761c73eeb8ada..2134bfdba73aea85045467f9e72f33f29773615b 100755 --- a/xfel_calibrate/calibrate.py +++ b/xfel_calibrate/calibrate.py @@ -508,7 +508,7 @@ def create_finalize_script(fmt_args, temp_path, job_list): source /etc/profile.d/modules.sh module load texlive/2019 echo 'Running finalize script' - python3 -c "from xfel_calibrate.finalize import finalize; + "${XFEL_CALIBRATE_PYTHON}" -c "from xfel_calibrate.finalize import finalize; finalize(joblist={{joblist}}, finaljob=$1, run_path='{{run_path}}', diff --git a/xfel_calibrate/finalize.py b/xfel_calibrate/finalize.py index 53bc72912ff3cbe105f9732fa0b7b78c8dd4d596..5c96202fb0802a9b561eb47e52fca6441b7c6207 100644 --- a/xfel_calibrate/finalize.py +++ b/xfel_calibrate/finalize.py @@ -209,7 +209,7 @@ def make_report(run_path, tmp_path, out_path, project, author, version, out_path = report_path try: - check_call(["sphinx-quickstart", + check_call([sys.executable, "-m", "sphinx.quickstart", "--quiet", "--project='{}'".format(project), "--author='{}'".format(author), @@ -222,7 +222,7 @@ def make_report(run_path, tmp_path, out_path, project, author, version, "--no-batchfile", run_path]) except CalledProcessError: - raise Exception("Failed to run sphinx-quickbuild. Is sphinx installed?" + raise Exception("Failed to run sphinx-quickstart. Is sphinx installed?" "Generated simple index.rst instead") # quickbuild went well we need to edit the index.rst and conf.py files @@ -299,7 +299,7 @@ def make_report(run_path, tmp_path, out_path, project, author, version, # finally call the make scripts chdir(run_path) try: - check_call(["make", "latexpdf"]) + check_call(["make", f"SPHINXBUILD={sys.executable} -m sphinx", "latexpdf"]) except CalledProcessError: print("Failed to make pdf documentation")