jaraco / pip-run

pip-run - dynamic dependency loader for Python
MIT License
136 stars 19 forks source link

pip_run.read-deps should error when given a nonexistent/unreadable file #47

Closed jwodder closed 3 years ago

jwodder commented 3 years ago

Currently, when pip_run.read-deps is passed a filename that does not exist or cannot be opened, it simply prints an empty line and exits successfully. I contend that this is the wrong behavior; such a filename is an error and should be treated as an error; an error message should be printed, and the command should exit nonzero.

jaraco commented 3 years ago

Good tip. Looking at the code, the reason the behavior is that way is because the underlying DepsReader functionality is intentionally lenient in order to allow for best-effort extraction of requirements from any command-line parameter. Perhaps it would make sense to add a check in read-deps to ensure each parameter exists.