-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get run command from stdout #1415
Comments
First I thought this could be done automatically when the command is not provided, but I see that in that case, it's already handled as copying (or linking?) the dependency to the output, which also makes sense. But still, it's a shame that it's taken 😄 |
Also, you could inject each dependency as
It would be nice to use same notation as Makefile: Edit: Just learned that |
I'm not sure about this one, @prihoda. Why won't you write a script instead?
|
About the other suggestion of using variables for input and dependencies, I don't think it would bring to much value, to be honest; the commands are already interpreted by a shell, so you can have globbing, for example: I guess the cool think about having "special variables" in Makefiles are the implicit rules. For example, this Makefile: https://github.com/mroutis/bgc/blob/master/Makefile For the first rule |
@prihoda In order to handle all the line breaks and possible open parenthesis, we would have to implement a mini shell for @MrOutis @MrOutis The problem with
I'm sure that we will have to support some variable expansion and similar tricks eventually 🙂 |
That's true @efiop ! run_parser.add_argument(
'-d',
'--deps',
- action='append',
- default=[],
+ nargs='+',
help='Declare dependencies for reproducible cmd.')
run_parser.add_argument(
'-o', Sadly, this will break backwards compatibility, but it would enable the following syntax: |
@MrOutis I've meant that Makefile expands those variables dynamically(e.g. each time you run make), while dvc in your example would bake all of the *.txt dependencies into a dvc file once. 🙂 Also, if you would do
it might interfere with the command, which is defined as a REMAINDER. In your example you are lucky because you didn't specify -d option last before your command. If you would to do that, there would be no way for a parser to distinguish between where the deps end and where the commands starts:
|
Indeed, @efiop , introducing a |
Thanks guys for the replies! Yeah sometimes I don't realize that it's actually not that easy 😄This can already be accomplished using the existing features, so I don't mind if it's not implemented. |
Looks like we could close this. Please feel free to reopen, if I've missed something. |
Hi, I'm often running multiple commands in dvc run, which can be done by wrapping the command in quotes:
It would be nice if I could input the command using stdout prompt instead, e.g. by running:
The text was updated successfully, but these errors were encountered: