Document the workflow for deprecating something in CPython. #1419
Open
Description
Describe the enhancement or feature you'd like
Document the workflow on how to deprecate something in CPython.
Deprecating something in Python involves raising deprecation warning and then actually removing the code some time later (at least 2 release cycles). We don't have this process documented clearly.
Describe alternatives you've considered
Currently this is undocumented process, and each of us has to just figure it out somehow.
Additional context
Discussed on Discord core-workflow-and-bots channel, and now opening a ticket based on the discussions.
Basic process:
- An issue was opened calling for deprecation of something
- We deprecate the code by adding warnings.deprecated (or warnings._deprecated)
- Document the deprecation. Needs a Porting doc (how?)
- The issue can be closed after the code for adding deprecation has been merged. It doesn't need to stay open for 2+ more years.
- Add the deprecation to the
pending-removal-in....rst
file - At the scheduled removal year, open a new issue for the removal
- Finally remove the code
Other info:
- Some deprecations don't have set removal date.
- There are also deprecated-removed Sphinx role to help advertise the removal dates.
- How to decide whether Removal/Deprecation is the right solution?
- search the usage, search on GitHub, grep, check PyPI projects to get an idea of the widespread usage
- when searching, look not just if people are using it, but how they're using it. Document the use case for the porting notes
- Is there a template for deprecation warning message?
- Should have documentation about how to port/replace it (porting notes)
- Users are encouraged to give feedback about deprecation by filing an issue
Note there is an open proposal for extending the removal of deprecated code to 5 years instead of 2.
Metadata
Assignees
Labels
No labels