Update the procedure for a module's removal to cover the 'deprecated' directive

in the module's docs. Also state that removing the module in 3.0 first is the
best option to know where the module itself is used.
This commit is contained in:
Brett Cannon 2008-05-08 04:40:25 +00:00
parent 89a7ff6a1f
commit b1a674bfe9
1 changed files with 33 additions and 31 deletions

View File

@ -871,37 +871,10 @@ Transition Plan
For modules to be removed
-------------------------
Use of modules which will not be deleted in the Python 2.x series
will generate a ``DeprecationWarning`` using the
``warnings.warn3k()`` function.
In Python 2.6
/////////////
#. Add the following code to the deprecated module (adjusting the
module name and the ``warnings`` import and needed)::
from warnings import warnpy3k
warnpy3k("the XXX module has been removed in Python 3.0",
stacklevel=2)
del warnpy3k
(the Python-Dev TextMate bundle, available from ``Misc/TextMate``,
contains a command that will generate all of this for you).
#. Update the documentation. For modules with their own documentation
file, use the ``:deprecated:`` option for the ``module`` directive.
For modules simply listed in a file (e.g., ``undoc.rst``), use the
``warning`` directive.
#. Add the module to the module deletion test in ``test_py3kwarn``.
#. Check in the change w/ appropriate ``Misc/NEWS`` entry (**block**
the checkin in ``py3k``!).
#. Update this PEP noting that the 2.6 step is done.
For module removals, it is easiest to remove the module first in
Python 3.0 to see where dependencies exist. This makes finding
code that (possibly) requires the suppression of the
DeprecationWarning easier.
In Python 3.0
@ -924,6 +897,35 @@ In Python 3.0
#. Update this PEP noting that the 3.0 step is done.
In Python 2.6
/////////////
#. Add the following code to the deprecated module (adjusting the
module name and the ``warnings`` import and needed)::
from warnings import warnpy3k
warnpy3k("the XXX module has been removed in Python 3.0",
stacklevel=2)
del warnpy3k
(the Python-Dev TextMate bundle, available from ``Misc/TextMate``,
contains a command that will generate all of this for you).
#. Update the documentation. For modules with their own documentation
file, use the ``:deprecated:`` option for the ``module`` directive
along with the ``deprecated`` directive, stating the deprecation
is occurring in 2.6, but is for the module's removal in 3.0.
For modules simply listed in a file (e.g., ``undoc.rst``), use the
``warning`` directive.
#. Add the module to the module deletion test in ``test_py3kwarn``.
#. Check in the change w/ appropriate ``Misc/NEWS`` entry (**block**
the checkin in ``py3k``!).
#. Update this PEP noting that the 2.6 step is done.
Renaming of modules
-------------------