fredrikaverpil / creosote

Identify unused dependencies and avoid a bloated virtual environment.
MIT License
326 stars 8 forks source link

Creosote does not exit with expected status when unused deps are found #145

Closed sanmai-NL closed 1 year ago

sanmai-NL commented 1 year ago

What happened?

It is customary for tools like Creosote to exit with a failure-signalling exit status (value other than zero) when an issue is found. Creosote doesn't. The effect is that CI/CD pipelines in principle cannot detect unused dependencies with Creosote.

Reproduction steps

$ creosote --paths azure/ core/ datapipeline_ff/
Found packages in pyproject.toml: nsone, pip, pulumi, pulumi-azure-native, pulumi-command, pulumi-kubernetes, pulumi-ns1, setuptools
Oh no, bloated venv! 🤢 🪣
Unused packages found: nsone, pip, setuptools
$ echo $status
0

Relevant log output

2.3.7 (current main branch revision)
fredrikaverpil commented 1 year ago

This sounds really strange. I was sure it already did this. I'll have a look later today.

fredrikaverpil commented 1 year ago

Thanks for reporting @sanmai-NL 👍 This was a pretty bad one.