-
Notifications
You must be signed in to change notification settings - Fork 49
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
Allow additional Popen arguments through run #411
Conversation
This is unfortunate, but it appears that we can't pass `None` to get the "default" behavior for the platform, so we'll need to resort to not passing it at all.
Codecov Report
@@ Coverage Diff @@
## master #411 +/- ##
==========================================
- Coverage 81.23% 80.81% -0.43%
==========================================
Files 58 59 +1
Lines 3443 3518 +75
Branches 645 668 +23
==========================================
+ Hits 2797 2843 +46
- Misses 601 630 +29
Partials 45 45
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please describe the which led you to create this patch.
Alternatively, we could pass
**kwargs
through to the subprocess creation function.
That sounds like a more future-proof option. In order to do so it should be checked if all possible keyword arguments should be accepted.
Alright, I started that change. Can you elaborate on what you'd like to see regarding the checking of the keyword arguments? For reference, here is how the behavior is documented on the asyncio functions that we're chaining to: https://docs.python.org/3/library/asyncio-subprocess.html#asyncio.create_subprocess_exec |
I've been experimenting with more robust job management regarding GNU Make, and a full jobserver implementation requires sharing open file handles with subordinate processes. I'm still not sure if it's going to pan out, but having the ability to control more of the options is useful even outside of that context. |
I'm definitely interested in a full Make jobserver for colcon! It's one of the pain points we have relative to catkin_tools. |
It's encouraging to hear that. I had a working prototype a year ago, but it was a little rough. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The documentation and change are similar to how subprocess.run() describes its own arguments.
The arguments shown above are merely the most common ones, described below in Frequently Used Arguments (hence the use of keyword-only notation in the abbreviated signature). The full function signature is largely the same as that of the Popen constructor - most of the arguments to this function are passed through to that interface. (timeout, input, check, and capture_output are not.)
Alternatively, we could pass
**kwargs
through to the subprocess creation function.