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
Command-line cop-out plugin #16
Comments
Sounds like a good idea. I think that forwarding the output would only be appropriate when the command fails, or in verbose mode. |
I changed the requirements a bit because I think it fits the current plugin architecture better and it prevents you from doing too crazy things with it. If you activate the plugin like so use_plugin('exec') Defining executions and when to run them is done with properties like project.set_property('run_unit_tests_command', 'py.test %s' % project.expand_path('$dir_source_unittest_python')) which would run py.test on the unittest directory during the run_unit_tests phase. You have fine-grained control over the output handling. The default is to write the stdout / stderr in a file in the reports directory. project.set_property('run_unit_tests_propagate_stdout', True)
project.set_property('run_unit_tests_propagate_stderr', True) Once again, you can replace |
Yep, sounds good! Thanks @mriehl ! |
So this hasn't been implemented yet has it? |
I'm confused as to the difference between an 'execution phase' and a 'task'. Surely they are the same thing, except 'execution phase' implies that there is some level of ordering of execution whereas task does not necessarily. |
The plugin is available since Version 0.9.11 Current version is 0.9.12 |
Yes, exactly. I'm referring to the task name but for tasks where ordering is implied. For very simple cases, defining a task in your build.py does the trick. The exec plugin allows you to skip the boilerplate code to run a shell command for the most useful tasks like testing, analyzing and packaging. |
Thank you, this seems to be working well. I ran mamba, a Python test runner this way and found the log messages have lost their colours and have had all of its logging levels flattened to |
In the case where a python function is available, I'd rather use something like @task
def run_unit_tests(project, logger):
my_mamba_entrypoint() in your build.py. This would allow you to decide if you want to use the pybuilder logger or just let mamba write on stdout. |
Ah, very nice. Thanks! |
To increase adoption of pybuilder without supporting every possible thing Pythonistas would like to do under the sun, we'll want a
python.exec_cmd
plugin that lets users pretty much define their own arbitrary shell commands and incorporate them as a part of the build process.Liken this to the Maven exec plugin
The text was updated successfully, but these errors were encountered: