hpcugent / vsc-base

Basic Python libraries used by UGent's HPC group
Other
14 stars 51 forks source link

print warning and resolve to absolute path for commands specified with relative path #320

Open boegel opened 2 years ago

boegel commented 2 years ago

Tests fail on:

OSError: Command PYTHONPATH="..." not found in $PATH!

That's a special case I haven't taken into account yet, indeed: the command to run is not necessarily the first string value, there may be environment stuff in front of it... Oh boy.

@stdweird Any suggestions come to mind on how to handle this edge case?

itkovian commented 2 years ago

Split on ` and drop everything that matches a[a-z0-9A-Z_]+=[^ ]+` at the start of the list?

stdweird commented 2 years ago

@boegel solution is to only set absolute path when no shell is being used. in a shell, the shell will do this anyway

wdpypere commented 1 year ago

@boegel is this still needed? tbh, now we went py3 only I would suggest using pathlib is_absolute() but it seems this was never implemented?