Several people have recently had trouble with devstack because a package was renamed, but *.pyc and _pycache_ content was left behind in the old location in local environments. This has also happened before a few times. Relevant discussions:
We should consider writing a utility that automatically cleans up leftover content in such cases, and make it run as part of the standard development flow.
Maintain a list of deleted Python modules and packages.
Ideally fail CI if such files removed in a PR have not been added to the list.
There is a command-line utility to remove common remnants after such deletions.
The utility should not delete unexpected leftovers without warning the user.
The utility should have minimal dependencies, i.e. no paver.
As much of this as possible should reside in a lightweight package easily usable by many repositories.
The utility should be automatically run at an appropriate point in the standard devstack worfklow.