Fix command prefix bug#18
Conversation
|
📖 Docs preview: https://smokeshow.helpmanual.io/0i4j5v393y5q5a173z2l/ |
There was a problem hiding this comment.
Pull request overview
This PR adjusts how submit_to_aml() constructs the runtime command so that --project <dir> is only appended when the user’s command_prefix is a uv command, avoiding incorrect flag injection for non-uv prefixes when project_dir != source_dir.
Changes:
- Gate the
--project <relative dir>append behind acommand_prefixuv-prefix check. - Keep existing behavior of computing the project path relative to
source_dirfor the job’s runtime command.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if command_prefix.startswith("uv") and project_dir != source_dir: | ||
| relative_project_dir = project_dir.relative_to(source_dir) | ||
| command_prefix += f" --project {relative_project_dir}" |
There was a problem hiding this comment.
Following
submit-aml/src/submit_aml/command.py
Lines 96 to 98 in 880c293
I contemplated adding a use_uv flag instead, but I decided against it because it created a confusing user experience (users would always have to remember to unset use_uv when using a non-uv command_prefix).
Currently, if a user specifies a custom command prefix and the project directory does not match the source directory, we append
--project <project dir>to the command prefix regardless of whethercommand-prefixis a uv command.This pr ensures that the
--projectflag is only appended to uv commands.