Write utility to clean up after deleted code

Description

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.

A/C:

  • 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.

Steps to Reproduce

None

Current Behavior

None

Expected Behavior

None

Reason for Variance

None

Release Notes

None

User Impact Summary

None

Assignee

Unassigned

Reporter

Jeremy Bowman

Labels

None

Reach

None

Impact

None

Platform Area

None

Customer

None

Partner Manager

None

URL

None

Contributor Name

None

Groups with Read-Only Access

None

Actual Points

None

Category of Work

None

Platform Map Area (Levels 1 & 2)

None

Platform Map Area (Levels 3 & 4)

None

Story Points

2

Priority

Unset
Configure