简体   繁体   中英

Which Python packages aren't used in application

Can you recommend a CLI / python package to tell me which modules aren't being imported into my application?

I considered using coverage + nosetests, but many of the unwanted/not needed packages have tests (to the credit of the previous developer).

As background, I'm dealing with a legacy code base and want to remove what isn't being used so far so I can reduce my mental load before a refactor.

There's a Python module called vulture for doing exactly this. I haven't used it, but:

Vulture finds unused classes, functions and variables in your code.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM