Skip to content

Commit 71e5cb1

Browse files
authored
Tv poncho clean (#4240)
* set PONCHO_PREFIX in run_in_env * use python in PONCHO_PREFIX if defined * lint * use python version major version
1 parent 6cb8c67 commit 71e5cb1

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

poncho/src/poncho/package_create.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ def _copy_run_in_env(env_dir):
108108
f.write(
109109
'env_dir=$(dirname $( cd -- "$( dirname -- "$0" )" > /dev/null 2>&1 && pwd ))\n'
110110
)
111+
f.write('export PONCHO_PREFIX="${env_dir}"\n')
111112
f.write('exec "${env_dir}"/bin/poncho_package_run -e ${env_dir} "$@"\n')
112113
os.chmod(f"{env_dir}/env/bin/run_in_env", 0o755)
113114

taskvine/src/bindings/python3/ndcctools/taskvine/task.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515

1616
import copy
1717
import os
18-
import sys
1918
import textwrap
2019
import uuid
2120
import cloudpickle
21+
import sys
2222

2323

2424
##
@@ -1002,11 +1002,8 @@ def output(self):
10021002
def disable_output_serialization(self):
10031003
self._serialize_output = False
10041004

1005-
def _python_function_command(self, remote_env_dir=None):
1006-
if remote_env_dir:
1007-
py_exec = "python"
1008-
else:
1009-
py_exec = f"python{sys.version_info[0]}"
1005+
def _python_function_command(self):
1006+
py_exec = "${PONCHO_PREFIX:+${PONCHO_PREFIX}/bin/}" + f"python{sys.version_info[0]}"
10101007

10111008
command = f"{py_exec} w_{self._id} f_{self._id} a_{self._id} o_{self._id}"
10121009
return command

0 commit comments

Comments
 (0)