pyupio / safety

Safety checks Python dependencies for known security vulnerabilities and suggests the proper remediations for vulnerabilities detected.
https://safetycli.com/product/safety-cli
MIT License
1.66k stars 141 forks source link

return code is 0 even though nothing was checked #486

Open vitamins opened 6 months ago

vitamins commented 6 months ago

The return code 0 should mean that that the given packages have been successfully checked.

p = subprocess.run(["safety", "check", "--output", "bare", "--stdin"], input="django", capture_output=True, text=True) print(p.returncode) 0 print(p.stderr) Warning: unpinned requirement 'django' found in None, unable to check.

I know that i can set input="django==5.0" to make it work but that is not the point.

Also, if there is a way to use safety without subprocess from python it would be perfect.