reynoldsnlp / pipster

pipster: The pythonic way to `pip install`.
MIT License
8 stars 2 forks source link

Consider using subprocess.check_call #7

Closed ncoghlan closed 5 years ago

ncoghlan commented 5 years ago

The currently used subprocess.run() was only added in Python 3.5, which means the current implementation could only be added back to pip after pip had dropped Python 2.7 support (and that's unlikely to happen until some point well after CPython drops support in January 2020).

However, this utility doesn't really need the flexibility of subprocess.run, so it can just use the older subprocess.check_call API, and let the exception escape when the call to pip fails.

It would likely also make sense to avoid capturing the subprocess output, and instead let pip write directly to stdout and stderr for the parent process - that way users will get output that more closely resembles the regular pip command line behaviour without the wrapper needing to do any additional work.